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.

feat(desktop): reveal pane controls on hover and remove split overlays (#317)

Dee284ab0bbe31a
diff --git a/desktop/design/images/pane-controls-hover.png b/desktop/design/images/pane-controls-hover.png
new file mode 100644
index 000000000..95b3b68d7
Binary files /dev/null and b/desktop/design/images/pane-controls-hover.png differ
diff --git a/desktop/design/images/pane-controls-idle.png b/desktop/design/images/pane-controls-idle.png
new file mode 100644
index 000000000..18b281f93
Binary files /dev/null and b/desktop/design/images/pane-controls-idle.png differ
diff --git a/desktop/design/workspace-status-bar.md b/desktop/design/workspace-status-bar.md
index 88211f0b1..019d33426 100644
--- a/desktop/design/workspace-status-bar.md
+++ b/desktop/design/workspace-status-bar.md
@@ -40,8 +40,15 @@ to pane titles.
Keep three muted ASCII controls at the right of a harness pane: `-` closes only
that view, `[]` toggles zoom, and `x` stops the harness after confirmation. Each
control occupies two character columns. Use the terminal font and palette,
-plain text, and a subtle hover/focus fill. Retain descriptive tooltips and
-keyboard/accessibility labels; never rely on the symbols alone.
+plain text, and a subtle hover/focus fill. Reveal these controls only while the
+pointer is over that pane's top bar, or a control has keyboard focus. Hovering
+the terminal body does not reveal them. Reserve their columns while hidden so
+the title never shifts, and keep keyboard traversal available. Retain
+descriptive tooltips and accessibility labels; never rely on the symbols alone.
+
+Pane edges have no floating split buttons. Split Right and Split Down remain
+keyboard commands (Cmd-R and Cmd-D by default), with File menu and command-search
+access. Keep the resize gaps available for resizing.
Restart Harness and Share Harness belong in File. Fork remains available in
command search. Viewer and message-composer toggles belong in View and command
diff --git a/desktop/lib/screens/swarm_screen.dart b/desktop/lib/screens/swarm_screen.dart
index 165b7b9b4..27e56b76e 100644
--- a/desktop/lib/screens/swarm_screen.dart
+++ b/desktop/lib/screens/swarm_screen.dart
@@ -2214,10 +2214,9 @@ class _SwarmScreenState extends State<SwarmScreen>
}
}
- Future<void> _splitAgent(PaneResizeAxis axis, {int? paneId}) async {
- final split = app.preparePaneSplit(axis, paneId: paneId);
+ Future<void> _splitAgent(PaneResizeAxis axis) async {
+ final split = app.preparePaneSplit(axis);
if (split == null) return;
- if (paneId != null) app.focusPane(split.paneId);
_openSearch(adding: true, split: split);
}
@@ -3755,8 +3754,6 @@ class _SwarmScreenState extends State<SwarmScreen>
child: PaneGrid(
notifier: app,
swarmMode: true,
- onSplit: (paneId, axis) =>
- _splitAgent(axis, paneId: paneId),
empty:
app.panes.isEmpty &&
!app.activeSwarm.isStore &&
diff --git a/desktop/lib/widgets/pane_grid.dart b/desktop/lib/widgets/pane_grid.dart
index c46663577..a9bef20fb 100644
--- a/desktop/lib/widgets/pane_grid.dart
+++ b/desktop/lib/widgets/pane_grid.dart
@@ -35,7 +35,6 @@ import 'terminal_panel.dart';
import 'web_pane_panel.dart';
import 'pane_resize_handle.dart';
import 'box_chrome.dart';
-import 'pane_split_edges.dart';
import 'pane_minimize.dart';
/// Terminal views arranged by the chosen preset. Swarms keep each view under
@@ -46,13 +45,11 @@ class PaneGrid extends StatelessWidget {
required this.notifier,
this.swarmMode = false,
this.empty,
- this.onSplit,
});
final AppNotifier notifier;
final bool swarmMode;
final Widget? empty;
- final void Function(int paneId, PaneResizeAxis axis)? onSplit;
@override
Widget build(BuildContext context) {
@@ -65,7 +62,6 @@ class PaneGrid extends StatelessWidget {
notifier: notifier,
dragging: dragging,
empty: empty,
- onSplit: onSplit,
);
}
final panes = notifier.panes;
@@ -226,12 +222,10 @@ class _SwarmCanvas extends StatefulWidget {
required this.notifier,
required this.dragging,
this.empty,
- this.onSplit,
});
final AppNotifier notifier;
final AgentDragRef? dragging;
final Widget? empty;
- final void Function(int paneId, PaneResizeAxis axis)? onSplit;
@override
State<_SwarmCanvas> createState() => _SwarmCanvasState();
}
@@ -453,13 +447,6 @@ class _SwarmCanvasState extends State<_SwarmCanvas> {
single: app.panes.length == 1,
pinned: app.isPanePinned(pane),
zoomed: app.zoomedPaneId == pane.id,
- canSplit: app.canAddPane,
- splitRight:
- widget.onSplit != null &&
- app.preparePaneSplit(PaneResizeAxis.x, paneId: pane.id) != null,
- splitDown:
- widget.onSplit != null &&
- app.preparePaneSplit(PaneResizeAxis.y, paneId: pane.id) != null,
composer: pane.composerVisible,
blocked:
app.questionFor(pane.machineId, pane.agentId ?? session.agentId) !=
@@ -567,7 +554,6 @@ class _SwarmCanvasState extends State<_SwarmCanvas> {
dragging: widget.dragging,
visible: rectangles.containsKey(pane.id),
swarmMode: true,
- onSplit: widget.onSplit,
),
),
),
@@ -1160,7 +1146,6 @@ class _PaneCell extends StatelessWidget {
required this.dragging,
this.visible = true,
this.swarmMode = false,
- this.onSplit,
});
final AppNotifier notifier;
@@ -1168,7 +1153,6 @@ class _PaneCell extends StatelessWidget {
final AgentDragRef? dragging;
final bool visible;
final bool swarmMode;
- final void Function(int paneId, PaneResizeAxis axis)? onSplit;
bool get _single => notifier.panes.length == 1;
@@ -1200,108 +1184,77 @@ class _PaneCell extends StatelessWidget {
// step with the one the keyboard already went to.
behavior: HitTestBehavior.translucent,
onPointerDown: (_) => notifier.focusPane(pane.id),
- child: ValueListenableBuilder<PaneDragRef?>(
- valueListenable: paneDragging,
- builder: (context, inFlight, child) => onSplit == null
- ? child!
- : PaneSplitEdges(
- enabled:
- swarmMode &&
- visible &&
- agentId != null &&
- 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: onSplit == null
- ? null
- : (axis) => onSplit!(pane.id, axis),
- child: child!,
- ),
- child: Container(
- 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.
- color: 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(
- // A lone pane needs no focus distinction. Dialogs use this same
- // rim in its focused state while they own the keyboard.
- terminalPaneBorder(focused: !_single && focused),
- ),
+ child: Container(
+ 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.
+ color: 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(
+ // A lone pane needs no focus distinction. Dialogs use this same
+ // rim in its focused state while they own the keyboard.
+ terminalPaneBorder(focused: !_single && focused),
),
- // Attention, drawn OVER the terminal and inside the border above, so a
- // pane can carry both at once — this one is blocked AND focused is a
- // normal state, not a conflict to resolve. It is amber and 2px against
- // the border's 1px accent precisely so the two never read as each
- // other. Unlike focus, it shows on a single pane too: with one tile
- // there is nowhere else focus could be, but there is very much a
- // question waiting.
- foregroundDecoration: blocked
- ? BoxDecoration(
- border: Border.all(color: grid.AppPalette.warn, width: 2),
- borderRadius: BorderRadius.circular(_paneRadius),
- )
- : null,
- // 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(
+ ),
+ // Attention, drawn OVER the terminal and inside the border above, so a
+ // pane can carry both at once — this one is blocked AND focused is a
+ // normal state, not a conflict to resolve. It is amber and 2px against
+ // the border's 1px accent precisely so the two never read as each
+ // other. Unlike focus, it shows on a single pane too: with one tile
+ // there is nowhere else focus could be, but there is very much a
+ // question waiting.
+ foregroundDecoration: blocked
+ ? BoxDecoration(
+ border: Border.all(color: grid.AppPalette.warn, width: 2),
+ borderRadius: BorderRadius.circular(_paneRadius),
+ )
+ : null,
+ // 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,
+ child: _SwapZone(
notifier: notifier,
- pane: pane,
- child: _SwapZone(
+ paneId: pane.id,
+ child: _DropZone(
notifier: notifier,
paneId: pane.id,
- 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: _PaneContent(
- notifier: notifier,
- pane: pane,
- single: _single,
- visible: visible,
- swarmMode: swarmMode,
- ),
+ 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: _PaneContent(
+ notifier: notifier,
+ pane: pane,
+ single: _single,
+ visible: visible,
+ swarmMode: swarmMode,
),
),
),
diff --git a/desktop/lib/widgets/pane_header_actions.dart b/desktop/lib/widgets/pane_header_actions.dart
index e6d5a3da6..d3da08570 100644
--- a/desktop/lib/widgets/pane_header_actions.dart
+++ b/desktop/lib/widgets/pane_header_actions.dart
@@ -5,6 +5,41 @@ import '../terminal/terminal_text.dart';
import '../terminal/terminal_theme.dart';
import '../terminal/terminal_theme_store.dart';
+/// Reveals only this header's controls, not those of the whole pane or grid.
+class PaneHeaderHover extends StatefulWidget {
+ const PaneHeaderHover({super.key, required this.child});
+
+ final Widget child;
+
+ @override
+ State<PaneHeaderHover> createState() => _PaneHeaderHoverState();
+}
+
+class _PaneHeaderHoverState extends State<PaneHeaderHover> {
+ bool _hovered = false;
+
+ void _hover(bool value) {
+ if (_hovered != value) setState(() => _hovered = value);
+ }
+
+ @override
+ Widget build(BuildContext context) => MouseRegion(
+ onEnter: (_) => _hover(true),
+ onExit: (_) => _hover(false),
+ child: _PaneHeaderHoverScope(hovered: _hovered, child: widget.child),
+ );
+}
+
+class _PaneHeaderHoverScope extends InheritedWidget {
+ const _PaneHeaderHoverScope({required this.hovered, required super.child});
+
+ final bool hovered;
+
+ @override
+ bool updateShouldNotify(_PaneHeaderHoverScope oldWidget) =>
+ hovered != oldWidget.hovered;
+}
+
/// Three quiet terminal characters: close this view, zoom, and stop its harness.
class PaneHeaderActions extends StatelessWidget {
const PaneHeaderActions({
@@ -92,15 +127,59 @@ class PaneHeaderActions extends StatelessWidget {
],
),
),
- action('-', 'Close Pane', onClose),
- action(
- '[]',
- zoomed ? 'Restore Pane' : 'Zoom Pane',
- onZoom,
- toggled: zoomed,
+ _HoverControls(
+ child: Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ action('-', 'Close Pane', onClose),
+ action(
+ '[]',
+ zoomed ? 'Restore Pane' : 'Zoom Pane',
+ onZoom,
+ toggled: zoomed,
+ ),
+ action(
+ 'x',
+ terminal ? 'Stop Terminal' : 'Stop Harness',
+ onDelete,
+ ),
+ ],
+ ),
),
- action('x', terminal ? 'Stop Terminal' : 'Stop Harness', onDelete),
],
);
}
}
+
+class _HoverControls extends StatefulWidget {
+ const _HoverControls({required this.child});
+
+ final Widget child;
+
+ @override
+ State<_HoverControls> createState() => _HoverControlsState();
+}
+
+class _HoverControlsState extends State<_HoverControls> {
+ bool _focused = false;
+
+ @override
+ Widget build(BuildContext context) {
+ final header = context
+ .dependOnInheritedWidgetOfExactType<_PaneHeaderHoverScope>();
+ final visible = (header?.hovered ?? true) || _focused;
+ return Focus(
+ canRequestFocus: false,
+ onFocusChange: (focused) => setState(() => _focused = focused),
+ child: IgnorePointer(
+ ignoring: !visible,
+ child: Opacity(
+ key: const ValueKey('pane-header-controls'),
+ opacity: visible ? 1 : 0,
+ alwaysIncludeSemantics: true,
+ child: widget.child,
+ ),
+ ),
+ );
+ }
+}
diff --git a/desktop/lib/widgets/pane_split_edges.dart b/desktop/lib/widgets/pane_split_edges.dart
deleted file mode 100644
index 1b560693e..000000000
--- a/desktop/lib/widgets/pane_split_edges.dart
+++ /dev/null
@@ -1,177 +0,0 @@
-import 'package:flutter/gestures.dart';
-import 'package:flutter/material.dart';
-
-import '../shared/theme/app_theme.dart' as grid;
-import '../state/pane_arrangement.dart';
-import '../theme/app_theme.dart';
-import 'agent_action_icons.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;
- return IconButton(
- key: ValueKey('pane-split-$direction'),
- tooltip: available
- ? action
- : '$action: make this pane ${right ? 'wider' : 'taller'} to split $direction',
- onPressed: available && callback != null
- ? () {
- _reveal(null);
- callback(axis);
- }
- : null,
- icon: const Icon(AgentActionIcons.create, size: 18),
- style: IconButton.styleFrom(
- fixedSize: const Size.square(_buttonSize),
- minimumSize: const Size.square(_buttonSize),
- padding: EdgeInsets.zero,
- tapTargetSize: MaterialTapTargetSize.shrinkWrap,
- visualDensity: VisualDensity.standard,
- foregroundColor: grid.AppPalette.swarmAccent,
- 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 9dd15616d..7a1f533b4 100644
--- a/desktop/lib/widgets/terminal_panel.dart
+++ b/desktop/lib/widgets/terminal_panel.dart
@@ -1966,7 +1966,7 @@ class _TerminalHeader extends StatelessWidget {
// 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;
- final strip = SizedBox(
+ final header = SizedBox(
height: compact ? 38 : 46,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: _stripPadding),
@@ -2249,6 +2249,7 @@ class _TerminalHeader extends StatelessWidget {
),
),
);
+ final strip = PaneHeaderHover(child: header);
final handle = paneDrag;
if (handle == null) return strip;
diff --git a/desktop/test/pull_request_badge_test.dart b/desktop/test/pull_request_badge_test.dart
index 144e8f7a5..0ce279b3b 100644
--- a/desktop/test/pull_request_badge_test.dart
+++ b/desktop/test/pull_request_badge_test.dart
@@ -26,18 +26,21 @@ void main() {
home: Scaffold(
body: SizedBox(
width: 500,
- child: PaneHeaderActions(
- zoomed: false,
- onZoom: () {},
- details: const Text('branch-name'),
- trailing: PullRequestBadge(
- identity: 'branch',
- read: () async => {
- 'status': 'found',
- 'number': 12,
- 'state': 'Open',
- 'url': 'https://github.com/acme/repo/pull/12',
- },
+ height: 46,
+ child: PaneHeaderHover(
+ child: PaneHeaderActions(
+ zoomed: false,
+ onZoom: () {},
+ details: const Text('branch-name'),
+ trailing: PullRequestBadge(
+ identity: 'branch',
+ read: () async => {
+ 'status': 'found',
+ 'number': 12,
+ 'state': 'Open',
+ 'url': 'https://github.com/acme/repo/pull/12',
+ },
+ ),
),
),
),
@@ -45,6 +48,7 @@ void main() {
),
);
await tester.pump();
+ expect(find.byTooltip('Zoom Pane').hitTestable(), findsNothing);
final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);
await mouse.addPointer(location: Offset.zero);
await mouse.moveTo(tester.getCenter(find.text('PR #12 · Open')));
@@ -52,6 +56,11 @@ void main() {
expect(find.text('branch-name').hitTestable(), findsOneWidget);
expect(find.text('PR #12 · Open').hitTestable(), findsOneWidget);
expect(find.byTooltip('Zoom Pane').hitTestable(), findsOneWidget);
+ await mouse.moveTo(const Offset(600, 100));
+ await tester.pump();
+ expect(find.byTooltip('Zoom Pane').hitTestable(), findsNothing);
+ expect(find.text('branch-name').hitTestable(), findsOneWidget);
+ expect(find.text('PR #12 · Open').hitTestable(), findsOneWidget);
await mouse.removePointer();
await tester.pumpWidget(const SizedBox());
});
diff --git a/desktop/test/swarm_interactions_test.dart b/desktop/test/swarm_interactions_test.dart
index de3ca2081..def833c47 100644
--- a/desktop/test/swarm_interactions_test.dart
+++ b/desktop/test/swarm_interactions_test.dart
@@ -257,7 +257,7 @@ void main() {
.map((text) => text.data),
['-', '[]', 'x'],
);
- expect(find.byTooltip('Stop Harness').first.hitTestable(), findsOneWidget);
+ expect(find.byTooltip('Stop Harness').first.hitTestable(), findsNothing);
final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);
await mouse.addPointer(location: const Offset(1, 1));
Future<void> hover() async {
@@ -266,6 +266,7 @@ void main() {
}
await hover();
+ expect(find.byTooltip('Stop Harness').hitTestable(), findsOneWidget);
await tester.tap(find.byTooltip('Zoom Pane').first);
await tester.pump();
expect(app.zoomedPaneId, pane.id);
diff --git a/desktop/test/swarm_split_test.dart b/desktop/test/swarm_split_test.dart
index ba848eddd..5be9b2b6d 100644
--- a/desktop/test/swarm_split_test.dart
+++ b/desktop/test/swarm_split_test.dart
@@ -97,7 +97,7 @@ void main() {
of: find.byKey(target.cellKey),
matching: find.byKey(ValueKey('pane-split-$direction')),
);
- expect(tester.widget<IconButton>(button).onPressed, isNotNull);
+ expect(button, findsNothing);
final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);
final targetRect = tester.getRect(find.byKey(target.cellKey));
await mouse.addPointer(location: targetRect.center);
@@ -108,8 +108,13 @@ void main() {
);
await tester.pump();
await tester.pump(const Duration(milliseconds: 120));
- expect(button.hitTestable(), findsOneWidget);
- await tester.tap(button);
+ expect(button, findsNothing);
+ await chord(
+ tester,
+ axis == PaneResizeAxis.x
+ ? LogicalKeyboardKey.keyR
+ : LogicalKeyboardKey.keyD,
+ );
await tester.pump();
expect(find.text(title), findsOneWidget);
await tester.sendKeyEvent(LogicalKeyboardKey.escape);
@@ -285,7 +290,7 @@ void main() {
}
testWidgets(
- 'edge + $direction targets that pane without disturbing its neighbor',
+ 'hovering the $direction edge stays quiet and the shortcut splits the focused pane',
(tester) async {
final app = createApp();
final machine = app.machineStates['m']!;
@@ -321,7 +326,7 @@ void main() {
of: target,
matching: find.byKey(ValueKey('pane-split-$direction')),
);
- expect(button.hitTestable(), findsNothing);
+ expect(button, findsNothing);
final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);
await mouse.addPointer(location: rect.center);
await mouse.moveTo(
@@ -330,19 +335,21 @@ void main() {
: Offset(rect.center.dx, rect.bottom - 2),
);
await tester.pump(const Duration(milliseconds: 120));
- expect(button.hitTestable(), findsOneWidget);
+ expect(button, findsNothing);
expect(app.focusedPaneId, neighbor.id);
expect(FocusManager.instance.primaryFocus, same(previousFocus));
expect(tester.element(view), same(retained));
expect(tester.getRect(target), rect);
expect(frames, isEmpty);
- // Moving from the border onto the inset button must keep it visible.
- await mouse.moveTo(tester.getCenter(button));
- await tester.pump();
- expect(button.hitTestable(), findsOneWidget);
- await mouse.down(tester.getCenter(button));
- await mouse.up();
+ await chord(tester, LogicalKeyboardKey.arrowLeft);
+ expect(app.focusedPaneId, first.id);
+ await chord(
+ tester,
+ axis == PaneResizeAxis.x
+ ? LogicalKeyboardKey.keyR
+ : LogicalKeyboardKey.keyD,
+ );
await tester.pump();
final search = find.byKey(const ValueKey('swarm-search-input'));
expect(search, findsOneWidget);
diff --git a/desktop/test/terminal_panel_presentation_test.dart b/desktop/test/terminal_panel_presentation_test.dart
index d074545f8..35e6bbf47 100644
--- a/desktop/test/terminal_panel_presentation_test.dart
+++ b/desktop/test/terminal_panel_presentation_test.dart
@@ -1,3 +1,5 @@
+import 'dart:ui' show PointerDeviceKind;
+
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
@@ -46,6 +48,11 @@ void main() {
await tester.pump();
revision.value = 1;
await tester.pump();
+ final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);
+ await mouse.addPointer(location: const Offset(1, 100));
+ await mouse.moveTo(tester.getCenter(find.byType(PaneHeaderActions)));
+ await tester.pump();
+ addTearDown(mouse.removePointer);
for (final label in ['Close Pane', 'Zoom Pane', 'Stop Harness']) {
await tester.tap(find.byTooltip(label));
await tester.pumpAndSettle();
@@ -196,7 +203,7 @@ void main() {
);
for (final local in [true, false]) {
testWidgets(
- '${local ? 'local' : 'remote'} compact header keeps three ASCII controls without repeating context or moving its title',
+ '${local ? 'local' : 'remote'} compact controls reveal on header hover without moving the title or terminal',
(tester) async {
final app = createApp();
app.stateOf('m')!.localOnly = local;
@@ -257,9 +264,28 @@ void main() {
.length,
3,
);
+ for (final label in ['Close Pane', 'Zoom Pane', 'Stop Harness']) {
+ expect(find.byTooltip(label).hitTestable(), findsNothing);
+ }
+ final controlsBounds = tester.getRect(controls);
+ final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);
+ await mouse.addPointer(location: const Offset(1, 100));
+ await mouse.moveTo(tester.getCenter(title));
+ await tester.pump();
for (final label in ['Close Pane', 'Zoom Pane', 'Stop Harness']) {
expect(find.byTooltip(label).hitTestable(), findsOneWidget);
}
+ expect(tester.getRect(title), titleBounds);
+ expect(tester.getRect(controls), controlsBounds);
+ await mouse.moveTo(tester.getCenter(find.byTooltip('Zoom Pane')));
+ await mouse.down(tester.getCenter(find.byTooltip('Zoom Pane')));
+ await mouse.up();
+ await tester.pump();
+ await mouse.moveTo(tester.getCenter(find.byType(TerminalView)));
+ await tester.pump();
+ for (final label in ['Close Pane', 'Zoom Pane', 'Stop Harness']) {
+ expect(find.byTooltip(label).hitTestable(), findsNothing);
+ }
expect(find.byTooltip('Share harness'), findsNothing);
expect(find.text('main'), findsNothing);
expect(tester.getRect(title), titleBounds);
@@ -271,6 +297,7 @@ void main() {
expect(titleStyle.fontFamily, terminalFontStore.value.fontFamily);
expect(titleStyle.fontSize, terminalFontStore.size);
expect(titleStyle.fontWeight, FontWeight.normal);
+ await mouse.removePointer();
await tester.pumpWidget(const SizedBox());
session.dispose();
app.dispose();
@@ -328,12 +355,12 @@ void main() {
expect(tester.takeException(), isNull);
final titleBefore = tester.getRect(title);
final zoom = find.byTooltip('Zoom Pane');
+ Focus.of(tester.element(find.text('[]'))).requestFocus();
+ await tester.pumpAndSettle();
expect(zoom.hitTestable(), findsOneWidget);
expect(find.byTooltip('Fork Harness'), findsNothing);
expect(find.byTooltip('Stop Harness').hitTestable(), findsOneWidget);
expect(tester.getRect(title), titleBefore);
- Focus.of(tester.element(find.text('[]'))).requestFocus();
- await tester.pump();
await tester.sendKeyEvent(LogicalKeyboardKey.space);
await tester.pumpAndSettle();
expect(zooms, [240.0, 280.0, 420.0].indexOf(width) + 1);