[Story-1099] Participant Labels settings page

Story 1099Epic None30 files · +1877/−0

PR #270 · pramaan-io/pramaan-app · merged 2026-06-09

Why this matters

When a single delete breaks twelve matters

Picture a firm with two hundred active cases and no central place for label hygiene.

The obvious fix is the one that breaks production.

The fix — A label can only be deleted when nothing depends on it — the page enforces that end to end.

How it flows

sequenceDiagram
  autonumber
  participant ui as Settings UI
  participant hook as Generated Hook
  participant gate as Gateway + Zod
  participant be as Backend
  ui->>hook: open settings, list labels
  hook->>gate: fetch via /participant-labels
  gate->>be: validate + canDelete check
  gate->>gate: canDelete=false → swap to archive
  be-->>ui: archive → optimistic list flip

Files changed (30)

File±
docs/walkthroughs/story-1099-walkthrough.html+149
messages/en.json+44
messages/hi.json+44
src/app/[locale]/(workspace)/settings/matter-configuration/participant-labels/page.tsx+39
src/app/api/internal/participant-labels/[participantLabelId]/archive/route.ts+13
src/app/api/internal/participant-labels/[participantLabelId]/route.ts+91
src/app/api/internal/participant-labels/[participantLabelId]/unarchive/route.ts+13
src/app/api/internal/participant-labels/route.ts+68
src/components/settings/participant-labels/participant-label-delete-dialog.tsx+50
src/components/settings/participant-labels/participant-label-row-actions.tsx+75
src/components/settings/participant-labels/participant-label-sheet-fields.tsx+76
src/components/settings/participant-labels/participant-label-sheet.stories.tsx+58
src/components/settings/participant-labels/participant-label-sheet.tsx+90
src/components/settings/participant-labels/participant-label-table-row.tsx+76
src/components/settings/participant-labels/participant-labels-fixtures.ts+62
src/components/settings/participant-labels/participant-labels-list-page.stories.tsx+55
src/components/settings/participant-labels/participant-labels-list-page.tsx ★+127
src/components/settings/participant-labels/participant-labels-presentation.ts+34
src/components/settings/participant-labels/participant-labels-table-layout.ts+6
src/components/settings/participant-labels/participant-labels-table.stories.tsx+113
src/components/settings/participant-labels/participant-labels-table.tsx+67
src/components/settings/participant-labels/participant-labels-toolbar.tsx+55
src/components/settings/participant-labels/participant-labels-types.ts+19
src/components/settings/participant-labels/use-participant-label-actions.ts ★+138
src/components/settings/participant-labels/use-participant-label-sheet.tsx+127
src/components/settings/settings-sidebar.tsx+6
src/lib/kubb-client.ts+9
src/lib/participant-labels/gateway.ts ★+145
src/lib/participant-labels/presentation.ts+15
src/lib/participant-labels/types.ts+13