18 file(s), +1844 / -326 lines
| Path | Role | + | - |
|---|---|---|---|
| messages/en.json | Config | +14 | -6 |
| messages/hi.json | Config | +14 | -6 |
| src/components/add-matter/add-matter-drawer-types.ts | Component | +10 | -3 |
| src/components/add-matter/add-matter-drawer.stories.tsx | Component | +9 | -1 |
| src/components/add-matter/add-matter-drawer.tsx | Component | +1 | -3 |
| src/components/add-matter/drawer-client-field.stories.tsx | Component | +86 | -0 |
| src/components/add-matter/drawer-client-field.tsx | Component | +31 | -91 |
| src/components/add-matter/drawer-client-popover.stories.tsx | Component | +80 | -0 |
| src/components/add-matter/drawer-client-popover.tsx | Component | +64 | -34 |
| src/components/add-matter/drawer-combobox.stories.tsx | Component | +91 | -0 |
| src/components/add-matter/drawer-combobox.tsx | Component | +192 | -0 |
| src/components/add-matter/participant-label-picker.stories.tsx | Component | +176 | -0 |
| src/components/add-matter/participant-label-picker.tsx | Component | +423 | -0 |
| src/components/add-matter/representing-side-field.stories.tsx | Component | +135 | -19 |
| src/components/add-matter/representing-side-field.tsx | Component | +122 | -121 |
| src/components/add-matter/use-participant-label-picker-data.ts | Component | +113 | -0 |
| tests/unit/representing-side-field.test.tsx | Test | +283 | -41 |
| tests/unit/use-add-matter-drawer-form.test.tsx | Test | +0 | -1 |
The Add Matter drawer's second “Who we represent” question is now a permanent search-select. It uses the same trigger, search field, popover, loading rows, and dismissal behavior as the Client field, while retaining participant-label-specific grouping, selection, and inline creation.
This story reads the existing label catalogue and matter-type attachment set. It does not write a new matter-type-to-label attachment; that mapping write remains the scope of pramaan-spec Story-2919.
| State | What the user sees |
|---|---|
| Curated matter type | Attached labels appear first under Offered for <matter type> in configured order. The rest of the live firm catalogue follows under Other participant labels, with attached labels removed from that group. |
| Uncurated matter type | When the attachment set is empty, the firm catalogue appears as one flat list without group headings. |
| Staged matter type | A matter type created inline during this drawer session immediately gets the flat catalogue picker. It no longer falls back to “choose a matter type first”. |
| Picked | The chosen label replaces the trigger placeholder. Clicking the trigger reopens search, preserves the choice, and marks it with a check. |
| Empty / loading / error | Each data state is explicit: loading skeletons, empty-firm guidance with the add row, or a load error with Retry. A required-field message is still shown when Create is blocked, including when there are no available options. |
| Inline mint | + Add participant label opens the mint-colored inline form at the foot of the picker. A newly created label is selected through the existing party path. |
drawer-combobox.tsx is the shared combobox shell now
composed by both the Client field and the participant-label picker.
participant-label-picker.tsx owns client-side filtering,
curated versus flat presentation, picked-state rendering, and inline
label creation.
use-participant-label-picker-data.ts composes only the
existing generated list and create hooks. The attached set is read for
persisted matter types; staged types deliberately use an empty
attachment set and the live catalogue.
Storybook includes the shared combobox, the refactored Client field and popover, and participant-label picker stories for curated, uncurated, empty-firm, loading, error, picked, and inline-mint states. The complete “Who we represent” field also covers a staged matter type and the blocked-Create validation state.
pnpm lint && pnpm typecheck && pnpm test &&
pnpm build. Lint, typecheck, and the production build are green. The full suite
is green with a bounded local worker pool (255 files / 1,587 tests), and
the Storybook production build verifies every documented component state
compiles in isolation.