PR: #687: feat(clients): add related matters register [Story-2688]
by @ayush-pramaan
View PR →
Story 2688
Client detail now shows the client's related matters
The client detail page now fetches this client's matters through the generated matters list cache and renders them below the header as a searchable, status-filtered register.
What changed
-
/clients/[clientId]server-prefetchesmattersGateway.list({ clientId })into the generateduseAppListMattersquery key. - The page renders related-matter status tabs, counts, search, and a shadcn table directly below the client header.
- The table shows Reference, Matter, Type, Status, and Docs; every matter cell path opens the matter route.
- The old divider below the client header is gone. Email and phone rendering remains unchanged.
States covered
| State | Expected result |
|---|---|
| Default | Rows render with matter references, status badges, document counts, toolbar counts, and matter links. |
| Empty | A zero-matter client sees the dedicated “No matters yet” empty state. |
| Filtered empty | Changing status/search can show a separate no-match state without replacing the zero-data empty copy. |
Review path
- Open
Clients/ClientRelatedMattersRegisterin Storybook. - Confirm the Default story shows Discovery and Active rows with correct tab counts.
- Switch tabs and search for a matter title or reference.
- Open the Empty story and confirm the copy is “No matters yet”.
- Open a real client detail page and confirm the table sits directly under the header, with no divider.
Files changed
18 file(s), +749 / -49 lines
| Path | Role | + | - |
|---|---|---|---|
| messages/en.json | Config | +19 | -0 |
| messages/hi.json | Config | +19 | -0 |
| openapi/permission-map.json | Config | +35 | -0 |
| src/app/[locale]/(workspace)/clients/[clientId]/page.tsx | App route | +34 | -7 |
| src/app/[locale]/(workspace)/clients/client-related-matters-presentation.test.ts | App route | +66 | -0 |
| src/app/[locale]/(workspace)/clients/presentation.ts | App route | +65 | -0 |
| src/components/clients/client-detail-header.tsx | Component | +5 | -3 |
| src/components/clients/client-related-matters-fixtures.ts | Component | +63 | -0 |
| src/components/clients/client-related-matters-register.stories.tsx | Component | +60 | -0 |
| src/components/clients/client-related-matters-register.tsx | Component | +93 | -0 |
| src/components/clients/client-related-matters-row.tsx | Component | +77 | -0 |
| src/components/clients/client-related-matters-table.tsx | Component | +68 | -0 |
| src/components/clients/client-sheet.tsx | Component | +5 | -4 |
| src/components/clients/empty-state.stories.tsx | Component | +57 | -3 |
| src/components/clients/empty-state.tsx | Component | +40 | -25 |
| src/components/clients/pages/client-detail-page.stories.tsx | Component | +35 | -2 |
| src/components/clients/pages/client-detail-page.tsx | Component | +7 | -4 |
| src/lib/surface-registry/route-registry.ts | Library | +1 | -1 |