refactor(features): extract IntakeFieldControl + performance helpers from Rail#52
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Narrow-scope decomposition of
src/features/workspace/TicketWorkspaceRail.tsx(884 → 783 LOC). Extract two siblings:
IntakeFieldControlsub-component (plus
NOTE_AUDIENCES,INTAKE_FIELDS, and theIntakeFieldkey-type) andworkspacePerformanceMetricshelpers.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:
workspacePerformanceMetrics.ts— lift the perf markconstants,
PerfWindowtyping, and theticket-workspace-ready measurement into a single
markWorkspaceReady()side-effect function. Shell useEffectreduces to a one-liner that calls it.
IntakeFieldControl.tsx— form-field wrapper + the twomodule-scope constants + the
IntakeFieldkey-type.IntakeFieldControl.test.tsx— 3 tests (single-line render,multi-line textarea render + onChange, single-line onChange).
Testing
pnpm ui:gate:static— cleanpnpm test— 168/168 (+3 from this PR)TicketWorkspaceRail.test.tsx(3 tests) still passes —it uses
renderRail()with prop overrides, not the internalsub-component
Performance impact
byte-identical behavior)
Risk / Notes
DraftTab.tsx+ the omnibus test) — publicsurface unchanged
markWorkspaceReady()remains idempotent-safe whenwindow.performanceis missingScreenshots
N/A — internals only.
Lockfile rationale
No lockfile changes.