Skip to content

refactor(features): regroup TicketWorkspaceRail props into 8 bundles#64

Merged
saagpatel merged 1 commit into
masterfrom
codex/refactor/ticket-workspace-rail-context
Apr 22, 2026
Merged

refactor(features): regroup TicketWorkspaceRail props into 8 bundles#64
saagpatel merged 1 commit into
masterfrom
codex/refactor/ticket-workspace-rail-context

Conversation

@saagpatel
Copy link
Copy Markdown
Owner

What

Closes the deferred Wave 5.5 architectural goal by collapsing `TicketWorkspaceRail`'s 38-prop flat interface into 8 named bundles + 2 primitives. Each bundle maps to one cohesive feature area of the rail:

Bundle Covers
`intake` case intake data + 4 callbacks + missingQuestions
`nextActions` items + onAccept
`similarCases` items + loading + 4 callbacks + compareCase + onCloseCompare
`packs` handoff/evidence/kb-draft packs + 3 copy callbacks
`kits` items + onSaveCurrent + onApply
`favorites` items + onToggle
`runbooks` templates + session + note + 4 callbacks
`personalization` value + onChange

Plus two flat primitives that don't cluster: `workspaceCatalogLoading` and `currentResponse`.

Why

Wave 5.5 deliberately narrow-scoped its decomposition. The plan called out the 26→~8 prop refactor as "a separate, larger PR outside Wave 5" — flagged in the post-Wave-5 verification audit, now addressed. Bundling delivers:

  • Call-site grouping: each bundle is assembled once from a related set of shell state+handlers, making the DraftTab shell's workspacePanel builder read as 8 cohesive groups instead of a 38-line flat prop list.
  • Future decomposition path: a follow-up can move each bundle into its own typed hook without changing the rail's prop surface again.
  • Exported bundle interfaces (`TicketWorkspaceRailIntakeBundle`, etc.) can be consumed by future rail sub-components.

How

  1. Define 8 exported bundle interfaces in `TicketWorkspaceRail.tsx`.
  2. Rewrite the rail's internal destructuring + JSX to reference bundled values (`intake.data`, `similarCases.items`, `packs.handoffPack`, etc.).
  3. Update `DraftTab.tsx`'s `workspacePanel` builder to construct the 8 bundles inline.
  4. Update `TicketWorkspaceRail.test.tsx` fixture to build the bundled shape; adjust 3 assertion paths to the new names (`props.similarCases.onCompareLast`, `props.kits.onApply`, `props.runbooks.onCopyProgress`, `props.personalization.onChange`).

Testing

  • `pnpm tsc --noEmit` — clean.
  • `pnpm test` — 241 pass, unchanged count. Same three tests on the rail, same behavior coverage, just new prop shape.
  • `pnpm ui:gate:static` — exit 0.

Risk / Notes

  • No runtime behavior change. Same callbacks fire at the same moments with the same arguments.
  • Only consumer is `DraftTab.tsx`; the shell is updated in the same PR so no external drift.
  • The rail's public behavior (rendered DOM, click handlers, aria attributes) is byte-identical.

Collapse the 38-prop flat interface (deferred from Wave 5.5) into 8
named bundles plus 2 primitives. Each bundle maps to one feature
area: intake, nextActions, similarCases, packs, kits, favorites,
runbooks, personalization. DraftTab shell, rail internals, and the
test suite all updated in lockstep; consumer behavior is unchanged.
@saagpatel saagpatel merged commit 04473dc into master Apr 22, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants