Skip to content

refactor(features): extract IntakeFieldControl + performance helpers from Rail#52

Merged
saagpatel merged 3 commits into
masterfrom
codex/refactor/wave5-5-ticket-workspace-rail
Apr 21, 2026
Merged

refactor(features): extract IntakeFieldControl + performance helpers from Rail#52
saagpatel merged 3 commits into
masterfrom
codex/refactor/wave5-5-ticket-workspace-rail

Conversation

@saagpatel
Copy link
Copy Markdown
Owner

What

Narrow-scope decomposition of src/features/workspace/TicketWorkspaceRail.tsx
(884 → 783 LOC). Extract two siblings: IntakeFieldControl
sub-component (plus NOTE_AUDIENCES, INTAKE_FIELDS, and the
IntakeField key-type) and workspacePerformanceMetrics helpers.
Deliberately does NOT redesign the 26-prop interface — that is
explicitly deferred. Wave 5.5 of docs/plans/ancient-kindling-wilkes.

Why

Wave 5 of the audit remediation. Phase-1 research found the
file's real challenge is prop-API design, not size. The context
refactor deserves its own PR with a design doc; this PR only
extracts the pieces that are cleanly separable without API
changes.

How

3 commits:

  1. workspacePerformanceMetrics.ts — lift the perf mark
    constants, PerfWindow typing, and the
    ticket-workspace-ready measurement into a single
    markWorkspaceReady() side-effect function. Shell useEffect
    reduces to a one-liner that calls it.
  2. IntakeFieldControl.tsx — form-field wrapper + the two
    module-scope constants + the IntakeField key-type.
  3. IntakeFieldControl.test.tsx — 3 tests (single-line render,
    multi-line textarea render + onChange, single-line onChange).

Testing

  • pnpm ui:gate:static — clean
  • pnpm test — 168/168 (+3 from this PR)
  • Existing TicketWorkspaceRail.test.tsx (3 tests) still passes —
    it uses renderRail() with prop overrides, not the internal
    sub-component

Performance impact

  • Bundle delta: negligible
  • Build/Lighthouse: none (the extracted mark function is
    byte-identical behavior)

Risk / Notes

  • 2 consumers (DraftTab.tsx + the omnibus test) — public
    surface unchanged
  • Full 26-prop → context refactor is explicitly deferred
  • markWorkspaceReady() remains idempotent-safe when
    window.performance is missing

Screenshots

N/A — internals only.

Lockfile rationale

No lockfile changes.

saagar210 and others added 3 commits April 21, 2026 15:48
Lift the three perf marks, the PerfWindow typing, and the
ticket-workspace-ready measurement out of
TicketWorkspaceRail.tsx into a sibling
workspacePerformanceMetrics.ts exposing a single
markWorkspaceReady() side-effect function. Shell useEffect is
now one line. Wave 5.5.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Lift the IntakeFieldControl form-field wrapper plus the
NOTE_AUDIENCES and INTAKE_FIELDS constants and the IntakeField
key-type out of TicketWorkspaceRail.tsx into a sibling
IntakeFieldControl.tsx. No external consumers; shell imports
them back. Wave 5.5 (narrow scope — prop-API redesign explicitly
deferred).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add three focused tests for the extracted form-field component:
single-line input render + value, multi-line textarea render +
onChange, and single-line onChange payload. Wave 5.5.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@saagpatel saagpatel merged commit 9137eca into master Apr 21, 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