Extract split-pane layout into center-pane-split.tsx - #800
Merged
Conversation
Move the ~80-line isSplit render block out of agents-view.tsx into a new presentational CenterPaneSplit component. Pure refactor: the JSX is unchanged and the terminal DOM node is still portaled into the shared split terminal slot; refs and layout effects stay in the parent. agents-view.tsx: 1006 -> 933 lines. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
selfcontained added a commit
that referenced
this pull request
Aug 3, 2026
* Split agents-view into header component + layout/expansion hooks agents-view.tsx regrew to 952 lines after the split-pane (#743/#800) and whiteboard (#752) features landed. Extract the three growth clusters: - use-center-pane-layout.ts: split-pane state, tab drag-and-drop plumbing, and the stable terminal container reparenting portal logic - agents-view-header.tsx: the h-14 header bar (sidebar toggle, quick phrases, diff-stats badge, center tab bar, media toggle, reconnect scan) - use-expanded-agent.ts: persisted expanded-card state and the selection-follow effect Pure structural refactor; rendered output and behavior are identical. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Preserve effect registration order for expanded-agent sync Review feedback: the persistence and selection-follow effects originally registered late in AgentsView's effect sequence. Split them into useExpandedAgentSync, called at the original effect position, so passive effect ordering is unchanged. useExpandedAgent keeps only the state and toggle at the original useState position. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <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 freeto 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
Extract the ~80-line
isSplitrender block out ofagents-view.tsxinto a new presentationalCenterPaneSplitcomponent (apps/web/src/components/app/center-pane-split.tsx).Why this is tech debt
agents-view.tsxis one of the largest, most-frequently-touched web components (1006 lines). The split-pane JSX is a self-contained, purely presentational chunk that was inlined in the middle of the render tree, making the component harder to read. This is the "self-contained sub-component extraction" the tech-debt backlog recommended for this file — chosen over a risky big split of the WebSocket/terminal lifecycle.Change
CenterPaneSplitreceivessplitState, the three refs (splitLeftRef,splitButtonRef,splitTerminalSlotRef),changesElement,isMobile,onLayoutChange, andonExitSplit.agents-view.tsx.Split(lucide) andResizable*imports fromagents-view.tsx.agents-view.tsx: 1006 → 933 lines.Validation
pnpm run check✅pnpm run finalize:web✅pnpm run test:e2e✅ (168 passed, 13 skipped — terminal-live suite requires live mode)No behavior change.
Next run
Backlog: continue trimming
agents-view.tsx(933 lines) with another self-contained extraction (e.g. the bottom dialog cluster or the center-pane header toolbar), or do a fresh dead-code/duplication scan ofapps/server/srcandapps/web/src.🤖 Generated with Claude Code