PR: #331: [Story-1289] Add-Matter forum picker + step-2 matter-type|forum row + modal +100px by @ankitmaheshwari-com
View PR →
Story-1289 · Add-Matter · Forums · sibling of Story-1281

Add-Matter forum picker + step-2 two-column row + modal +100px — closing #1289

The Add-Matter wizard could pick a matter type but not a forum (the court/tribunal). Forum grounds the auto-created Main proceeding — the backend already accepts it via MatterCreateRequest.forumId ("Optional forum selected in the wizard … applied to the auto-created Main proceeding"). This slice is the consumer side: the picker, the step-2 layout, the create-payload plumbing, and a roomier modal.

What ships

PieceWhat & why
Picker componentadd-matter/forum-select.tsx (new) — a live combobox of firm forums rendered mono-caps, a faithful clone of matter-type-select.tsx: type to filter, "+ Add new forum…" at the foot swaps the popover body to an inline create form. Copy-injected (i18n-agnostic), with a co-located story + __mocks__/forums.ts fixture. Optional field — onChange accepts null.
Inline createMinting a forum calls useAppCreateForum (POST /app/forums) wired in live-matters-list-page.tsx via createWizardForum — dedupes by name, then invalidates appListForumsQueryKey(). The minted forum is firm-wide and immediately selected.
Step-2 layoutstep2-matter-body.tsx: Matter type moved off the top. MATTER TYPE | FORUM now render as two columns in one row (grid grid-cols-2 gap-3, same idiom as Case number / Opened on), positioned after Value-at-stake (+ its "Not monetary" checkbox) and before the Case number / Opened on row.
Founder tweakThe "Set by the selected preset." caption under Matter type is gone — element dropped, and both now-unused i18n keys (matterTypePresetHint, matterTypeScratchHint) removed from en + hi. Matter type still auto-fills from the preset server-side — just no caption.
Send the idforumId flows AddMatterCreatePayload → wizardCreateInputFromPayload → WizardMatterInput → createMatterFromWizardAction → MatterCreateRequest.forumId. Null when unset (optional everywhere).
Data wiringlive-matters-list-page.tsx reads live forums with useAppListForums() and passes options + the create handler down through AddMatterModal → wizard → step 2. Mirrors the matter-type wiring exactly.
Modal heightadd-matter-chrome.tsx: body height 605 → 705 (+100px) so the matter step (and parties/team) breathe without scrolling.
i18n8 new keys under the AddMatter namespace (field label, placeholder, add-new, new-placeholder, create/creating/cancel, error), full en + hi parity; net per-locale count unchanged (8 added, 2 removed).

Descoped — forum into Atlas grounding (deliberate)

Ticket item 4 also asked to send forumId into Atlas's input via buildWizardInput, "mirroring how matter_type was wired in slice 2." That premise is false: matter_type was never wired into buildWizardInput (zero references in src/lib/agents/); slice 2 only sent the type into the create payload. buildWizardInput feeds a strict cross-repo pydantic model (AtlasIntakeInput, the "frozen BAML soul") that cannot be verified from this repo — the atlas-rail test documents that a wrong wire shape "produced 6 validation errors and a run.failed." Injecting an unverified forum field could break every Step-5 run and all matter creation. Per founder direction, the Atlas grounding (forum + matter_type) is split into a separate coordinated functions+brain+app ticket. No file under src/lib/agents/ is touched here.

Verification

pnpm tsc         clean
pnpm lint        clean (0 errors; only pre-existing warnings, none in changed files)
pnpm build       green
vitest           full suite 512 passed (89 files) — incl. new forum assertions in
                 wizard-matter-actions + live-matters-wizard-payload, and label-gate render
i18n parity      en/hi AddMatter — 109 keys each, mismatch: [] (8 forum keys added, 2 hints removed)
contract         no openapi/ or src/gen changes — forums contract already generated; freshness guard untouched
No gateway/hook/proxy recreation: reuses the existing /app/forums hooks (useAppListForums / useAppCreateForum), the /api/internal/forums proxy, and the forum-select is a structural clone of the proven matter-type-select.

Files changed

16 file(s), +511 / -32 lines

Path Role + -
messages/en.jsonConfig+8-2
messages/hi.jsonConfig+8-2
src/app/[locale]/(workspace)/matters/actions.tsApp route+2-0
src/components/add-matter/__mocks__/forums.tsComponent+18-0
src/components/add-matter/add-matter-chrome.tsxComponent+1-1
src/components/add-matter/add-matter-types.tsComponent+11-0
src/components/add-matter/add-matter-wizard.stories.tsxComponent+5-0
src/components/add-matter/add-matter-wizard.tsxComponent+25-2
src/components/add-matter/forum-select.stories.tsxComponent+68-0
src/components/add-matter/forum-select.tsxComponent+246-0
src/components/add-matter/step2-matter-body.tsxComponent+53-25
src/components/matters/live-matters-list-page.tsxComponent+42-0
src/components/matters/live-matters-wizard-payload.tsComponent+3-0
tests/unit/add-matter-wizard-label-gate.test.tsxTest+1-0
tests/unit/live-matters-wizard-payload.test.tsTest+5-0
tests/unit/wizard-matter-actions.test.tsTest+15-0