The design for reconciling upstream's TablePrimitive UI family with dev's output:"export" static-SPA constraint. The root conflict: upstream uses server-component param routing (params: Promise + use(params)); dev uses a generateStaticParams() placeholder route plus usePathname()/useParams(). The approach ports TablePrimitive/TableToolbar/HeaderFilterDropdown as pure client components mapped onto the placeholder-route idiom, wired to the already-landed overview RPCs (0012–0015) via mikeApi.ts. Success = a future upstream cherry-pick here no longer needs Pattern-A rejection. Tackling the table-primitive rewrite — a focused branch outside a sync batch.
OSS-5 — Design: reconciling the table-primitive UI with static export
Background: why this keeps getting rejected
Upstream and the dev fork have a structural disagreement about how dynamic pages are served:
| Upstream (willchen96/mike) | Dev fork (MikeAzureDev) | |
|---|---|---|
| Build | server-rendered / SSR-capable | output: "export" (static SPA) |
| Dynamic route param | params: Promise<{id}> + use(params) in a server component |
generateStaticParams() returns [{ id: "_" }] placeholder; client reads the real id from usePathname() / useParams() |
| Page shell | per-route layout.tsx server components |
single client ProjectPage.tsx + ToolbarTabs.tsx |
Because the static export pre-renders one placeholder page per dynamic route and
hydrates on the client, any component that depends on server-component param
resolution cannot be adopted as-is. Upstream's 9a1277b table-primitive work
is built directly on that server-component shell, so the migration rejects the
whole family (Pattern A — "keep ours") rather than half-porting it under a sync's
time pressure.
Rejected in 9a1277b (notes/upstream-sync/mikeOssOrig-batch-20260617.md):
TablePrimitive, TableToolbar, HeaderFilterDropdown, ProjectWorkspace,
ProjectDocumentsView (upstream's renamed ProjectPage), ProjectAssistantTable,
ProjectReviewsTable, projects/[id]/layout.tsx, plus the rewrites of
ProjectsOverview / WorkflowList / tabular + project pages. Only the additive
Modal headerAction prop was taken.
Goal
Re-implement the table-primitive UX so it (a) matches upstream's behaviour and
visual design closely enough that future syncs of this area apply cleanly, and
(b) runs entirely within output: "export".
Approach
1. TablePrimitive family as pure client components
Port TablePrimitive, TableToolbar, HeaderFilterDropdown as "use client"
components. They are presentational — sorting/filtering/selection state lives in
React state, data arrives via props. This part is largely architecture-neutral
and should port with minimal change; the friction is only where upstream wires
them into server-component pages.
2. Page shells onto the placeholder-route idiom
Upstream introduces projects/[id]/layout.tsx (server component) and
ProjectWorkspace/ProjectDocumentsView. Map these onto dev's existing pattern:
- Keep dev's
projects/[id]/page.tsxserver stub withexport function generateStaticParams() { return [{ id: "_" }] }. - Move the workspace shell into a client component (e.g.
ProjectWorkspace.tsx) that reads the project id fromusePathname()/useParams()and renders the tabbed table views. This replaces dev's currentProjectPage.tsxbody while preserving its routing contract. - Do not adopt
projects/[id]/layout.tsxif a client shell suffices; if a shared layout is genuinely needed, make it a client layout that does not calluse(params).
3. Data flow
Upstream's table pages consume the new overview RPCs — already landed in dev
as 0012–0015 and exposed through the refactored list routes
(GET /api/projects, /api/chat, /api/tabular-reviews, /api/workflows).
Wire the ported tables to the existing client API hooks (mikeApi.ts); no new
backend work is required.
4. Listing pages + Modal
- Re-apply the
ProjectsOverview/WorkflowList/ tabular-page rewrites on top of the client shells. - Revisit the
Modalrefactor: dev currently carries only the additiveheaderActionprop. If the table UI needs more of upstream's Modal surface, port those changes here (in dev's idiom) rather than piecemeal in a sync.
Invariants to preserve (do not regress)
next buildwithoutput: "export"stays green; no route may rely on server-component param resolution.- Entra auth, no Supabase-Auth MFA step-up (
MfaVerificationPopupdoes not exist on dev), Key Vault secrets, the/apiroute prefix, and theConfigContextprovider all remain. - The MCP connectors feature and
/account/connectorspage are untouched.
Verification
pnpm build(frontend) green; spot-check the placeholder routes serve via the backendfindShell()path (the static export +_-substitution serving the app already relies on, see the Entra-local runbook).- Manual: project page (documents + assistant + reviews tabs), workflow detail, tabular review all render with the table UX and correct id resolution on deep links / refresh.
- Convergence check (the real success metric): after this lands, re-run a dry cherry-pick of a future upstream commit touching this area and confirm it no longer requires a Pattern-A rejection.
Effort / risk
- Effort: medium-large — this is a UI subsystem rewrite, not a conflict fix. Best done as a focused branch outside a sync batch.
- Risk: medium — touches the most-used pages. Mitigated by the green-build gate and the static-export invariants above. No backend/schema risk (already landed).
References
- Upstream commit:
9a1277b("refactor: add table primitive and migrations by date; feat: add mcp connectors"), PR #183. - Dev port:
d73162conupstream-sync/mikeOssOrig-batch-20260617. - Migration notes:
notes/upstream-sync/mikeOssOrig-batch-20260617.md. - Static-export idiom precedent:
projects/[id]and the workflow typed routes (workflows/assistant/[id],workflows/tabular-review/[id]) ported infebd8dc.