Bug-1197: hide archived catalog entries in matter template pickers

Story 1197Epic None5 files · +89/−6

PR #302 · pramaan-io/pramaan-app · merged 2026-06-11

Why this matters

A lawyer picks a proceeding type that was retired last year. The template saves it. Now the matter references something that no longer exists.

Why hiding archived catalog entries matters

Existing selections vanish without warning

The fix — Hide archived from new picks, keep them visible on templates that already use them.

How it flows

sequenceDiagram
  autonumber
  participant catalog as Catalog
  participant picker as Picker
  participant template as Template
  catalog->>picker: send each item with availability flag
  picker->>picker: filter out archived items from the browsable list
  picker->>picker: but if item is in template's current selection, keep it visible
  picker->>template: final chip list — active picks, plus already-selected archived ones

Files changed (5)

File±
src/components/settings/matter-types/catalog-chip-multi-select.stories.tsx ★+6
src/components/settings/matter-types/catalog-chip-multi-select.test.tsx ★+70
src/components/settings/matter-types/catalog-chip-multi-select.tsx ★+6 −2
src/components/settings/matter-types/matter-templates-fixtures.ts+4 −4
src/components/settings/matter-types/use-matter-template-catalogs.ts+3