PR: #708: feat(matters): require add-matter lead picker [Story-2674] by @ayush-pramaan
View PR →
Story-2674 - Matter Team A4

Add Matter now requires a lead counsel pick

The Add Matter drawer keeps lead counsel as a create-time decision for both creator roles. The no-lead state is not a create input; it can only happen later through matter-team vacancy handling.

What changed

Add matter
Lead counsel
Search eligible editors
Pick an editor as lead counsel
Selected state
Asha Rao - Partner Lead

Behavior

Requirement Implemented proof
Lead counsel is mandatory on create. useAddMatterDrawerForm sets the lead error and refuses onCreate until a lead exists.
Both editor and firm administrator creators see the field. The field is unconditional inside AddMatterDrawer; creation reach is still controlled by the existing admin/editor canCreateMatter gate.
Lead options are active firm editors only. toMatterLeadCandidates() filters the firm directory to status = active and role = firm_editor before mapping picker rows.
Create payload carries the picked lead. drawerMatterCreateRequest() returns the generated MatterCreateRequest with required leadUserId.

Storybook proof

BDD proof

Verification

Files changed

23 file(s), +749 / -155 lines

Path Role + -
messages/en.jsonConfig+6-3
messages/hi.jsonConfig+6-3
src/components/add-matter/__mocks__/team-draft.tsComponent+8-0
src/components/add-matter/add-matter-drawer.stories.tsxComponent+52-10
src/components/add-matter/add-matter-drawer.tsxComponent+24-11
src/components/add-matter/avatar.tsxComponent+7-2
src/components/add-matter/drawer-client-field.tsxComponent+3-3
src/components/add-matter/drawer-field-bits.tsxComponent+1-1
src/components/add-matter/drawer-lead-field.stories.tsxComponent+27-5
src/components/add-matter/drawer-lead-field.tsxComponent+36-20
src/components/add-matter/drawer-title-field.tsxComponent+2-2
src/components/add-matter/drawer-type-field.tsxComponent+4-4
src/components/add-matter/member-combobox-lead-picker.tsxComponent+180-0
src/components/add-matter/member-combobox-search-picker.tsxComponent+110-0
src/components/add-matter/member-combobox.tsxComponent+59-72
src/components/add-matter/representing-side-field.tsxComponent+4-4
src/components/add-matter/to-firm-member.tsComponent+18-0
src/components/matters/add-matter-launcher.tsxComponent+2-6
src/components/matters/live-matter-sheet.tsxComponent+2-5
tests/e2e/clerk-auth.tsTest+7-3
tests/features/add-matter-lead-picker.featureTest+24-0
tests/steps/add-matter-lead-picker.steps.tsTest+108-0
tests/unit/to-firm-member.test.tsTest+59-1