Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

Simplify pane headers and restore edge-hover splits (#574)

Deee399423d4b82
diff --git a/desktop/CLAUDE.md b/desktop/CLAUDE.md
index 203abf284..685112c88 100644
--- a/desktop/CLAUDE.md
+++ b/desktop/CLAUDE.md
@@ -342,8 +342,10 @@ its headless debug timings do not establish native display or network latency.
with harness count, local hardware and subscription allowance used at the bottom left and focused machine/repo/branch/PR at the bottom right.
Tabs center their name/status group without permanent number prefixes; Command replaces
the status with the resolved shortcut beside the name. Tab and pane close marks are small
- and quiet, with larger click targets. Each terminal pane ends with agent, model,
- close. Split and zoom remain in commands, menus and keyboard shortcuts.
+ and quiet, with larger click targets. Terminal panes end with matching
+ plain-text agent/model selectors and close at every width. Hovering the right
+ or bottom edge reveals its split icon; zoom stays in commands, menus and keyboard
+ shortcuts. Only distinct domain-harness icons stay on the left.
Usage has no dot separators and colors only low/exhausted
percentages. Automatic names use the strongest shared harness type,
project, or machine, preferring traits that distinguish tabs and excluding dependent viewers.
diff --git a/desktop/design/desktop-design-system.md b/desktop/design/desktop-design-system.md
index dc7446644..6f283cd1f 100644
--- a/desktop/design/desktop-design-system.md
+++ b/desktop/design/desktop-design-system.md
@@ -335,14 +335,34 @@ inner edge beneath their 1-point rim. Only their frame changes: terminal content
input, selection and status typography remain the terminal's own. AppKit mirrors
these shared geometry values; Flutter uses AppDesktop directly.
-**Pane header** — the right-hand controls read agent, model, close. The shared
-12-point close glyph has a 28-point target, 4 points inside the trailing edge.
-Resting ink is 45%; hover and keyboard focus brighten the glyph without a fill,
-border, or movement. Keep the controls on one line; model and title text truncate
-before the close target shrinks. Split and zoom remain in commands, menus and
-keyboard shortcuts. Clicking the model focuses that
-pane and opens the same Models picker as Cmd-:. The agent name and chevron open
-the shared Agents picker (`&` in Cmd-P). Selection stays bound to that
+**Pane header** — terminal panes show agent, model and close at every width.
+Splitting is revealed at the pane edges; zoom remains available through menus,
+command search and shortcuts. Keep split, add and zoom icons out of the header.
+
+Agent and model share `PaneHeaderTextButton`: plain 13-point workspace text,
+regular weight, matching padding and a 28-point target height. No pill, border or
+chevron. Both brighten on hover and keyboard focus without changing weight or
+geometry; use a hand cursor and Change agent / Change model tooltips. Their labels
+rest at 75% foreground (85% with Increase Contrast). Keep them close together,
+then leave an 8-point gap before close. Remove a coding-agent logo
+that repeats the agent selector; keep a distinct domain-harness mark on the left.
+The session name and its activity/status remain on the left.
+
+Use the shared 12-point close glyph in a 28-point target, sitting 4 points
+inside the header's trailing edge. Resting ink is 45%; hover and keyboard focus
+brighten the glyph without a fill, border, or movement. Keep the controls on one
+line; the session title yields first, then the model truncates while the agent
+retains readable identity. Never shrink the close target.
+
+Hovering within 44 points of the right or bottom edge reveals one 32-point
+target, inset 8 points and centered along that edge. Use the rounded
+`AppPaneIcon` with `AppPaneSymbol.splitRight` or `splitDown` at 16 points, not a plus. Keep the header
+and corners clear and the resize gaps unobstructed. Hide edge controls while
+dragging, zoomed, in a phone's single-pane view, or unable to add a pane. Hover
+does not focus, resize or rebuild the terminal. Split opens New Harness directly,
+inheriting the clicked pane's agent, machine,
+and project; the pane is created only after submission. Clicking the model focuses that
+pane and opens the same Models picker as Cmd-:. The agent name opens the shared Agents picker (`&` in Cmd-P). Selection stays bound to that
harness; a closed or replaced pane cannot receive a stale selection. Long model
names truncate and retain their full-name tooltip. Keep effort in the terminal,
and keep the icon targets clear at narrow widths. Tab-strip close behavior is
diff --git a/desktop/design/new-harness-entry-rules.md b/desktop/design/new-harness-entry-rules.md
index ba50124a5..ac1bc08d2 100644
--- a/desktop/design/new-harness-entry-rules.md
+++ b/desktop/design/new-harness-entry-rules.md
@@ -40,7 +40,7 @@ Opening, searching, and cancelling never send input to an existing harness.
| Cmd-T, then Cmd-N | Last explicit agent, local machine, last selected project on that machine | The blank tab opened by Cmd-T |
| Cmd-Shift-P → New Harness | Last explicit agent, local machine, last selected project on that machine | Current tab |
| Cmd-N or the New Harness command | Last explicit agent, local machine, last selected project on that machine; retain explicit task and destination | Current tab unless its source requests a new tab |
-| Split Right/Down command, menu, or shortcut | Opens creation directly with the clicked/focused pane's agent, machine, and project | Requested split in that tab after submission |
+| Pane-edge split, Split Right/Down command, menu, or shortcut | Opens creation directly with the clicked/focused pane's agent, machine, and project | Requested split in that tab after submission |
| Store New Harness, or a product's Open action in the pane or native Models menu | Explicit product and machine; suggested project named for that product | New tab |
| Store Resume Harness | Existing harness and its machine; choose from a menu when several match | Focus its existing tab or reopen a view of the same harness |
| Store Try this prompt | Same as Open, with the example as the editable task | New tab |
@@ -78,7 +78,8 @@ Fresh harnesses use OpenCode with Muse Spark 1.3, xhigh effort and Auto-approve
remembered agent choices are retained; reopening a session keeps its saved agent
and model. A package's declared agent is a compatibility fallback, not a global default.
-The running pane header shows the agent name with a chevron beside the model.
+The running pane header shows the agent name as plain text beside the model,
+with the same type, padding and hover/focus treatment and no pill or chevron.
Clicking it opens the shared Cmd-P picker in `&` Agents mode. All agents are
listed; unsupported choices explain why they cannot be selected. Selecting a
supported agent saves and stops the current session, starts a fresh conversation
diff --git a/desktop/design/review/2026-10-02-pane-edge-down.png b/desktop/design/review/2026-10-02-pane-edge-down.png
new file mode 100644
index 000000000..630a61c4f
Binary files /dev/null and b/desktop/design/review/2026-10-02-pane-edge-down.png differ
diff --git a/desktop/design/review/2026-10-02-pane-edge-right.png b/desktop/design/review/2026-10-02-pane-edge-right.png
new file mode 100644
index 000000000..453f0e390
Binary files /dev/null and b/desktop/design/review/2026-10-02-pane-edge-right.png differ
diff --git a/desktop/design/terminal-workspace.md b/desktop/design/terminal-workspace.md
index c0d384c89..897478e79 100644
--- a/desktop/design/terminal-workspace.md
+++ b/desktop/design/terminal-workspace.md
@@ -33,11 +33,16 @@ Tooltips explain icon actions and resolve shortcuts from the live keymap.
The footer shows a global harness count, local host CPU/RAM/GPU and subscription
allowance used on the left, all in neutral ink with whole percentages. Its
right-hand context follows the focused pane: machine, project, branch and PR.
-Each terminal pane header ends with agent, model and close, in that order. The
-close icon stays visible with quiet ink and no button chrome. Split and zoom
-remain available through commands, menus and keyboard shortcuts. Splitting
-opens New Harness with the focused pane's agent, machine and project. Clicking
-the agent opens the shared `&` Agents picker; clicking the model opens Models;
+Each terminal pane header ends with agent, model and close at every width.
+Hovering the right edge reveals split right; hovering the bottom edge reveals
+split down. These icons sit inside the pane, clear of resize gaps. The header
+has no split, add or zoom icons; zoom remains in menus and shortcuts.
+Agent and model use the same plain-text selector with no pill or chevron. Their
+hover/focus changes ink, not weight or size. The left side keeps the session name
+and activity; only a distinct domain-harness icon remains beside it, rather than
+repeating the named coding agent. Splitting opens New Harness directly with that pane's agent, machine,
+and project, then creates into the chosen split on submission. Clicking the
+agent opens the shared `&` Agents picker; clicking the model opens the shared Models picker for that harness;
the footer does not repeat model or effort. Agent switching saves the original
session before starting its replacement in the same project. Its pane and layout
survive peer cleanup of the stopped source. Agents that accept an initial message
@@ -46,7 +51,12 @@ retries; the saved original session keeps the full transcript. Do not show workt
paths in everyday labels. User-selected shell/Powerline status styles remain
available, including PR state colors and the option to disable color.
-![Terminal header with agent, model and close controls](review/2026-10-01-agent-switch-header.png)
+The captures below use synthetic pane names. Agent and model remain plain text;
+only the hovered edge reveals a split control.
+
+![Four panes with split right revealed in the dark theme](review/2026-10-02-pane-edge-right.png)
+
+![Nine panes with split down revealed in the light theme](review/2026-10-02-pane-edge-down.png)
Machine opens its scope, Project opens related harnesses, Branch opens the
existing branches/PR history, and the PR opens its URL. These are navigation,
diff --git a/desktop/design/workspace-status-bar.md b/desktop/design/workspace-status-bar.md
index 3eab7c8a0..b413e53e0 100644
--- a/desktop/design/workspace-status-bar.md
+++ b/desktop/design/workspace-status-bar.md
@@ -204,9 +204,15 @@ use the shared system-type scale.
## Pane controls
-Each pane header ends with model, split down, split right, zoom and × at the
-right edge. The 14-point split/zoom glyphs and 12-point close glyph each have a
-28-point target, with no resting fill or border. Tab and pane close marks share a small regular glyph (12-point
+Terminal pane headers end with agent, model and × at the right edge at every
+width. Splitting lives at the pane edges; zoom remains available through menus
+and shortcuts. Agent and model
+share plain 13-point workspace text with no pill or chevron, and an 8-point gap
+separates these selectors from close. The title truncates before the
+model; the agent retains readable identity. Remove repeated coding-agent logos
+on the left while retaining distinct domain-harness icons.
+The 12-point close glyph has a 28-point target, with no resting fill or border.
+Tab and pane close marks share a small regular glyph (12-point
Lucide, optically matched 10-point SF Symbol) and quiet 45% resting ink, with
full ink on hover/focus and the existing larger click
targets. The close control removes that pane view while keeping its harness
@@ -230,24 +236,28 @@ a version from a family alias. Older daemons fall back to the provider name.
Show only the model name in the header. The terminal presents its effort setting;
never infer effort or append subscription effort to a local model name.
Keep this label visible without requiring hover, including while disconnected;
-disable switching when the pane is read-only. Use a hand cursor, bold text on hover
-and keyboard focus, and a tooltip explaining subscription/local switching.
+disable switching when the pane is read-only. Agent and model use a hand cursor,
+brighter regular-weight text on hover and keyboard focus, and matching targets
+that never move. The model tooltip explains subscription/local switching.
Do not repeat the model name in that tooltip unless it is truncated or replaced
by `Switching…`. Preserve useful capability details and full truncated names
while offline, but do not advertise switching when it is disabled.
A model update must repaint the label without reopening or retargeting the pane.
The observed subscription model does not select a Local row in the picker.
-Zoom is also available in the header and becomes Restore while enlarged.
-Stop remains a keyboard/menu action. Cmd-Shift-W closes the focused pane
+Zoom and Stop remain keyboard/menu actions. Cmd-Shift-W closes the focused pane
view, Cmd-W closes the tab, and Cmd-Enter toggles pane zoom. Closing a view
keeps its harness running; Stop Harness remains a separate command with its
existing confirmation. Preserve explicit user keymap overrides.
-Pane edges have no floating split buttons. Split Right and Split Down use the
-header, keyboard commands (Cmd-R and Cmd-D by default), File menu, and command
-search. All open New Harness directly with the source pane's defaults, without
-an existing-harness search step. Keep the resize gaps available for resizing.
+Hovering the right or bottom edge reveals its split-right or split-down icon
+inside the pane. Use one 32-point target centered on that edge, inset 8 points,
+with the shared 16-point pane icon; do not use a plus. Hover leaves focus and
+terminal state untouched. Hide these controls while dragging or zoomed and
+leave the resize gaps clear. Split Right and Split Down also use keyboard
+commands (Cmd-R and Cmd-D by default), File menu and command search. All open
+New Harness directly with the source pane's defaults, without an existing-harness
+search step.
Settings → Experimental → Share button is off by default on desktop and web.
The choice persists locally and updates the bar immediately; when off, no button
diff --git a/desktop/lib/widgets/grid_model_picker.dart b/desktop/lib/widgets/grid_model_picker.dart
index a93e16bb6..517464348 100644
--- a/desktop/lib/widgets/grid_model_picker.dart
+++ b/desktop/lib/widgets/grid_model_picker.dart
@@ -1,13 +1,10 @@
import 'dart:async';
-import 'dart:math' as math;
import 'package:harness/shared/theme/app_icons.dart';
import 'package:flutter/material.dart';
+import 'package:flutter/scheduler.dart';
-import '../shared/theme/workspace_bar_style.dart';
import '../shared/theme/app_theme.dart' as grid;
-import '../terminal/terminal_theme.dart';
-import '../terminal/terminal_theme_store.dart';
import 'package:harness/terminal/terminal_text.dart';
@@ -22,9 +19,9 @@ import 'engine_identity.dart';
import 'model_picker_answer.dart';
import 'model_picker_chrome.dart';
import 'pane_menu.dart';
+import 'pane_header_text_button.dart';
import 'resting_model_words.dart';
import 'resting_section.dart';
-import 'workspace_bar_control.dart';
/// The engines whose panes carry a model picker.
///
@@ -172,6 +169,13 @@ class _GridModelPickerState extends State<GridModelPicker> {
!widget.notifier.inForeground) {
return;
}
+ // Init and re-enabling can happen during layout. Usage refresh notifies
+ // the workspace footer synchronously, so wait until its frame is complete.
+ if (WidgetsBinding.instance.schedulerPhase ==
+ SchedulerPhase.persistentCallbacks) {
+ WidgetsBinding.instance.addPostFrameCallback((_) => _foregroundChanged());
+ return;
+ }
_prefetchOwed = false;
unawaited(_prefetch().then((_) => _refreshOpenMenu()));
}
@@ -541,54 +545,18 @@ class _GridModelPickerState extends State<GridModelPicker> {
);
final label = _expecting ? 'Switching…' : current;
if (widget.paneHeader) {
- final theme = terminalThemeFor(
- grid.AppTheme.palette.value,
- terminalThemeStore.value,
- );
- final cell = workspaceBarCellSizeOf(context);
- final labelSize = workspaceBarTextSizeOf(context, label);
- return LayoutBuilder(
- builder: (context, constraints) {
- final padding = math.min(cell.width, constraints.maxWidth / 2);
- final textWidth = math.max(
- 0.0,
- math.min(220.0, constraints.maxWidth - padding * 2),
- );
- final clipped = labelSize.width > textWidth;
- return WorkspaceBarControl(
- label: 'Model: $current',
- tooltip: [
- if (clipped || label != current) current,
- if (widget.enabled) 'Switch model · Subscription or local models',
- ?sentence,
- ].join('\n'),
- foreground: theme.foreground,
- onPressed: widget.enabled ? _open : null,
- builder: (context, emphasized) => SizedBox(
- width: math.min(labelSize.width, textWidth) + padding * 2,
- height: workspaceBarControlHeight(context),
- child: Padding(
- padding: EdgeInsets.symmetric(horizontal: padding),
- child: Center(
- child: Text(
- label,
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: workspaceBarTextStyle(emphasized: emphasized),
- ),
- ),
- ),
- ),
- );
- },
+ return PaneHeaderTextButton(
+ text: label,
+ fullText: current,
+ label: 'Model: $current',
+ tooltip: [
+ if (widget.enabled) 'Change model · Subscription or local models',
+ ?sentence,
+ ].join('\n'),
+ onPressed: widget.enabled ? _open : null,
);
}
- final foreground = widget.paneHeader
- ? terminalThemeFor(
- grid.AppTheme.palette.value,
- terminalThemeStore.value,
- ).foreground.withValues(alpha: .65)
- : AppColors.textSoft;
+ final foreground = AppColors.textSoft;
return Tooltip(
// The same sentence the menu shows, one line under the control's own — so a person can learn
// the agent has no web search without opening the menu at all.
@@ -642,12 +610,10 @@ class _GridModelPickerState extends State<GridModelPicker> {
label,
maxLines: 1,
overflow: TextOverflow.ellipsis,
- style: widget.paneHeader
- ? workspaceBarTextStyle(color: foreground)
- : AppType.monoLabel(
- fontWeight: FontWeight.w400,
- color: AppColors.textSoft,
- ),
+ style: AppType.monoLabel(
+ fontWeight: FontWeight.w400,
+ color: AppColors.textSoft,
+ ),
),
),
),
diff --git a/desktop/lib/widgets/harness_agent_control.dart b/desktop/lib/widgets/harness_agent_control.dart
index 44c95735c..b9ccdeadf 100644
--- a/desktop/lib/widgets/harness_agent_control.dart
+++ b/desktop/lib/widgets/harness_agent_control.dart
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
-import '../shared/theme/app_icons.dart';
import '../core/models.dart';
import '../state/app_state.dart';
import 'harness_agent_picker.dart';
+import 'pane_header_text_button.dart';
/// The agent name, immediately beside the model, opens the shared & picker.
class HarnessAgentControl extends StatelessWidget {
@@ -20,31 +20,17 @@ class HarnessAgentControl extends StatelessWidget {
final bool enabled;
@override
- Widget build(BuildContext context) => Tooltip(
- message: 'Change agent',
- child: TextButton(
+ Widget build(BuildContext context) {
+ final name = HarnessAgentPicker.label(agent.engine ?? '');
+ final canChange = enabled && app.openAgentPicker != null;
+ return PaneHeaderTextButton(
key: const ValueKey('pane-agent-control'),
- style: TextButton.styleFrom(
- minimumSize: Size.zero,
- padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 4),
- ),
- onPressed: !enabled || app.openAgentPicker == null
- ? null
- : () => app.openAgentPicker!(machineId, agent.id),
- child: Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- Flexible(
- child: Text(
- HarnessAgentPicker.label(agent.engine ?? ''),
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- ),
- ),
- const SizedBox(width: 3),
- const Icon(AppIcons.chevronDown, size: 12),
- ],
- ),
- ),
- );
+ text: name,
+ label: 'Agent: $name',
+ tooltip: canChange ? 'Change agent' : null,
+ onPressed: canChange
+ ? () => app.openAgentPicker!(machineId, agent.id)
+ : null,
+ );
+ }
}
diff --git a/desktop/lib/widgets/pane_grid.dart b/desktop/lib/widgets/pane_grid.dart
index ec650fdb8..fbaa02e22 100644
--- a/desktop/lib/widgets/pane_grid.dart
+++ b/desktop/lib/widgets/pane_grid.dart
@@ -36,6 +36,7 @@ import 'terminal_panel.dart';
import 'harness_activity_mark.dart';
import 'web_pane_panel.dart';
import 'pane_resize_handle.dart';
+import 'pane_split_edges.dart';
import 'box_chrome.dart' show kWorkspaceInset, terminalPaneBorder, PaneOpacity;
import 'desktop_chrome.dart';
@@ -498,6 +499,10 @@ class _SwarmCanvasState extends State<_SwarmCanvas> {
single: app.panes.length == 1,
pinned: app.isPanePinned(pane),
zoomed: app.zoomedPaneId == pane.id,
+ canSplitRight:
+ app.preparePaneSplit(PaneResizeAxis.x, paneId: pane.id) != null,
+ canSplitDown:
+ app.preparePaneSplit(PaneResizeAxis.y, paneId: pane.id) != null,
composer: pane.composerVisible,
blocked:
app.questionFor(pane.machineId, pane.agentId ?? session.agentId) !=
@@ -1260,91 +1265,119 @@ class _PaneCell extends StatelessWidget {
// The same press selects the pane and reaches its terminal or viewer.
behavior: HitTestBehavior.translucent,
onPointerDown: (_) => notifier.focusPane(pane.id),
- child: Container(
- key: ValueKey('pane-frame:${pane.id}'),
- decoration: BoxDecoration(
- // UNCHANGED, and deliberately: the terminal renders its own background
- // inside this box, so a tile that stops matching the window colour
- // shows a seam between the header strip and the terminal under it.
- // What changes to make the gaps visible is the field BEHIND the grid
- // (see _GridField), which is the part the gaps actually show.
- //
- // Over a Background: a terminal paints its own translucent fills, so
- // the frame adds none (two would stack); a status pane has only this.
- color: PaneOpacity.of(context) < 1 && pane.session != null
- ? null
- : PaneOpacity.fill(context, grid.AppPalette.windowBg),
- borderRadius: BorderRadius.circular(_paneRadius),
- // The rim is always drawn — it is what gives an unfocused card its
- // edge, now that no shared line does. It only CHANGES COLOUR on
- // focus, so nothing resizes as focus moves.
- border: Border.fromBorderSide(
- // Keep the location cue when a pane is alone or zoomed, too.
- terminalPaneBorder(focused: focused, remote: remote),
- ),
- ),
- // A neutral gray veil lifts inactive backgrounds and softens their text
- // without changing terminal colors. Paint attention above the veil so
- // a waiting question keeps its full-strength amber rim. Keep this
- // decoration present even when clear: inserting/removing it would
- // reparent the terminal and lose its input, scroll and selection state.
- foregroundDecoration: BoxDecoration(
- color: dimmed ? const Color(0xFF9D9D9D).withValues(alpha: .30) : null,
- border: blocked
- ? Border.all(color: grid.AppPalette.warn, width: 2)
- : null,
- borderRadius: BorderRadius.circular(_paneRadius),
+ child: ValueListenableBuilder<PaneDragRef?>(
+ valueListenable: paneDragging,
+ builder: (context, inFlight, child) => PaneSplitEdges(
+ enabled:
+ swarmMode &&
+ visible &&
+ !solo &&
+ agentId != null &&
+ pane.sharedHarness == null &&
+ onSplitPane != null &&
+ !notifier.activeSwarm.isUtility &&
+ !notifier.activeSwarm.isOrchestrator &&
+ notifier.zoomedPaneId == null &&
+ notifier.canAddPane &&
+ dragging == null &&
+ inFlight == null,
+ canSplitRight:
+ notifier.preparePaneSplit(PaneResizeAxis.x, paneId: pane.id) !=
+ null,
+ canSplitDown:
+ notifier.preparePaneSplit(PaneResizeAxis.y, paneId: pane.id) !=
+ null,
+ onSplit: (axis) => onSplitPane?.call(pane.id, axis),
+ child: child!,
),
- // Keeps a terminal's constant repainting inside its own layer instead
- // of dirtying the whole grid. No key: nothing reads this boundary, it
- // only has to exist.
- child: ClipRRect(
- // Clipped HERE rather than through Container's own clipBehavior.
- //
- // Both clip, but they clip to different shapes: Container's is the
- // decoration's OUTER edge, so the child fills the full radius and
- // paints under the rim, leaving a square-shouldered corner peeking
- // through the 1px the rim occupies. This one takes the rim's pixel
- // off the radius, so the fill stops exactly where the rim starts.
- //
- // TerminalPanel opens with a ColoredBox across its whole box, and
- // that is what was reaching the corners.
- borderRadius: BorderRadius.circular(_paneRadius - 1),
- child: RepaintBoundary(
- child: _FileDropZone(
- notifier: notifier,
- pane: pane,
- visible: visible,
- child: _SwapZone(
+ child: Container(
+ key: ValueKey('pane-frame:${pane.id}'),
+ decoration: BoxDecoration(
+ // UNCHANGED, and deliberately: the terminal renders its own background
+ // inside this box, so a tile that stops matching the window colour
+ // shows a seam between the header strip and the terminal under it.
+ // What changes to make the gaps visible is the field BEHIND the grid
+ // (see _GridField), which is the part the gaps actually show.
+ //
+ // Over a Background: a terminal paints its own translucent fills, so
+ // the frame adds none (two would stack); a status pane has only this.
+ color: PaneOpacity.of(context) < 1 && pane.session != null
+ ? null
+ : PaneOpacity.fill(context, grid.AppPalette.windowBg),
+ borderRadius: BorderRadius.circular(_paneRadius),
+ // The rim is always drawn — it is what gives an unfocused card its
+ // edge, now that no shared line does. It only CHANGES COLOUR on
+ // focus, so nothing resizes as focus moves.
+ border: Border.fromBorderSide(
+ // Keep the location cue when a pane is alone or zoomed, too.
+ terminalPaneBorder(focused: focused, remote: remote),
+ ),
+ ),
+ // A neutral gray veil lifts inactive backgrounds and softens their text
+ // without changing terminal colors. Paint attention above the veil so
+ // a waiting question keeps its full-strength amber rim. Keep this
+ // decoration present even when clear: inserting/removing it would
+ // reparent the terminal and lose its input, scroll and selection state.
+ foregroundDecoration: BoxDecoration(
+ color: dimmed
+ ? const Color(0xFF9D9D9D).withValues(alpha: .30)
+ : null,
+ border: blocked
+ ? Border.all(color: grid.AppPalette.warn, width: 2)
+ : null,
+ borderRadius: BorderRadius.circular(_paneRadius),
+ ),
+ // Keeps a terminal's constant repainting inside its own layer instead
+ // of dirtying the whole grid. No key: nothing reads this boundary, it
+ // only has to exist.
+ child: ClipRRect(
+ // Clipped HERE rather than through Container's own clipBehavior.
+ //
+ // Both clip, but they clip to different shapes: Container's is the
+ // decoration's OUTER edge, so the child fills the full radius and
+ // paints under the rim, leaving a square-shouldered corner peeking
+ // through the 1px the rim occupies. This one takes the rim's pixel
+ // off the radius, so the fill stops exactly where the rim starts.
+ //
+ // TerminalPanel opens with a ColoredBox across its whole box, and
+ // that is what was reaching the corners.
+ borderRadius: BorderRadius.circular(_paneRadius - 1),
+ child: RepaintBoundary(
+ child: _FileDropZone(
notifier: notifier,
- paneId: pane.id,
- child: _DropZone(
+ pane: pane,
+ visible: visible,
+ child: _SwapZone(
notifier: notifier,
paneId: pane.id,
- dragging: dragging,
- child: ValueListenableBuilder<PaneDragRef?>(
- valueListenable: paneDragging,
- // The tile being carried fades where it sits, so the grid shows
- // where it came FROM while the ghost shows where it is going.
- builder: (context, inFlight, child) => Opacity(
- opacity: inFlight?.paneId == pane.id ? 0.35 : 1,
- child: child,
+ child: _DropZone(
+ notifier: notifier,
+ paneId: pane.id,
+ dragging: dragging,
+ child: ValueListenableBuilder<PaneDragRef?>(
+ valueListenable: paneDragging,
+ // The tile being carried fades where it sits, so the grid shows
+ // where it came FROM while the ghost shows where it is going.
+ builder: (context, inFlight, child) => Opacity(
+ opacity: inFlight?.paneId == pane.id ? 0.35 : 1,
+ child: child,
+ ),
+ child: pane.isDevices
+ ? devicesViewer?.call(context) ??
+ const SizedBox.shrink()
+ : pane.isCompanion
+ ? companionViewer?.call(context) ??
+ const SizedBox.shrink()
+ : _PaneContent(
+ notifier: notifier,
+ pane: pane,
+ single: _single,
+ visible: visible,
+ swarmMode: swarmMode,
+ onOpenModels: onOpenModels,
+ onSplitPane: onSplitPane,
+ ),
),
- child: pane.isDevices
- ? devicesViewer?.call(context) ??
- const SizedBox.shrink()
- : pane.isCompanion
- ? companionViewer?.call(context) ??
- const SizedBox.shrink()
- : _PaneContent(
- notifier: notifier,
- pane: pane,
- single: _single,
- visible: visible,
- swarmMode: swarmMode,
- onOpenModels: onOpenModels,
- onSplitPane: onSplitPane,
- ),
),
),
),
diff --git a/desktop/lib/widgets/pane_header_actions.dart b/desktop/lib/widgets/pane_header_actions.dart
index bb0ec07d9..6229c7c64 100644
--- a/desktop/lib/widgets/pane_header_actions.dart
+++ b/desktop/lib/widgets/pane_header_actions.dart
@@ -1,3 +1,5 @@
+import 'dart:math' as math;
+
import 'package:flutter/widgets.dart';
/// Pane-local model selection and optional standalone terminal context.
@@ -35,29 +37,35 @@ class PaneHeaderActions extends StatelessWidget {
ConstrainedBox(
constraints: BoxConstraints(
maxWidth: constraints.maxWidth.isFinite
- ? constraints.maxWidth *
- (details != null || trailing != null ? .3 : .5)
+ ? math.min(
+ 140,
+ details != null || trailing != null
+ ? constraints.maxWidth * .3
+ : math.max(
+ 0,
+ constraints.maxWidth -
+ (modelPicker != null ? 56 : 0),
+ ),
+ )
: 140,
),
child: agentPicker!,
),
if (modelPicker != null) ...[
if (details != null || trailing != null) const SizedBox(width: 8),
- // Let a short model use only its natural width, leaving the remaining
- // space for context. Cap it when context shares a narrow header.
- ConstrainedBox(
- constraints: BoxConstraints(
- maxWidth: constraints.maxWidth.isFinite
- ? constraints.maxWidth *
- (details != null || trailing != null
- ? .4
- : agentPicker != null
- ? .5
- : 1)
- : 232,
- ),
- child: modelPicker!,
- ),
+ if (details != null || trailing != null)
+ // Short model names leave room for the standalone pane's context.
+ ConstrainedBox(
+ constraints: BoxConstraints(
+ maxWidth: constraints.maxWidth.isFinite
+ ? constraints.maxWidth * .4
+ : 232,
+ ),
+ child: modelPicker!,
+ )
+ else
+ // The model uses the room left by the agent's natural width.
+ Flexible(child: modelPicker!),
],
],
),
diff --git a/desktop/lib/widgets/pane_header_text_button.dart b/desktop/lib/widgets/pane_header_text_button.dart
new file mode 100644
index 000000000..1a0cda0e1
--- /dev/null
+++ b/desktop/lib/widgets/pane_header_text_button.dart
@@ -0,0 +1,81 @@
+import 'dart:math' as math;
+
+import 'package:flutter/material.dart';
+
+import '../shared/theme/app_theme.dart' as grid;
+import '../shared/theme/workspace_bar_style.dart';
+import '../terminal/terminal_theme.dart';
+import '../terminal/terminal_theme_store.dart';
+import 'workspace_bar_control.dart';
+
+/// Agent and model selectors share quiet text, fixed targets and focus behavior.
+class PaneHeaderTextButton extends StatelessWidget {
+ const PaneHeaderTextButton({
+ super.key,
+ required this.text,
+ required this.label,
+ this.fullText,
+ this.tooltip,
+ this.onPressed,
+ });
+
+ static const horizontalPadding = 6.0;
+ static const maxTextWidth = 220.0;
+
+ final String text, label;
+ final String? fullText, tooltip;
+ final VoidCallback? onPressed;
+
+ @override
+ Widget build(BuildContext context) {
+ grid.AppTheme.watch(context);
+ final foreground = terminalThemeFor(
+ grid.AppTheme.palette.value,
+ terminalThemeStore.value,
+ ).foreground;
+ final labelSize = workspaceBarTextSizeOf(context, text);
+ final highContrast = MediaQuery.highContrastOf(context);
+ return LayoutBuilder(
+ builder: (context, constraints) {
+ final padding = math.min(horizontalPadding, constraints.maxWidth / 2);
+ final textWidth = math.max(
+ 0.0,
+ math.min(maxTextWidth, constraints.maxWidth - padding * 2),
+ );
+ return WorkspaceBarControl(
+ label: label,
+ tooltip: [
+ if (labelSize.width > textWidth ||
+ (fullText != null && fullText != text))
+ fullText ?? text,
+ if (tooltip?.isNotEmpty == true) tooltip!,
+ ].join('\n'),
+ onPressed: onPressed,
+ builder: (context, emphasized) => SizedBox(
+ width: math.min(labelSize.width, textWidth) + padding * 2,
+ height: workspaceBarControlHeight(context),
+ child: Padding(
+ padding: EdgeInsets.symmetric(horizontal: padding),
+ child: Center(
+ child: Text(
+ text,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: workspaceBarTextStyle(
+ color: foreground.withValues(
+ alpha: onPressed == null
+ ? (highContrast ? .45 : .28)
+ : emphasized
+ ? 1
+ : (highContrast ? .85 : .75),
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
diff --git a/desktop/lib/widgets/pane_split_edges.dart b/desktop/lib/widgets/pane_split_edges.dart
new file mode 100644
index 000000000..d0d20cf5a
--- /dev/null
+++ b/desktop/lib/widgets/pane_split_edges.dart
@@ -0,0 +1,185 @@
+import 'package:flutter/gestures.dart';
+import 'package:flutter/material.dart';
+
+import '../shared/theme/app_theme.dart' as grid;
+import '../shared/theme/app_pane_icon.dart';
+import '../shortcuts/app_keymap.dart';
+import '../state/pane_arrangement.dart';
+import '../theme/app_theme.dart';
+
+/// Reveals split controls inside the pane, leaving the resize gap untouched.
+/// Hover state stays here so pointer movement never rebuilds the terminal.
+class PaneSplitEdges extends StatefulWidget {
+ const PaneSplitEdges({
+ super.key,
+ required this.child,
+ required this.enabled,
+ required this.canSplitRight,
+ required this.canSplitDown,
+ required this.onSplit,
+ });
+
+ final Widget child;
+ final bool enabled, canSplitRight, canSplitDown;
+ final ValueChanged<PaneResizeAxis>? onSplit;
+
+ @override
+ State<PaneSplitEdges> createState() => _PaneSplitEdgesState();
+}
+
+class _PaneSplitEdgesState extends State<PaneSplitEdges> {
+ static const _buttonSize = 32.0;
+ static const _inset = 8.0;
+ static const _edgeWidth = 44.0;
+ PaneResizeAxis? _edge;
+ Size _size = Size.zero;
+
+ @override
+ void didUpdateWidget(PaneSplitEdges oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ if (!widget.enabled) _edge = null;
+ }
+
+ void _reveal(PaneResizeAxis? edge) {
+ if (_edge == edge) return;
+ setState(() => _edge = edge);
+ }
+
+ void _hover(PointerHoverEvent event) {
+ if (!widget.enabled || event.buttons != 0) return;
+ final point = event.localPosition;
+ // Leave the header controls and both bottom corners alone. Once revealed,
+ // the button itself stays inside the same hover band as the edge.
+ final bottom =
+ point.dy >= _size.height - _edgeWidth &&
+ point.dx >= _edgeWidth &&
+ point.dx <= _size.width - _edgeWidth;
+ final right =
+ point.dx >= _size.width - _edgeWidth &&
+ point.dy >= 60 &&
+ point.dy < _size.height - _edgeWidth;
+ _reveal(
+ bottom
+ ? PaneResizeAxis.y
+ : right
+ ? PaneResizeAxis.x
+ : null,
+ );
+ }
+
+ Rect _actionsRect(PaneResizeAxis axis) => axis == PaneResizeAxis.x
+ ? Rect.fromLTWH(
+ _size.width - _inset - _buttonSize,
+ (_size.height - _buttonSize) / 2,
+ _buttonSize,
+ _buttonSize,
+ )
+ : Rect.fromLTWH(
+ (_size.width - _buttonSize) / 2,
+ _size.height - _inset - _buttonSize,
+ _buttonSize,
+ _buttonSize,
+ );
+
+ void _pressed(PointerDownEvent event) {
+ final edge = _edge;
+ if (edge != null && !_actionsRect(edge).contains(event.localPosition)) {
+ _reveal(null);
+ }
+ }
+
+ Widget _actions(PaneResizeAxis axis) {
+ final visible = widget.enabled && _edge == axis;
+ final right = axis == PaneResizeAxis.x;
+ final available = right ? widget.canSplitRight : widget.canSplitDown;
+ return Positioned.fromRect(
+ rect: _actionsRect(axis),
+ child: IgnorePointer(
+ ignoring: !visible,
+ child: ExcludeFocus(
+ excluding: !visible,
+ child: ExcludeSemantics(
+ excluding: !visible,
+ child: AnimatedOpacity(
+ opacity: visible ? 1 : 0,
+ duration: MediaQuery.disableAnimationsOf(context)
+ ? Duration.zero
+ : grid.AppMotion.hover,
+ child: DecoratedBox(
+ decoration: BoxDecoration(
+ color: AppColors.surface,
+ border: Border.all(color: AppColors.borderStrong),
+ borderRadius: BorderRadius.circular(_buttonSize / 2),
+ ),
+ child: _button(axis, available: available),
+ ),
+ ),
+ ),
+ ),
+ ),
+ );
+ }
+
+ Widget _button(PaneResizeAxis axis, {required bool available}) {
+ final right = axis == PaneResizeAxis.x;
+ final action = right ? 'New Pane to the Right' : 'New Pane Below';
+ final direction = right ? 'right' : 'down';
+ final callback = widget.onSplit;
+ final shortcut = KeymapTheme.of(context)?.hint('pane.split_$direction');
+ return IconButton(
+ key: ValueKey('pane-split-$direction'),
+ tooltip: available
+ ? [
+ action,
+ if (shortcut != null && shortcut.isNotEmpty) shortcut,
+ ].join(' · ')
+ : '$action: splitting unavailable',
+ onPressed: available && callback != null
+ ? () {
+ _reveal(null);
+ callback(axis);
+ }
+ : null,
+ icon: AppPaneIcon(
+ right ? AppPaneSymbol.splitRight : AppPaneSymbol.splitDown,
+ size: 16,
+ ),
+ style: IconButton.styleFrom(
+ fixedSize: const Size.square(_buttonSize),
+ minimumSize: const Size.square(_buttonSize),
+ padding: EdgeInsets.zero,
+ tapTargetSize: MaterialTapTargetSize.shrinkWrap,
+ visualDensity: VisualDensity.standard,
+ foregroundColor: AppColors.textSoft,
+ disabledForegroundColor: AppColors.mutedStrong,
+ hoverColor: grid.AppSurface.hoverFill,
+ shape: const CircleBorder(),
+ ),
+ );
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ grid.AppTheme.watch(context);
+ return LayoutBuilder(
+ builder: (context, constraints) {
+ _size = constraints.biggest;
+ return MouseRegion(
+ onHover: _hover,
+ onExit: (_) => _reveal(null),
+ child: Listener(
+ onPointerDown: _pressed,
+ child: Stack(
+ fit: StackFit.expand,
+ children: [
+ widget.child,
+ _actions(PaneResizeAxis.x),
+ _actions(PaneResizeAxis.y),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
diff --git a/desktop/lib/widgets/terminal_panel.dart b/desktop/lib/widgets/terminal_panel.dart
index dc62507db..721856e82 100644
--- a/desktop/lib/widgets/terminal_panel.dart
+++ b/desktop/lib/widgets/terminal_panel.dart
@@ -2731,11 +2731,12 @@ class _TerminalHeader extends StatelessWidget {
// Reserve space for the pane-local model selector.
// Engines without a picker keep their existing header width.
final showModelPicker = modelPickerSupports(session.engineId);
- // The picker: a model id up to 220px and its padding.
+ // Both text selectors keep their natural width until the title has yielded.
final pickerWidth =
- (showModelPicker ? 250.0 : 0.0) + (agent != null ? 90.0 : 0.0);
- final controlsWidth = onClose != null ? PaneHeaderButton.width : 0.0;
- final actionsWidth = pickerWidth + controlsWidth;
+ (showModelPicker ? 232.0 : 0.0) + (agent != null ? 140.0 : 0.0);
+ // A domain harness has a different identity from its coding agent. The
+ // latter is already named by the selector on the right.
+ final showIdentityMark = agent == null || agent.dsh != null;
// A fork says so first: "forked from X" is the one fact about this pane
// that the folder and the branch — shared with its source — cannot tell.
final forkedFrom = agent?.forkedFrom;
@@ -2750,6 +2751,13 @@ class _TerminalHeader extends StatelessWidget {
builder: (context, constraints) {
final scale = grid.appTextScaleOf(context);
final narrow = constraints.maxWidth < 560 * math.max(1, scale);
+ final controlsWidth = onClose != null
+ ? PaneHeaderButton.width
+ : 0.0;
+ final controlsGap = controlsWidth > 0 && pickerWidth > 0
+ ? 8.0
+ : 0.0;
+ final actionsWidth = pickerWidth + controlsGap + controlsWidth;
// At the smallest widths, connection state takes the leading
// mark's place so the pane name survives beside the fixed tools.
final leadingStatus =
@@ -2799,7 +2807,7 @@ class _TerminalHeader extends StatelessWidget {
)
: 16.0;
return math.min(
- 17 + 10 + width + 8 + statusRoom + 8,
+ (showIdentityMark ? 27 : 0) + width + 8 + statusRoom + 8,
constraints.maxWidth * .45,
);
}
@@ -2807,6 +2815,7 @@ class _TerminalHeader extends StatelessWidget {
final desiredRightWidth = narrow
? math.max(
controlsWidth +
+ controlsGap +
(showModelPicker ? 96.0 : 0.0) +
(agent != null ? 90.0 : 0.0) +
badgeWidth,
@@ -2820,30 +2829,19 @@ class _TerminalHeader extends StatelessWidget {
);
// The name/status retain space while model and project text yield.
final rightWidth = math.min(
- compact
- ? controlsWidth +
- math.min(
- pickerWidth,
- math.max(
- agent != null ? 180.0 : 56.0,
- (constraints.maxWidth - controlsWidth) * .38,
- ),
- )
- : desiredRightWidth,
- math.max(0.0, constraints.maxWidth - 99),
+ compact ? actionsWidth : desiredRightWidth,
+ math.max(0.0, constraints.maxWidth - (compact ? 56 : 99)),
);
return Row(
children: [
if (leadingStatus)
statusButton()
- else if (agent != null)
+ else if (agent != null && showIdentityMark)
EngineMark.forAgent(agent, size: 17)
- else
+ else if (showIdentityMark)
EngineMark(engine: session.engineId, size: 17),
- // Icon and name, the same as every other pane (owner,
- // 2026-09-15): a harness agent is its harness here, and the
- // engine it runs on is the dialog's and the tooltip's to say.
- SizedBox(width: leadingStatus ? 6 : 10),
+ if (leadingStatus || showIdentityMark)
+ SizedBox(width: leadingStatus ? 6 : 10),
Expanded(
child: Row(
children: [
@@ -3003,7 +3001,10 @@ class _TerminalHeader extends StatelessWidget {
),
ConstrainedBox(
constraints: BoxConstraints(
- maxWidth: math.max(0, rightWidth - controlsWidth),
+ maxWidth: math.max(
+ 0,
+ rightWidth - controlsWidth - controlsGap,
+ ),
),
child: PaneHeaderActions(
agentPicker: agent == null
@@ -3106,6 +3107,7 @@ class _TerminalHeader extends StatelessWidget {
),
),
),
+ if (controlsGap > 0) SizedBox(width: controlsGap),
if (onClose != null) PaneCloseButton(onPressed: onClose!),
],
);
diff --git a/desktop/lib/widgets/web_pane_panel.dart b/desktop/lib/widgets/web_pane_panel.dart
index 9fa6136f8..033c2aacd 100644
--- a/desktop/lib/widgets/web_pane_panel.dart
+++ b/desktop/lib/widgets/web_pane_panel.dart
@@ -403,9 +403,7 @@ class _WebPanePanelState extends State<WebPanePanel> {
),
// coverage:ignore-end
_ViewerActions(
- zoomed: widget.zoomed,
onReload: _controller == null && _remote == null ? null : _reload,
- onZoom: widget.onToggleZoom,
onClose: widget.onClose,
),
],
@@ -471,15 +469,9 @@ class _WebPanePanelState extends State<WebPanePanel> {
/// Viewer navigation never stops the harness that owns it.
class _ViewerActions extends StatelessWidget {
- const _ViewerActions({
- required this.zoomed,
- this.onReload,
- this.onZoom,
- this.onClose,
- });
+ const _ViewerActions({this.onReload, this.onClose});
- final bool zoomed;
- final VoidCallback? onReload, onZoom, onClose;
+ final VoidCallback? onReload, onClose;
@override
Widget build(BuildContext context) {
@@ -491,12 +483,6 @@ class _ViewerActions extends StatelessWidget {
icon: AppPaneSymbol.reload,
onPressed: onReload,
),
- PaneHeaderButton(
- label: zoomed ? 'Restore harnesses' : 'Zoom viewer',
- command: 'pane.zoom',
- icon: zoomed ? AppPaneSymbol.restore : AppPaneSymbol.zoom,
- onPressed: onZoom,
- ),
PaneHeaderButton(
label: 'Close viewer',
command: 'pane.close',
diff --git a/desktop/test/agent_change_test.dart b/desktop/test/agent_change_test.dart
index f244788ff..0d6fec13c 100644
--- a/desktop/test/agent_change_test.dart
+++ b/desktop/test/agent_change_test.dart
@@ -1,6 +1,7 @@
import 'dart:async';
import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:harness/api/api_client.dart';
import 'package:harness/auth/auth_session.dart';
@@ -11,6 +12,7 @@ import 'package:harness/core/dsh_catalog.dart';
import 'package:harness/core/models.dart';
import 'package:harness/state/app_state.dart';
import 'package:harness/state/swarm_search.dart';
+import 'package:harness/terminal/terminal_binary.dart';
import 'package:harness/widgets/engine_identity.dart';
import 'support/harness_monitor.dart';
@@ -541,16 +543,26 @@ void main() {
(tester) async {
final app = createApp();
app.stateOf('m')!.nodeOnline = true;
- app.adoptSessionForTest(terminal('a0', []));
+ final frames = <TerminalBinaryFrame>[];
+ final pane = app.adoptSessionForTest(terminal('a0', frames));
await mount(tester, app);
- await tester.tap(find.byKey(const ValueKey('pane-agent-control')));
- await tester.pump();
- final field = tester.widget<TextField>(
- find.byKey(const ValueKey('swarm-search-input')),
- );
- expect(field.controller!.text.trim(), '&');
- expect(find.text('OpenCode'), findsWidgets);
- expect(tester.takeException(), isNull);
+ for (final width in [1280.0, 480.0]) {
+ tester.view.physicalSize = Size(width, 800);
+ await tester.pump();
+ await tester.tap(find.byKey(const ValueKey('pane-agent-control')));
+ await tester.pump();
+ final field = tester.widget<TextField>(
+ find.byKey(const ValueKey('swarm-search-input')),
+ );
+ expect(field.controller!.text.trim(), '&');
+ expect(find.text('OpenCode'), findsWidgets);
+ await tester.sendKeyEvent(LogicalKeyboardKey.escape);
+ await tester.pump();
+ expect(find.byKey(const ValueKey('swarm-search-input')), findsNothing);
+ expect(app.panes.single, same(pane));
+ expect(frames, isEmpty);
+ expect(tester.takeException(), isNull);
+ }
await tester.pumpWidget(const SizedBox());
app.dispose();
},
diff --git a/desktop/test/grid_model_picker_test.dart b/desktop/test/grid_model_picker_test.dart
index 7c8e308d5..1e9663e14 100644
--- a/desktop/test/grid_model_picker_test.dart
+++ b/desktop/test/grid_model_picker_test.dart
@@ -5,6 +5,7 @@ import 'dart:async';
import 'package:harness/shared/theme/app_icons.dart';
import 'package:flutter/material.dart';
import 'package:flutter/gestures.dart';
+import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
import 'package:harness/shared/theme/workspace_bar_style.dart';
import 'package:harness/widgets/transient_menus.dart';
@@ -81,6 +82,7 @@ class _DelayedConn extends _Conn {
_DelayedConn() : super([]);
final reply = Completer<Map<String, dynamic>>();
int reads = 0;
+ bool readDuringBuild = false;
@override
Future<Map<String, dynamic>> request(
String type, {
@@ -88,6 +90,9 @@ class _DelayedConn extends _Conn {
Duration timeout = const Duration(seconds: 20),
}) {
reads++;
+ readDuringBuild |=
+ SchedulerBinding.instance.schedulerPhase ==
+ SchedulerPhase.persistentCallbacks;
return reply.future;
}
}
@@ -151,6 +156,11 @@ void main() {
await tester.tap(find.byType(GridModelPicker));
await tester.pump();
expect(connection.reads, 1);
+ expect(
+ connection.readDuringBuild,
+ isFalse,
+ reason: 'model warm-up also notifies the workspace subscription footer',
+ );
await mount(false);
connection.reply.complete({'models': [], 'gridName': null});
await tester.pumpAndSettle();
@@ -242,7 +252,7 @@ void main() {
await mount(true);
expect(
tester.widget<Tooltip>(find.byType(Tooltip)).message,
- 'a-very-long-local-model-name\nSwitch model · Subscription or local models',
+ 'a-very-long-local-model-name\nChange model · Subscription or local models',
);
await tester.tap(find.byType(GridModelPicker));
await tester.pumpAndSettle();
@@ -276,6 +286,7 @@ void main() {
);
await mount('GPT-6 Astra');
expect(find.text('GPT-6 Astra'), findsOneWidget);
+ final restingStyle = tester.widget<Text>(find.text('GPT-6 Astra')).style!;
final hover = await tester.createGesture(kind: PointerDeviceKind.mouse);
await hover.addPointer(location: Offset.zero);
addTearDown(hover.removePointer);
@@ -283,7 +294,7 @@ void main() {
await tester.pump(const Duration(seconds: 1));
await tester.pump(const Duration(milliseconds: 200));
expect(
- find.text('Switch model · Subscription or local models'),
+ find.text('Change model · Subscription or local models'),
findsOneWidget,
);
final control = find.byType(WorkspaceBarControl);
@@ -305,7 +316,11 @@ void main() {
);
expect(
tester.widget<Text>(find.text('GPT-6 Astra')).style!.fontWeight,
- FontWeight.bold,
+ FontWeight.normal,
+ );
+ expect(
+ tester.widget<Text>(find.text('GPT-6 Astra')).style!.color!.a,
+ greaterThan(restingStyle.color!.a),
);
expect(tester.getSize(control).height, 28);
await hover.moveTo(Offset.zero);
diff --git a/desktop/test/pane_drag_swap_test.dart b/desktop/test/pane_drag_swap_test.dart
index 6ccf6027c..88fe8b944 100644
--- a/desktop/test/pane_drag_swap_test.dart
+++ b/desktop/test/pane_drag_swap_test.dart
@@ -91,6 +91,12 @@ void main() {
}
// The drop target lights up while the pane is carried over it.
expect(find.text('Swap with this pane'), findsOneWidget);
+ for (final direction in ['right', 'down']) {
+ expect(
+ find.byKey(ValueKey('pane-split-$direction')).hitTestable(),
+ findsNothing,
+ );
+ }
await gesture.up();
await tester.pumpAndSettle();
diff --git a/desktop/test/swarm_split_test.dart b/desktop/test/swarm_split_test.dart
index 98ede2b2c..000ab97d3 100644
--- a/desktop/test/swarm_split_test.dart
+++ b/desktop/test/swarm_split_test.dart
@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:harness/core/models.dart';
+import 'package:harness/shared/theme/app_pane_icon.dart';
import 'package:harness/state/new_harness.dart';
import 'package:harness/state/pane_arrangement.dart';
import 'package:harness/state/pane_preset.dart';
@@ -278,7 +279,7 @@ void main() {
}
testWidgets(
- 'focusing a pane then splitting $direction keeps its project and terminal',
+ 'hovering the $direction edge splits with its project and keeps the terminal',
(tester) async {
final (app, connection) = _splitApp();
final frames = <TerminalBinaryFrame>[];
@@ -296,20 +297,46 @@ void main() {
matching: find.byType(TerminalView),
);
final retained = tester.element(view);
- expect(find.byKey(ValueKey('pane-split-$direction')), findsNothing);
- final title = find.descendant(
+ final splitButton = find.descendant(
of: target,
- matching: find.byKey(const ValueKey('terminal-pane-title')),
+ matching: find.byKey(ValueKey('pane-split-$direction')),
);
+ expect(splitButton.hitTestable(), findsNothing);
final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);
await mouse.addPointer(location: rect.center);
- await mouse.moveTo(tester.getCenter(title));
- await tester.pump();
+ final edge = axis == PaneResizeAxis.x
+ ? Offset(rect.right - 2, rect.center.dy)
+ : Offset(rect.center.dx, rect.bottom - 2);
+ await mouse.moveTo(edge);
+ await tester.pump(const Duration(milliseconds: 150));
+ expect(splitButton.hitTestable(), findsOneWidget);
+ expect(
+ tester
+ .widget<AppPaneIcon>(
+ find.descendant(
+ of: splitButton,
+ matching: find.byType(AppPaneIcon),
+ ),
+ )
+ .symbol,
+ axis == PaneResizeAxis.x
+ ? AppPaneSymbol.splitRight
+ : AppPaneSymbol.splitDown,
+ );
expect(app.focusedPaneId, neighbor.id);
expect(tester.element(view), same(retained));
expect(tester.getRect(target), rect);
- await tester.tap(title);
- await chord(tester, shortcut);
+ expect(frames, isEmpty);
+ await mouse.moveTo(rect.center);
+ await tester.pump(const Duration(milliseconds: 150));
+ expect(splitButton.hitTestable(), findsNothing);
+ await mouse.moveTo(edge);
+ await tester.pump(const Duration(milliseconds: 150));
+ await mouse.moveTo(tester.getCenter(splitButton));
+ await tester.pump();
+ expect(splitButton.hitTestable(), findsOneWidget);
+ await mouse.down(tester.getCenter(splitButton));
+ await mouse.up();
await tester.pump();
expect(_form(tester).split?.paneId, first.id);
expect(_form(tester).engine, 'claude');
@@ -362,15 +389,24 @@ void main() {
final view = find.descendant(of: pane, matching: find.byType(TerminalView));
final retained = tester.element(view);
final rect = tester.getRect(pane);
- expect(find.byKey(const ValueKey('pane-zoom')), findsNothing);
app.focusPane(first.id);
+ await tester.pump();
await chord(tester, LogicalKeyboardKey.enter);
await tester.pump();
expect(app.focusedPaneId, first.id);
expect(app.zoomedPaneId, first.id);
expect(tester.element(view), same(retained));
expect(tester.getSize(pane).width, greaterThan(rect.width));
- expect(find.byKey(const ValueKey('pane-split-right')), findsNothing);
+ final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);
+ final zoomed = tester.getRect(pane);
+ await mouse.addPointer(location: zoomed.center);
+ await mouse.moveTo(Offset(zoomed.right - 2, zoomed.center.dy));
+ await tester.pump(const Duration(milliseconds: 150));
+ expect(
+ find.byKey(const ValueKey('pane-split-right')).hitTestable(),
+ findsNothing,
+ );
+ expect(find.byKey(const ValueKey('pane-zoom')), findsNothing);
await chord(tester, LogicalKeyboardKey.keyR);
await tester.pump();
expect(find.byType(NewHarnessForm), findsNothing);
@@ -387,6 +423,7 @@ void main() {
await tester.pump();
expect(app.panes, [neighbor]);
expect(neighbor.session, isNotNull);
+ await mouse.removePointer();
await tester.pumpWidget(const SizedBox());
app.dispose();
});
diff --git a/desktop/test/terminal_panel_header_test.dart b/desktop/test/terminal_panel_header_test.dart
index 254d5f089..5b2bcfdd3 100644
--- a/desktop/test/terminal_panel_header_test.dart
+++ b/desktop/test/terminal_panel_header_test.dart
@@ -173,7 +173,7 @@ void main() {
);
expect(rect.right, closeTo(agent.left, 1));
expect(agent.right, closeTo(model.left, 1));
- expect(model.right, closeTo(controls.first.left, 1));
+ expect(model.right + 8, closeTo(controls.first.left, 1));
for (var i = 1; i < controls.length; i++) {
expect(controls[i - 1].right, closeTo(controls[i].left, 1));
}
diff --git a/desktop/test/workspace_status_test.dart b/desktop/test/workspace_status_test.dart
index ce305981f..48f905b9e 100644
--- a/desktop/test/workspace_status_test.dart
+++ b/desktop/test/workspace_status_test.dart
@@ -27,6 +27,7 @@ import 'package:harness/terminal/terminal_text.dart';
import 'package:xterm/xterm.dart' show TerminalStyle;
import 'package:harness/widgets/grid_model_picker.dart';
import 'package:harness/widgets/workspace_bar_control.dart';
+import 'package:harness/widgets/pane_header_text_button.dart';
import 'package:harness/widgets/terminal_panel.dart';
import 'package:harness/widgets/agent_drag.dart';
import 'package:harness/widgets/status_line.dart';
@@ -227,10 +228,40 @@ void main() {
await tester.pump(const Duration(milliseconds: 100));
for (final pane in app.panes) {
final cell = find.byKey(pane.cellKey);
+ final selectors = find.descendant(
+ of: cell,
+ matching: find.byType(PaneHeaderTextButton),
+ );
+ expect(selectors, findsNWidgets(2));
+ final labels = tester
+ .widgetList<Text>(
+ find.descendant(of: selectors, matching: find.byType(Text)),
+ )
+ .toList();
+ for (final label in labels) {
+ expect(label.style!.fontFamily, labels.first.style!.fontFamily);
+ expect(label.style!.fontSize, 13);
+ expect(label.style!.fontWeight, FontWeight.normal);
+ expect(label.style!.height, labels.first.style!.height);
+ }
+ expect(labels[0].style!.fontWeight, FontWeight.normal);
+ expect(
+ find.descendant(of: selectors, matching: find.byType(Icon)),
+ findsNothing,
+ );
final controls = [
find.byKey(ValueKey(('pane-model', 'm', pane.agentId!))),
find.descendant(of: cell, matching: find.byType(PaneCloseButton)),
];
+ expect(find.byKey(const ValueKey('pane-zoom')), findsNothing);
+ for (final key in ['pane-split-down', 'pane-split-right']) {
+ expect(
+ find
+ .descendant(of: cell, matching: find.byKey(ValueKey(key)))
+ .hitTestable(),
+ findsNothing,
+ );
+ }
for (var i = 1; i < controls.length; i++) {
final previous = tester.getRect(controls[i - 1]);
final rect = tester.getRect(controls[i]);
@@ -245,6 +276,26 @@ void main() {
expect(tester.takeException(), isNull);
await tester.pump(const Duration(milliseconds: 100));
await captureControls(tester, 'pane-toolbar-$count-${brightness.name}');
+ final first = tester.getRect(find.byKey(app.panes.first.cellKey));
+ final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);
+ await mouse.addPointer(location: first.center);
+ for (final direction in ['right', 'down']) {
+ await mouse.moveTo(
+ direction == 'right'
+ ? Offset(first.right - 2, first.center.dy)
+ : Offset(first.center.dx, first.bottom - 2),
+ );
+ await tester.pump(const Duration(milliseconds: 150));
+ expect(
+ find.byKey(ValueKey('pane-split-$direction')).hitTestable(),
+ findsOneWidget,
+ );
+ await captureControls(
+ tester,
+ 'pane-edge-$direction-$count-${brightness.name}',
+ );
+ }
+ await mouse.removePointer();
await tester.pumpWidget(const SizedBox());
app.dispose();
});