This PR bundles staging-readiness work, Next.js 16 performance substrate changes, marketing/create-flow UX fixes, and operator documentation updates on branch adilallo/Backend/StagingCleanup.
The main goals:
Ship Next 16 Cache Components (PPR) so marketing pages prerender a static shell while session-aware nav streams in, reducing first-load JS on / (~45 KB → ~11.7 KB gzipped static shell per docs/perf/next16-eval.md).
Enable React Compiler plumbing in annotation mode (no behavior change until components opt in with "use memo").
Fix create-flow recommendation flash — method cards no longer render in authoring order then jump to facet-ranked “Recommended” order after the API returns.
Stop noisy guest draft cleanup — skip DELETE /api/drafts/me when the user is not signed in.
Cross-browser / mobile polish — favicons, SVGR ID collisions, iPhone input zoom and button states, footer and modal fixes.
Operator docs — new steady-state runbook and updated deploy guides for MEDLab Cloudron staging/production.
Changes
Performance & Next 16 substrate
Enable experimental.cacheComponents in next.config.mjs; remove force-dynamic from (app) / (admin) layouts and wrap session-aware nav in <Suspense fallback={null}>.
Add route-level loading.tsx for marketing and create-flow groups.
tests/unit/prepareFreshCreateFlowEntry.test.ts — guest vs signed-in draft cleanup.
Updates across component, page, e2e, and layout tests for nav/marketing/create-flow changes.
How to Test
Setup
npm install
npx tsc --noEmit
npx vitest run
npx next build
npm run dev
Create flow — recommended cards (signed-in or guest with facets)
Start a new rule from the homepage; complete community facet steps (size, structure, context, etc.).
Navigate to Communication methods (and repeat for Membership, Decision Approaches, Conflict Management).
Verify cards appear once in facet-ranked order with “Recommended” badges — no flash from authoring order to ranked order.
On a slow connection, card area may be briefly empty (aria-busy) rather than showing wrong order.
Create flow — guest draft cleanup
While logged out, click Create rule from the top nav.
Open DevTools → Network.
Confirm noDELETE /api/drafts/me request (no 401).
Confirm local draft keys are still cleared and wizard starts fresh.
Create flow — signed-in draft cleanup
Sign in with a saved server draft.
Click Create rule or Start new custom rule from profile.
Confirm DELETE /api/drafts/me fires once and wizard starts clean.
Performance / PPR
Run npx next build and confirm marketing routes show partial prerender (◐) where expected.
Load / and verify nav streams in without layout shift; compare static shell size to pre-change baseline if using bundle analyzer.
Cross-browser / mobile
Check favicons in Chrome, Safari, and Firefox (tab icon + iOS home-screen icon).
On iPhone Safari: tap inputs in create flow modals — text should not zoom unexpectedly; buttons should have sensible pressed states.
Pages with multiple SVG icons (footer social logos, icon grids) — no missing/clipped icons from ID collisions.
Marketing fixes
Footer links/buttons work on mobile and desktop.
Ask Organizer modal opens, submits, and dismisses correctly.
/about triple-step block renders correctly at md+ breakpoints.
Regression
npm run e2e # if environment supports it
npm run storybook # Footer, FeatureGrid, TripleTextBlock stories
## Overview
This PR bundles staging-readiness work, Next.js 16 performance substrate changes, marketing/create-flow UX fixes, and operator documentation updates on branch `adilallo/Backend/StagingCleanup`.
The main goals:
- **Ship Next 16 Cache Components (PPR)** so marketing pages prerender a static shell while session-aware nav streams in, reducing first-load JS on `/` (~45 KB → ~11.7 KB gzipped static shell per `docs/perf/next16-eval.md`).
- **Enable React Compiler plumbing** in annotation mode (no behavior change until components opt in with `"use memo"`).
- **Fix create-flow recommendation flash** — method cards no longer render in authoring order then jump to facet-ranked “Recommended” order after the API returns.
- **Stop noisy guest draft cleanup** — skip `DELETE /api/drafts/me` when the user is not signed in.
- **Cross-browser / mobile polish** — favicons, SVGR ID collisions, iPhone input zoom and button states, footer and modal fixes.
- **Operator docs** — new steady-state runbook and updated deploy guides for MEDLab Cloudron staging/production.
## Changes
### Performance & Next 16 substrate
- Enable `experimental.cacheComponents` in `next.config.mjs`; remove `force-dynamic` from `(app)` / `(admin)` layouts and wrap session-aware nav in `<Suspense fallback={null}>`.
- Add route-level `loading.tsx` for marketing and create-flow groups.
- Enable React Compiler (`compilationMode: "annotation"`) + ESLint plugin wiring.
- Marketing page optimizations: move inline copy to `messages/en/marketing.ts`, lazy-load heavy sections, trim LogoWall/QuoteBlock client work, extend image `minimumCacheTTL`.
- Add `docs/perf/next16-eval.md` documenting evaluation, blockers resolved, and outcomes.
### Create flow — facet recommendations
- Add shared cache + deduped fetch in `lib/create/facetRecommendationsLoad.ts`.
- Prefetch all four method-deck scores from `CreateFlowLayoutClient` once community facets are selected.
- Gate `CardStack` rendering on `recommendationsReady` in Communication, Membership, Conflict Management, and Decision Approaches screens.
- Refactor `useFacetRecommendations` to read cache synchronously on mount.
### Create flow — draft cleanup
- `prepareFreshCreateFlowEntrySync` / `prepareFreshCreateFlowEntry` accept `{ signedIn?: boolean }`.
- Server draft `DELETE` and `create:fresh-entry-pending` sentinel only run when `signedIn: true` and backend sync is on.
- Top nav passes `loggedIn`; profile passes `signedIn: true`; marketing entry points default to guest behavior.
### UI / accessibility fixes
- Generate and wire cross-browser favicons (`public/favicon*`, `apple-touch-icon.png`, `scripts/generate-favicons.mjs`).
- Fix SVGR loading: preserve `viewBox`, prefix SVG clip/mask IDs to avoid collisions when multiple icons share a page.
- iPhone: reduce unwanted input zoom (`TextInput`), improve button active/focus states.
- Footer button layout/behavior fixes; Ask Organizer modal fixes; About page `TripleTextBlock` layout fix; remove erroneous focus ring on Feature Grid section.
### Docs & ops
- New `docs/guides/ops-runbook.md` — steady-state deploy, rollback, recovery on Cloudron.
- Updates to `ops-backend-deploy.md`, backend roadmap/Linear tickets, static assets guide, relaunch brief.
- Gitea issue templates (bug report + feedback/suggestion).
### Tests
- `tests/unit/facetRecommendationsLoad.test.ts` — cache + in-flight dedupe.
- `tests/unit/prepareFreshCreateFlowEntry.test.ts` — guest vs signed-in draft cleanup.
- Updates across component, page, e2e, and layout tests for nav/marketing/create-flow changes.
## How to Test
1. **Setup**
```bash
npm install
npx tsc --noEmit
npx vitest run
npx next build
npm run dev
```
2. **Create flow — recommended cards (signed-in or guest with facets)**
- Start a new rule from the homepage; complete community facet steps (size, structure, context, etc.).
- Navigate to **Communication methods** (and repeat for Membership, Decision Approaches, Conflict Management).
- Verify cards appear once in facet-ranked order with “Recommended” badges — **no flash** from authoring order to ranked order.
- On a slow connection, card area may be briefly empty (`aria-busy`) rather than showing wrong order.
3. **Create flow — guest draft cleanup**
- While **logged out**, click **Create rule** from the top nav.
- Open DevTools → Network.
- Confirm **no** `DELETE /api/drafts/me` request (no `401`).
- Confirm local draft keys are still cleared and wizard starts fresh.
4. **Create flow — signed-in draft cleanup**
- Sign in with a saved server draft.
- Click **Create rule** or **Start new custom rule** from profile.
- Confirm `DELETE /api/drafts/me` fires once and wizard starts clean.
5. **Performance / PPR**
- Run `npx next build` and confirm marketing routes show partial prerender (`◐`) where expected.
- Load `/` and verify nav streams in without layout shift; compare static shell size to pre-change baseline if using bundle analyzer.
6. **Cross-browser / mobile**
- Check favicons in Chrome, Safari, and Firefox (tab icon + iOS home-screen icon).
- On iPhone Safari: tap inputs in create flow modals — text should not zoom unexpectedly; buttons should have sensible pressed states.
- Pages with multiple SVG icons (footer social logos, icon grids) — no missing/clipped icons from ID collisions.
7. **Marketing fixes**
- Footer links/buttons work on mobile and desktop.
- Ask Organizer modal opens, submits, and dismisses correctly.
- `/about` triple-step block renders correctly at md+ breakpoints.
8. **Regression**
```bash
npm run e2e # if environment supports it
npm run storybook # Footer, FeatureGrid, TripleTextBlock stories
```
an.di
changed title from ackend / staging cleanup, performance substrate, and create-flow polish to Backend / staging cleanup, performance substrate, and create-flow polish2026-05-26 15:10:59 +00:00
an.di
self-assigned this 2026-05-26 15:11:07 +00:00
an.di
merged commit 3de8ffc4ef into main2026-05-26 15:11:47 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Overview
This PR bundles staging-readiness work, Next.js 16 performance substrate changes, marketing/create-flow UX fixes, and operator documentation updates on branch
adilallo/Backend/StagingCleanup.The main goals:
/(~45 KB → ~11.7 KB gzipped static shell perdocs/perf/next16-eval.md)."use memo").DELETE /api/drafts/mewhen the user is not signed in.Changes
Performance & Next 16 substrate
experimental.cacheComponentsinnext.config.mjs; removeforce-dynamicfrom(app)/(admin)layouts and wrap session-aware nav in<Suspense fallback={null}>.loading.tsxfor marketing and create-flow groups.compilationMode: "annotation") + ESLint plugin wiring.messages/en/marketing.ts, lazy-load heavy sections, trim LogoWall/QuoteBlock client work, extend imageminimumCacheTTL.docs/perf/next16-eval.mddocumenting evaluation, blockers resolved, and outcomes.Create flow — facet recommendations
lib/create/facetRecommendationsLoad.ts.CreateFlowLayoutClientonce community facets are selected.CardStackrendering onrecommendationsReadyin Communication, Membership, Conflict Management, and Decision Approaches screens.useFacetRecommendationsto read cache synchronously on mount.Create flow — draft cleanup
prepareFreshCreateFlowEntrySync/prepareFreshCreateFlowEntryaccept{ signedIn?: boolean }.DELETEandcreate:fresh-entry-pendingsentinel only run whensignedIn: trueand backend sync is on.loggedIn; profile passessignedIn: true; marketing entry points default to guest behavior.UI / accessibility fixes
public/favicon*,apple-touch-icon.png,scripts/generate-favicons.mjs).viewBox, prefix SVG clip/mask IDs to avoid collisions when multiple icons share a page.TextInput), improve button active/focus states.TripleTextBlocklayout fix; remove erroneous focus ring on Feature Grid section.Docs & ops
docs/guides/ops-runbook.md— steady-state deploy, rollback, recovery on Cloudron.ops-backend-deploy.md, backend roadmap/Linear tickets, static assets guide, relaunch brief.Tests
tests/unit/facetRecommendationsLoad.test.ts— cache + in-flight dedupe.tests/unit/prepareFreshCreateFlowEntry.test.ts— guest vs signed-in draft cleanup.How to Test
Setup
Create flow — recommended cards (signed-in or guest with facets)
aria-busy) rather than showing wrong order.Create flow — guest draft cleanup
DELETE /api/drafts/merequest (no401).Create flow — signed-in draft cleanup
DELETE /api/drafts/mefires once and wizard starts clean.Performance / PPR
npx next buildand confirm marketing routes show partial prerender (◐) where expected./and verify nav streams in without layout shift; compare static shell size to pre-change baseline if using bundle analyzer.Cross-browser / mobile
Marketing fixes
/abouttriple-step block renders correctly at md+ breakpoints.Regression
ackend / staging cleanup, performance substrate, and create-flow polishto Backend / staging cleanup, performance substrate, and create-flow polish