PR: #515: feat(matter): split Hearings into Sessions/Orders routed subpages [Story-2033] by @ankitmaheshwari-com
View PR →

Files changed

12 file(s), +383 / -195 lines

Path Role + -
messages/en.jsonConfig+3-2
messages/hi.jsonConfig+3-2
src/app/[locale]/(workspace)/matters/[matterId]/hearings/layout.tsxApp route+33-0
src/app/[locale]/(workspace)/matters/[matterId]/hearings/orders/page.tsxApp route+76-0
src/app/[locale]/(workspace)/matters/[matterId]/hearings/page.tsxApp route+14-80
src/app/[locale]/(workspace)/matters/[matterId]/hearings/sessions/page.tsxApp route+76-0
src/components/matter-detail/matter-worknav.tsxComponent+6-2
src/components/matters/hearings/hearings-subtabs.tsxComponent+61-0
src/components/matters/hearings/hearings-tab.tsxComponent+0-101
src/components/matters/hearings/orders-panel.tsxComponent+50-0
src/components/matters/hearings/sessions-panel.tsxComponent+43-0
src/lib/surface-registry/route-registry.tsLibrary+18-8

Story-2033: Split Hearings into routed subpages — Sessions / Orders

The Hearings tab's two subtabs — Hearing Sessions and Orders & Directions — are now real, deep-linkable routes: /matters/[matterId]/hearings/sessions and /matters/[matterId]/hearings/orders. The bare /matters/[matterId]/hearings URL never renders naked — it redirects to Sessions (the default). This continues EPIC-2018 (route-per-mode) on top of the fat matter layout (S1, Story-2019), one level down: a subtab is now the URL, not useState.

What changed

Why the bare redirect resolves through the surface key

A literal redirect("./sessions") resolves relative to the request URL and would drop the locale / matter segments. The page instead builds the target from the durable key: redirect(localizeHref(locale, buildSurfacePath("matter.hearings.sessions", { matterId }))) — yielding /en/matters/42/hearings/sessions, keeping the locale prefix, and obeying the repo rule to navigate by surface_key, never a string-built raw URL.

Trade-off: subtab counts dropped

The old SegmentedFilter showed a live count badge per subtab, which was free when one page fetched both streams. With the split, each subpage prefetches only its own stream (the whole point — RFD §4), so the <Link> subtab row intentionally drops the counts rather than double-fetching the sibling stream just to badge it.

Verification