refactor(components): extract DraftResponsePanel + pin DraftTabHandle (Wave 5.7 Phase B+D)#56
Merged
Merged
Conversation
Phase B (narrow): extract the response + alternatives + saved- suggestion fragment into a dedicated DraftResponsePanel component. The existing TicketWorkspaceRail and DiagnosisPanel already serve as de facto intake and checklist panels, so no additional wrappers are added — extracting those would add indirection without reducing shell complexity. Phase D: add DraftTab.handle.test.tsx — a compile-time pin plus runtime key assertion that guards the DraftTabHandle interface against accidental drift. Eight consumers import this handle type, so a type-level regression check is the highest-value first test we can add for the shell.
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
Completes Wave 5.7 with a narrow Phase B + Phase D pass:
Phase B — DraftResponsePanel extraction. The response + alternatives + saved-suggestion JSX fragment (38 lines in the shell) becomes a dedicated
DraftResponsePanelcomponent. Shell reduces from 2138 → 2127 LOC on this PR.Phase D — DraftTabHandle shape pin. New
DraftTab.handle.test.tsxadds compile-time + runtime guards around theDraftTabHandleinterface. Eight external consumers import this handle — a type-level drift-detector is the highest-value first test the shell can have.Why (narrow scope for Phase B)
The Wave 5.7 plan sketched three panels:
DraftIntakePanel,DraftResponsePanel,DraftChecklistPanel. In the actual shell:TicketWorkspaceRail(a separate feature module). Wrapping it in a thin `DraftIntakePanel` would add indirection without reducing shell complexity.DiagnosisPanel. Same indirection cost.So this PR extracts the one that earns its keep and documents the decision.
Phase C note
With Phase A (5 hooks) + this PR landed, `DraftTab.tsx` is at 2127 LOC. Further reduction to the plan's 700-LOC target would need a separate sweep of the remaining ~30 handlers (draft save/load, handoff pack copy, similar-case openers, runbook advancers, template modal glue). None of them form a cohesive "one more hook" concern — they're each self-contained and already use extracted hooks/helpers. A 700-LOC shell would require significant JSX restructuring beyond the decomposition pattern used so far.
Testing
Risk / Notes
Wave 5.7 cumulative