8 file(s), +184 / -129 lines
| Path | Role | + | - |
|---|---|---|---|
| src/app/[locale]/(workspace)/matters/[matterId]/brief/page.test.tsx | App route | +72 | -0 |
| src/app/[locale]/(workspace)/matters/[matterId]/brief/page.tsx | App route | +70 | -0 |
| src/app/[locale]/(workspace)/matters/[matterId]/page.test.tsx | App route | +9 | -59 |
| src/app/[locale]/(workspace)/matters/[matterId]/page.tsx | App route | +11 | -59 |
| src/lib/agents/__tests__/client-tool-dispatcher.test.ts | Library | +1 | -1 |
| src/lib/surface-registry/navigation.test.ts | Library | +2 | -2 |
| src/lib/surface-registry/route-registry.ts | Library | +1 | -1 |
| tests/unit/matter-detail-route.test.tsx | Test | +18 | -7 |
The Brief now has its own real URL —
/matters/[matterId]/brief — and the bare matter URL
(/matters/[matterId]) never renders naked: it redirects to
the Brief route. This continues EPIC-2018 (route-per-mode) on top of the
fat layout landed in S1 (Story-2019). The Brief body itself is unchanged.
matters/[matterId]/page.tsx to
matters/[matterId]/brief/page.tsx, keeping its existing
appGetMatterBrief / FrameStatus /
frameVersions server prefetch inside
<HydrationBoundary> — so the Brief still lands in the
client cache and paints with no refetch flash. It carries the
agentSurface key matter.brief (presence key
AgentSurfaces.matterBrief, already present in en + hi).
page.tsx is now a thin server component that
redirect()s to the Brief route and exports
agentSurface = null (with a // no-agent:
reason). The matter's own layout.tsx already owns
matterId validation and the shared chrome, so the redirect
page does no fetching.
"./brief"
A literal redirect("./brief") resolves relative to the
request URL — against /en/matters/42 the browser would land on
/en/matters/brief (the last segment is replaced), which is
wrong. Instead the page builds the target from the durable surface key:
redirect(localizeHref(locale, buildSurfacePath("matter.brief", { matterId }))).
That yields /en/matters/42/brief, keeps the locale prefix, and
survives any future route change to matter.brief — and obeys
the repo rule to navigate by surface_key, never a string-built
raw URL.
brief/page.test.tsx (audit log still deferred via
after(), first paint doesn't block on the audit fan-out).page.test.tsx now asserts the redirect target is
/en/matters/42/brief.tests/unit/matter-detail-route.test.tsx (matter-number
resolution M-0001 → M-0013 → M-0120 and the M-ABC
not-found case) was repointed to the Brief route, its new home for that
resolution + open-audit behaviour.navigation.test and the client-tool dispatcher test were
updated for the new matter.brief path
(/matters/[matterId]/brief).LiveMatterShell state machine —
S4–S7.
pnpm gen:routes + pnpm check:routes (30 surfaces,
fresh), pnpm lint (0 errors), pnpm test
(1001 passed), and pnpm build are green. The build output shows
both /[locale]/matters/[matterId] and
/[locale]/matters/[matterId]/brief.