Files
pipelines/app/notes/chat-split-workspace.md
T

2.2 KiB

Split chat workspace primitives

chat_workspace.dart exposes ChatWorkspace, ChatWorkspaceController, pane/split node types and ChatSplitAxis. The visit-local controller opens/replaces the active pane, focuses an already-open chat, splits the active pane to its right or below, replaces a session identity after /new, activates panes and closes/collapses splits. Pane IDs survive tree edits.

The renderer computes tree geometry but keeps every chat view as a stable keyed sibling in one Stack. Nested splits, divider drags and closing adjacent panes never reparent the existing chat view. When the viewport cannot fit the tree's minimum sizes, only the active chat paints, with all other leaves retained offstage and excluded from focus. The root screen supplies its pane switcher and per-pane bars.

Each divider has a 12px grab area, a native theme separator, horizontal/vertical resize cursors, pointer dragging, arrow-key adjustments, accessibility increase/decrease values and double-click reset. Geometry clamps visible panes to 240px wide and 200px high while preserving the saved ratio across viewport changes.

Ctrl+Shift+Arrow navigates spatially between panes. Command+Shift+Arrow also works on macOS. Chords are consumed at edges so they do not alter composer selection. The handler is gated by workspace focus and shortcutsEnabled; pointer activation does not request composer focus. The owner supplies onFocusPane for keyboard-only composer focus after layout. No sockets, requests or timers are introduced by these primitives.

Checks: bounded analysis clean; eight watchdog tests passed, peak663MB,3s (/tmp/memwatch/out.7uae7k). Tests assert actual horizontal/vertical dragging and clamping, nested close collapse, leaf State/draft identity, narrow fallback/restoration, keyboard divider resizing/reset, spatial geometry, Ctrl navigation and macOS Command navigation without changing drafts. Commands from app/: tool/analyze.sh lib/features/chat/workspace test/features/chat/workspace and tool/memwatch/full.sh 'test/features/chat/workspace --no-pub'. Full-app integration and rendered captures are the manager's next check; no production services or chats were touched.