A new Matter Types settings catalog, built by cloning the proven
proceeding-types catalog pattern file-for-file. It is deliberately
mock-backed: the page and stories run entirely off fixtures, so this slice
ships and merges independent of the functions backend chain
(#1277 → #1278 → #1279). No codegen, no @/gen import, no gateway,
no /api/internal/matter-types route. Story-1281 stays the wiring
ticket — it swaps the local type for the generated MatterTypeView and
a real /app/matter-types gateway once #1278 lands.
The whole point is one boundary: a LOCAL MatterType interface in
src/lib/matter-types/types.ts, mirroring the decided
matter_types shape (id,
name, availability,
canDelete, isInUse,
matterTypeNumberFormatted = "TY-001", …). It carries
the exact wire-up TODO and a justified no-restricted-syntax disable —
the rule normally forces DTOs from src/gen/; this is the temporary
local seam, not a contract mirror. Fixtures feed both the page and the stories.
| Piece | What & why |
|---|---|
| List page | matter-type-catalog-list-page.tsx — Live/Archived tabs, name/description search, + Add matter type, pagination. Owns rows in local useState (seeded from fixtures) since there is no list query yet; story-only initialMatterTypes/Query/Filter props drive the empty / no-match / archived states. |
| Table + row | -table.tsx / -table-row.tsx — shared grid chrome, StatusBadge (live/archived), TY- reference, Updated→Archived column swap, empty-state. |
| Sheet | -sheet.tsx / -sheet-fields.tsx — create/edit drawer on react-hook-form + zod, against local form state. No network. |
| Dialog + actions | -delete-dialog.tsx, -row-actions.tsx — edit / archive / restore / delete-when-unused (delete disabled + steered to archive when canDelete: false). |
| Hooks (mock) | use-matter-type-catalog-actions.ts + use-matter-type-catalog-sheet.tsx — mutate the page's local fixture state synchronously and confirm with a toast. These are the only files that diverge from the gold pattern: the @/gen TanStack mutations are replaced by setState. |
| Presentation | -presentation.ts (counts + tab/search filter) + src/lib/matter-types/presentation.ts (date format). |
| Fixtures | -fixtures.ts — the canonical seed list (Civil Suit … Other) + one archived row; isInUse/canDelete varied so the row menu shows every state. |
| Stories | list-page (live / read-only / archived / empty / search-no-match), table (7 states), sheet (add / edit / saving / error). The review deliverable. |
| Route stub | settings/matter-configuration/matter-types/page.tsx — renders the list-page off fixtures, real settings:write gate, clearly marked MOCK. No loader. |
| i18n | New MatterTypes namespace, 41 keys, full en + hi parity. No hardcoded strings. |
pnpm typecheck clean pnpm lint clean (new files) vitest matter-type-catalog-presentation.test.ts — 8 passed storybook build completed successfully i18n parity en/hi MatterTypes — 41 keys each scans no hardcoded copy; no color literals
matter-type-catalog-* to avoid the matter-template/preset squat in the shared matter-types/ dir. No codegen, no @/gen, no gateway — the PR stays green against the contract drift-guard./app/matter-types wiring (generated MatterTypeView + gateway + proxy + optimistic TanStack writes), the Matter Preset relabel, the Add-Matter wizard picker + inline-create, settings-nav subtitles. The full package de-squat of matter-types/ is #1277.84 file(s), +7716 / -1423 lines
| Path | Role | + | - |
|---|---|---|---|
| messages/en.json | Config | +76 | -31 |
| messages/hi.json | Config | +76 | -31 |
| openapi/app-api.json | Config | +2243 | -1232 |
| src/app/[locale]/(workspace)/matters/page.tsx | App route | +8 | -4 |
| src/app/[locale]/(workspace)/settings/matter-configuration/matter-types/page.tsx | App route | +25 | -0 |
| src/components/add-matter/add-matter-shell.tsx | Component | +6 | -6 |
| src/components/add-matter/add-matter-types.ts | Component | +8 | -0 |
| src/components/add-matter/add-matter-wizard.tsx | Component | +1 | -1 |
| src/components/add-matter/count-line.tsx | Component | +3 | -3 |
| src/components/add-matter/step1-template-body.tsx | Component | +20 | -9 |
| src/components/add-matter/step2-matter-body.tsx | Component | +90 | -72 |
| src/components/add-matter/template-row.tsx | Component | +27 | -17 |
| src/components/settings/matter-types/matter-type-catalog-delete-dialog.tsx | Component | +50 | -0 |
| src/components/settings/matter-types/matter-type-catalog-fixtures.ts | Component | +145 | -0 |
| src/components/settings/matter-types/matter-type-catalog-list-page.stories.tsx | Component | +55 | -0 |
| src/components/settings/matter-types/matter-type-catalog-list-page.tsx | Component | +132 | -0 |
| src/components/settings/matter-types/matter-type-catalog-presentation.test.ts | Component | +86 | -0 |
| src/components/settings/matter-types/matter-type-catalog-presentation.ts | Component | +34 | -0 |
| src/components/settings/matter-types/matter-type-catalog-row-actions.tsx | Component | +75 | -0 |
| src/components/settings/matter-types/matter-type-catalog-sheet-fields.tsx | Component | +76 | -0 |
| src/components/settings/matter-types/matter-type-catalog-sheet.stories.tsx | Component | +58 | -0 |
| src/components/settings/matter-types/matter-type-catalog-sheet.tsx | Component | +103 | -0 |
| src/components/settings/matter-types/matter-type-catalog-table-layout.ts | Component | +6 | -0 |
| src/components/settings/matter-types/matter-type-catalog-table-row.tsx | Component | +86 | -0 |
| src/components/settings/matter-types/matter-type-catalog-table.stories.tsx | Component | +99 | -0 |
| src/components/settings/matter-types/matter-type-catalog-table.tsx | Component | +67 | -0 |
| src/components/settings/matter-types/matter-type-catalog-toolbar.tsx | Component | +55 | -0 |
| src/components/settings/matter-types/matter-type-catalog-types.ts | Component | +21 | -0 |
| src/components/settings/matter-types/proceedings-story-content.tsx | Component | +1 | -1 |
| src/components/settings/matter-types/use-matter-type-catalog-actions.ts | Component | +55 | -0 |
| src/components/settings/matter-types/use-matter-type-catalog-sheet.tsx | Component | +133 | -0 |
| src/components/settings/settings-sidebar.tsx | Component | +17 | -3 |
| src/components/shared/user-rail-button.tsx | Component | +28 | -6 |
| src/gen/client/appArchiveMatterType.ts | Generated contract | +65 | -0 |
| src/gen/client/appCreateMatterType.ts | Generated contract | +68 | -0 |
| src/gen/client/appDeleteMatterType.ts | Generated contract | +65 | -0 |
| src/gen/client/appListMatterTypes.ts | Generated contract | +57 | -0 |
| src/gen/client/appUnarchiveMatterType.ts | Generated contract | +65 | -0 |
| src/gen/client/appUpdateMatterType.ts | Generated contract | +75 | -0 |
| src/gen/client/index.ts | Generated contract | +6 | -0 |
| src/gen/hooks/index.ts | Generated contract | +28 | -0 |
| src/gen/hooks/useAppArchiveMatterType.ts | Generated contract | +152 | -0 |
| src/gen/hooks/useAppCreateMatterType.ts | Generated contract | +156 | -0 |
| src/gen/hooks/useAppDeleteMatterType.ts | Generated contract | +152 | -0 |
| src/gen/hooks/useAppListMatterTypes.ts | Generated contract | +119 | -0 |
| src/gen/hooks/useAppListMatterTypesSuspense.ts | Generated contract | +117 | -0 |
| src/gen/hooks/useAppUnarchiveMatterType.ts | Generated contract | +152 | -0 |
| src/gen/hooks/useAppUpdateMatterType.ts | Generated contract | +162 | -0 |
| src/gen/index.ts | Generated contract | +197 | -0 |
| src/gen/schemas/matterTypeAvailability.json | Generated contract | +7 | -0 |
| src/gen/schemas/matterTypeCreateRequest.json | Generated contract | +21 | -0 |
| src/gen/schemas/matterTypeListItem.json | Generated contract | +107 | -0 |
| src/gen/schemas/matterTypeListResponse.json | Generated contract | +126 | -0 |
| src/gen/schemas/matterTypeUpdateRequest.json | Generated contract | +34 | -0 |
| src/gen/schemas/matterTypeView.json | Generated contract | +108 | -0 |
| src/gen/types/AppArchiveMatterType.ts | Generated contract | +76 | -0 |
| src/gen/types/AppCreateMatterType.ts | Generated contract | +75 | -0 |
| src/gen/types/AppDeleteMatterType.ts | Generated contract | +74 | -0 |
| src/gen/types/AppListMatterTypes.ts | Generated contract | +64 | -0 |
| src/gen/types/AppUnarchiveMatterType.ts | Generated contract | +76 | -0 |
| src/gen/types/AppUpdateMatterType.ts | Generated contract | +83 | -0 |
| src/gen/types/MatterTypeAvailability.ts | Generated contract | +13 | -0 |
| src/gen/types/MatterTypeCreateRequest.ts | Generated contract | +22 | -0 |
| src/gen/types/MatterTypeListItem.ts | Generated contract | +87 | -0 |
| src/gen/types/MatterTypeListResponse.ts | Generated contract | +18 | -0 |
| src/gen/types/MatterTypeUpdateRequest.ts | Generated contract | +25 | -0 |
| src/gen/types/MatterTypeView.ts | Generated contract | +88 | -0 |
| src/gen/types/index.ts | Generated contract | +86 | -0 |
| src/gen/zod/appArchiveMatterTypeSchema.ts | Generated contract | +98 | -0 |
| src/gen/zod/appCreateMatterTypeSchema.ts | Generated contract | +99 | -0 |
| src/gen/zod/appDeleteMatterTypeSchema.ts | Generated contract | +94 | -0 |
| src/gen/zod/appListMatterTypesSchema.ts | Generated contract | +81 | -0 |
| src/gen/zod/appUnarchiveMatterTypeSchema.ts | Generated contract | +98 | -0 |
| src/gen/zod/appUpdateMatterTypeSchema.ts | Generated contract | +104 | -0 |
| src/gen/zod/index.ts | Generated contract | +77 | -0 |
| src/gen/zod/matterTypeAvailabilitySchema.ts | Generated contract | +17 | -0 |
| src/gen/zod/matterTypeCreateRequestSchema.ts | Generated contract | +17 | -0 |
| src/gen/zod/matterTypeListItemSchema.ts | Generated contract | +66 | -0 |
| src/gen/zod/matterTypeListResponseSchema.ts | Generated contract | +17 | -0 |
| src/gen/zod/matterTypeUpdateRequestSchema.ts | Generated contract | +30 | -0 |
| src/gen/zod/matterTypeViewSchema.ts | Generated contract | +73 | -0 |
| src/lib/matter-types/presentation.ts | Library | +15 | -0 |
| src/lib/matter-types/types.ts | Library | +32 | -0 |
| tests/unit/live-matter-fields.test.tsx | Test | +7 | -7 |