forum picker + step-2 two-column row + modal +100px — closing #1289The 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.
| Piece | What & why |
|---|---|
| Picker component | add-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 create | Minting 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 layout | step2-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 tweak | The "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 id | forumId flows AddMatterCreatePayload → wizardCreateInputFromPayload → WizardMatterInput → createMatterFromWizardAction → MatterCreateRequest.forumId. Null when unset (optional everywhere). |
| Data wiring | live-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 height | add-matter-chrome.tsx: body height 605 → 705 (+100px) so the matter step (and parties/team) breathe without scrolling. |
| i18n | 8 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). |
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.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
/app/forums hooks
(useAppListForums / useAppCreateForum), the
/api/internal/forums proxy, and the forum-select is a structural
clone of the proven matter-type-select.16 file(s), +511 / -32 lines
| Path | Role | + | - |
|---|---|---|---|
| messages/en.json | Config | +8 | -2 |
| messages/hi.json | Config | +8 | -2 |
| src/app/[locale]/(workspace)/matters/actions.ts | App route | +2 | -0 |
| src/components/add-matter/__mocks__/forums.ts | Component | +18 | -0 |
| src/components/add-matter/add-matter-chrome.tsx | Component | +1 | -1 |
| src/components/add-matter/add-matter-types.ts | Component | +11 | -0 |
| src/components/add-matter/add-matter-wizard.stories.tsx | Component | +5 | -0 |
| src/components/add-matter/add-matter-wizard.tsx | Component | +25 | -2 |
| src/components/add-matter/forum-select.stories.tsx | Component | +68 | -0 |
| src/components/add-matter/forum-select.tsx | Component | +246 | -0 |
| src/components/add-matter/step2-matter-body.tsx | Component | +53 | -25 |
| src/components/matters/live-matters-list-page.tsx | Component | +42 | -0 |
| src/components/matters/live-matters-wizard-payload.ts | Component | +3 | -0 |
| tests/unit/add-matter-wizard-label-gate.test.tsx | Test | +1 | -0 |
| tests/unit/live-matters-wizard-payload.test.ts | Test | +5 | -0 |
| tests/unit/wizard-matter-actions.test.ts | Test | +15 | -0 |