refactor(web): decompose RunChat.tsx + RunChat.test.tsx below line caps #196
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab!196
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/194"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #194
Decomposes the repo's two worst churn×size files along the seams agreed in the issue. Behavior-preserving: no visual or behavioral change, tests moved verbatim between files with assertions untouched.
Component split (commit 1)
RunChat.tsx(2956 → 691 lines) keeps the route entry, data wiring, scroll controller, panel state and JSX composition; six named siblings land underroutes/runchat/:runchat/ChatHeader.tsxrunchat/Dialogs.tsxsubmitOnEnter— its only callers are dialog code, adjusted per the issue's reality clause)runchat/messageFeed.tscreateMessageFeedprimitive — extracted because the sibling moves alone left the route at ~1010 lines, over the caprunchat/Composer.tsxrunchat/Messages.tsxrunchat/Markdown.tsxrunchat/shared.tscapitalize(route + composer)Moves are verbatim; the only rewrites are the injected messageFeed seam (run id, events, run refetch, scroll callbacks). Proof: the then-untouched monolith test file passed 145/145 against the split source.
Test split (commit 2)
RunChat.test.tsx(4325 → 673 lines, route wiring) plusrunchat/suites: Dialogs.test 1346, Messages.test 814, Composer.test 608, ChatHeader.test 425, andharness.tsx480 (fixtures, API/SSE/matchMedia stubs, mount helper, hook installer; source-class per #193). Mutable server-statelets became fields on the harness's exportedhobject (ESM importers cannot reassign imported bindings) — a mechanical word-boundary rename, verified: test titles andexpect()counts identical to the monolith (145 / 601).providerNeutral.test.tsgains a!./**/harness.tsxglob exclusion: the harness carries the provider fixtures the monolith always had, but isn't.test.ts*-suffixed (naming it so would make vitest collect it as an empty suite).Gates
npm run build(tsc + vite),eslint .,prettier --check,vitest run→ 50 files / 871 passed, all green. Every resulting file is under its #193 cap (source ≤ 691/1000, tests ≤ 1346/2000).#193 sequencing
#193 (ratchet gate) has not landed — there is no
baseline.jsonon main yet, so this PR has no entries to drop. Whichever lands second reconciles trivially: if #193 lands after this, its seeded baseline simply won't include the two RunChat files (they're under cap now); if this PR rebases over a landed #193, delete the two entries / run the baseline regeneration command in the merge.🤖 Generated with Claude Code
[autoland] verdict: pass