On center stage, pressing or focusing a live side pane's header controls (actions, More menu, model/mode/effort) no longer activates that pane. Strips, keyboard activation and the normal split are unchanged. Pipelines run 298 (reviewed and UI-reviewed); landed by hand because the land stage's file capture was incomplete.
4.6 KiB
Chat center stage
A toggle for the wide (browser/desktop) split chat workspace. While it is on, the active chat takes center stage and the other chats line up beside it; the stage follows whichever chat becomes active. Phones (the one-chat layout) are unchanged.
Using it
- Cmd+E on macOS/iOS, Ctrl+E elsewhere, or the pane's More menu: Center stage (Cmd+E) / Leave center stage (Cmd+E) (shown with two or more panes on a wide window).
- The choice is device-local (
pipelines.next.chatCenterStage.v1in shared preferences) and survives reloads. It is not part of the server-scoped workspace snapshot. - Any activation moves the stage: clicking or tapping a strip (which also focuses that chat's composer), Ctrl/Cmd+Shift+Left/Right, Ctrl+Tab, opening an already-open chat from the list, quick switch, or the Open chats picker. Opening a new chat from the list replaces the staged chat, as in the split layout.
- On a wide center-stage layout, action-bar controls in a live side chat remain usable without staging that chat. Transcript and composer presses retain the existing click-to-activate behavior; covered strips still stage their chat.
- Ctrl/Cmd+Alt+Shift+Left/Right (pane moves) moves the staged chat along the strip order. Up/down have no neighbours on stage.
- The floating chat (Ctrl/Cmd+Y) is not tiled, so it is never staged or stripped; a chat docked back into the tiling becomes active and takes the stage.
Checks
tool/memwatch/full.sh 'test/features/chat/workspace': 87 passed, 0 failed.tool/analyze.sh: clean.- Captures (
chats=3&rich=1&colors=1, 1440x900, three panes, headless Chrome, macOS platform, so Cmd+E): normal split, center stage on, stage moved to api refactor, and back to the same split sizes, plus filmed toggle-on, switch and toggle-off. Headless Chrome delivered only a few frames per transition.
Layout (chat_center_stage_layout.dart)
- Stage width =
kChatReadingWidth(760, the transcript's reading column) x 1.25 = 950, capped so every other pane keeps at least a 56 px strip. Stage and strips take the full height and are separated by the 12 px divider gap. - Panes keep their split-tree order left to right. The others share the
remaining width. A column narrower than
chatPaneMinimumWidth(240) is covered by a strip (ChatCenterStageStrip: the chat colour, a dot and the title running down the column, Material InkWell / CupertinoButton). Wider columns, on very wide screens, stay as live, usable chats. - If there is not room for a 240 px stage plus every strip, or there is only one pane, the split layout stays.
- The split tree, ratios and dividers are never touched, so leaving center stage restores the exact split sizes. Dividers are hidden on stage.
Motion (chat_center_stage_motion.dart)
- 350 ms,
Curves.easeInOutCubicEmphasized, for entering, leaving and the stage moving between chats. Divider drags and window resizes follow at once. Durations are scaled by the animation-speed setting through the global clock; reduced motion (MediaQuery) settles instantly. - Every chat view stays one retained sibling (no reparenting, no remount): the painted, clipped rectangle travels while each chat is laid out once at its destination size, so drafts, scroll positions and running turns are kept and transcripts do not relayout per frame. A covered strip lays its chat out at 240 px underneath and excludes it from focus traversal.
Keyboard and browser
ChatCenterStageKeys is a FocusManager early key handler (like the terminal's
toggle), so the chord works while a composer, the sidebar or a toolbar has
focus and is never typed. A plain e and the other platform's chord pass
through: on a Mac, Ctrl+E stays the text fields' end-of-line. Elsewhere Ctrl+E
is left to the terminal while it has focus (the shell's end-of-line); on a Mac
Cmd+E works in the terminal too. Handling the key makes the Flutter web engine
call preventDefault, so Chrome's Ctrl+E (address bar search on
Windows/Linux) and Cmd+E (use selection for Find on macOS) do not fire while
the app has the keyboard. Neither is a browser-reserved shortcut. Only
CDP-injected keys were used in captures, so the physical browser default was
not observed directly.
Files
New: lib/features/chat/workspace/chat_center_stage_{layout,motion,controller,keys,strip,action}.dart,
test/features/chat/workspace/chat_center_stage_test.dart.
Small edits: chat_workspace.dart (centerStage/paneColor parameters, motion,
stage-aware neighbours), chat_workspace_surface.dart (stage rects, viewport,
strip layer, dividers), chat_screen_workspace.dart (keys wrapper, colours),
screen.dart (menu action).