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 to zoom, delete, and close controls

dee0359bbe1d6db
diff --git a/desktop/lib/screens/swarm_screen.dart b/desktop/lib/screens/swarm_screen.dart
index a03cd6360..e664c8910 100644
--- a/desktop/lib/screens/swarm_screen.dart
+++ b/desktop/lib/screens/swarm_screen.dart
@@ -1348,10 +1348,6 @@ class _SwarmScreenState extends State<SwarmScreen> {
child: PaneGrid(
notifier: app,
swarmMode: true,
- onSplit: (paneId, axis) {
- app.focusPane(paneId);
- unawaited(_splitAgent(axis));
- },
empty: SwarmWelcome(
key: ValueKey(app.activeSwarmId),
notifier: app,
diff --git a/desktop/lib/widgets/agent_drag.dart b/desktop/lib/widgets/agent_drag.dart
index 90ed48283..ed208c4ef 100644
--- a/desktop/lib/widgets/agent_drag.dart
+++ b/desktop/lib/widgets/agent_drag.dart
@@ -71,47 +71,6 @@ final agentDrag = ValueNotifier<AgentDragRef?>(null);
/// a pane drag offers the other tiles to trade places with.
final paneDragging = ValueNotifier<PaneDragRef?>(null);
-/// The one way out of a tile, in the one place every tile puts it.
-/// Hold this tile to its slot, or let it go.
-///
-/// Always present rather than revealed on hover: a control that only exists
-/// while the pointer is over it cannot be found by someone who does not already
-/// know it is there, and the whole point of the pin is to be reached for AFTER
-/// the grid has rearranged itself once and annoyed them. Muted until it is on,
-/// so the header of an unpinned tile stays quiet.
-class PanePinButton extends StatelessWidget {
- const PanePinButton({
- super.key,
- required this.pinned,
- required this.onPressed,
- });
-
- final bool pinned;
- final VoidCallback onPressed;
-
- @override
- Widget build(BuildContext context) {
- grid.AppTheme.watch(context);
- return Tooltip(
- message: pinned
- ? 'Pinned to this slot — click to release'
- : 'Pin to this slot',
- child: IconButton(
- onPressed: onPressed,
- icon: Icon(
- pinned ? Icons.push_pin : Icons.push_pin_outlined,
- size: 14,
- color: pinned ? AppColors.accent : AppColors.muted,
- ),
- splashRadius: 13,
- constraints: const BoxConstraints.tightFor(width: 26, height: 26),
- padding: EdgeInsets.zero,
- visualDensity: VisualDensity.compact,
- ),
- );
- }
-}
-
class PaneCloseButton extends StatelessWidget {
const PaneCloseButton({super.key, required this.onPressed});
diff --git a/desktop/lib/widgets/delete_agent_dialog.dart b/desktop/lib/widgets/delete_agent_dialog.dart
index 2db83f701..02adb865b 100644
--- a/desktop/lib/widgets/delete_agent_dialog.dart
+++ b/desktop/lib/widgets/delete_agent_dialog.dart
@@ -5,7 +5,7 @@ import '../shared/widgets/app_dialog.dart';
import '../state/app_state.dart';
/// The one "Delete agent" confirmation, opened from every place an agent can
-/// be deleted: the rail's row menu and the pane's ⋯ menu.
+/// be deleted: the rail's row menu and the pane's delete button.
///
/// Pulled out of the rail for the reason the rename dialog was: two copies
/// would have been two wordings of one irreversible act, and two ways of
diff --git a/desktop/lib/widgets/pane_actions_menu.dart b/desktop/lib/widgets/pane_actions_menu.dart
deleted file mode 100644
index 24f4e5236..000000000
--- a/desktop/lib/widgets/pane_actions_menu.dart
+++ /dev/null
@@ -1,101 +0,0 @@
-import 'package:flutter/material.dart';
-
-import '../shared/theme/app_theme.dart' as grid;
-import '../shared/widgets/app_menu.dart';
-
-class PaneActionsMenu extends StatefulWidget {
- const PaneActionsMenu({
- super.key,
- required this.name,
- this.onSplitRight,
- this.onSplitDown,
- this.onTogglePin,
- this.onToggleComposer,
- this.onClose,
- this.onDelete,
- this.pinned = false,
- this.composerVisible = false,
- });
- final String name;
- final VoidCallback? onSplitRight,
- onSplitDown,
- onTogglePin,
- onToggleComposer,
- onClose,
- onDelete;
- final bool pinned, composerVisible;
- @override
- State<PaneActionsMenu> createState() => _PaneActionsMenuState();
-}
-
-class _PaneActionsMenuState extends State<PaneActionsMenu> {
- final _menu = MenuController();
- Widget _action(String label, IconData icon, VoidCallback callback) =>
- AppMenuItem(
- label: label,
- icon: icon,
- onPressed: () {
- _menu.close();
- callback();
- },
- );
-
- @override
- Widget build(BuildContext context) => MenuAnchor(
- controller: _menu,
- style: grid.AppMenu.style(minWidth: 220),
- menuChildren: [
- if (widget.onSplitRight != null)
- _action(
- 'Split right',
- Icons.vertical_split_outlined,
- widget.onSplitRight!,
- ),
- if (widget.onSplitDown != null)
- _action(
- 'Split down',
- Icons.horizontal_split_outlined,
- widget.onSplitDown!,
- ),
- if (widget.onSplitRight != null || widget.onSplitDown != null)
- const AppMenuDivider(),
- if (widget.onTogglePin != null)
- _action(
- widget.pinned ? 'Unpin agent' : 'Pin agent',
- Icons.push_pin_outlined,
- widget.onTogglePin!,
- ),
- if (widget.onToggleComposer != null)
- _action(
- widget.composerVisible
- ? 'Hide message composer'
- : 'Show message composer',
- Icons.edit_note,
- widget.onToggleComposer!,
- ),
- if (widget.onClose != null)
- _action('Remove from swarm', Icons.close, widget.onClose!),
- // Removing a view keeps the agent running. Separate the destructive
- // agent operation with a divider and the danger colour.
- if (widget.onDelete != null) ...[
- const AppMenuDivider(),
- AppMenuItem(
- label: 'Delete agent',
- icon: Icons.delete_outline,
- danger: true,
- onPressed: () {
- _menu.close();
- widget.onDelete!();
- },
- ),
- ],
- ],
- builder: (_, menu, _) => IconButton(
- tooltip: 'Actions for ${widget.name}',
- onPressed: () => menu.isOpen ? menu.close() : menu.open(),
- icon: const Icon(Icons.more_horiz, size: 18),
- constraints: const BoxConstraints.tightFor(width: 28, height: 28),
- padding: EdgeInsets.zero,
- ),
- );
-}
diff --git a/desktop/lib/widgets/pane_grid.dart b/desktop/lib/widgets/pane_grid.dart
index 3ea01d8ce..89b5cd3f2 100644
--- a/desktop/lib/widgets/pane_grid.dart
+++ b/desktop/lib/widgets/pane_grid.dart
@@ -35,13 +35,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) {
@@ -53,7 +51,6 @@ class PaneGrid extends StatelessWidget {
notifier: notifier,
dragging: dragging,
empty: empty,
- onSplit: onSplit,
);
}
final panes = notifier.panes;
@@ -213,12 +210,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();
}
@@ -439,7 +434,6 @@ class _SwarmCanvasState extends State<_SwarmCanvas> {
dragging: widget.dragging,
visible: rectangles.containsKey(pane.id),
swarmMode: true,
- onSplit: widget.onSplit,
),
),
),
@@ -944,7 +938,6 @@ class _PaneCell extends StatelessWidget {
required this.dragging,
this.visible = true,
this.swarmMode = false,
- this.onSplit,
});
final AppNotifier notifier;
@@ -952,7 +945,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;
@@ -1060,7 +1052,6 @@ class _PaneCell extends StatelessWidget {
single: _single,
visible: visible,
swarmMode: swarmMode,
- onSplit: onSplit,
),
),
),
@@ -1080,7 +1071,6 @@ class _PaneContent extends StatelessWidget {
required this.single,
required this.visible,
required this.swarmMode,
- this.onSplit,
});
final AppNotifier notifier;
@@ -1088,7 +1078,6 @@ class _PaneContent extends StatelessWidget {
final bool single;
final bool visible;
final bool swarmMode;
- final void Function(int paneId, PaneResizeAxis axis)? onSplit;
@override
Widget build(BuildContext context) {
@@ -1181,21 +1170,14 @@ class _PaneContent extends StatelessWidget {
agent.id,
agent.name,
),
- pinned: notifier.isPanePinned(pane),
- onTogglePin: single ? null : () => notifier.togglePinPane(pane.id),
zoomed: notifier.zoomedPaneId == pane.id,
- onToggleZoom: swarmMode
+ onToggleZoom:
+ swarmMode && (!single || notifier.zoomedPaneId == pane.id)
? () {
notifier.focusPane(pane.id);
notifier.toggleZoomPane();
}
: null,
- onSplitRight: onSplit == null || !notifier.canAddPane
- ? null
- : () => onSplit!(pane.id, PaneResizeAxis.x),
- onSplitDown: onSplit == null || !notifier.canAddPane
- ? null
- : () => onSplit!(pane.id, PaneResizeAxis.y),
onRendererFocus: () => notifier.focusPane(pane.id),
paneDrag: single
? null
diff --git a/desktop/lib/widgets/pane_header_actions.dart b/desktop/lib/widgets/pane_header_actions.dart
new file mode 100644
index 000000000..eac50cec4
--- /dev/null
+++ b/desktop/lib/widgets/pane_header_actions.dart
@@ -0,0 +1,73 @@
+import 'package:flutter/material.dart';
+import 'package:lucide_icons_flutter/lucide_icons.dart';
+
+import '../shared/theme/app_theme.dart' as grid;
+import '../theme/app_theme.dart';
+
+/// Direct pane controls, in a stable order even when an action is unavailable.
+class PaneHeaderActions extends StatelessWidget {
+ const PaneHeaderActions({
+ super.key,
+ required this.name,
+ required this.zoomed,
+ this.onZoom,
+ this.onDelete,
+ this.onClose,
+ });
+
+ final String name;
+ final bool zoomed;
+ final VoidCallback? onZoom, onDelete, onClose;
+
+ @override
+ Widget build(BuildContext context) {
+ grid.AppTheme.watch(context);
+
+ Widget action(
+ String tooltip,
+ IconData icon,
+ VoidCallback? callback, {
+ bool destructive = false,
+ }) => IconButton(
+ tooltip: tooltip,
+ onPressed: callback,
+ icon: Icon(icon, size: 18),
+ style: ButtonStyle(
+ fixedSize: const WidgetStatePropertyAll(Size(28, 28)),
+ minimumSize: const WidgetStatePropertyAll(Size(28, 28)),
+ padding: const WidgetStatePropertyAll(EdgeInsets.zero),
+ tapTargetSize: MaterialTapTargetSize.shrinkWrap,
+ visualDensity: VisualDensity.standard,
+ shape: WidgetStatePropertyAll(
+ RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
+ ),
+ foregroundColor: WidgetStateProperty.resolveWith((states) {
+ if (states.contains(WidgetState.disabled)) {
+ return grid.AppPalette.textFaint;
+ }
+ if (states.contains(WidgetState.hovered) ||
+ states.contains(WidgetState.focused)) {
+ return destructive ? AppColors.danger : AppColors.text;
+ }
+ return AppColors.mutedStrong;
+ }),
+ overlayColor: WidgetStatePropertyAll(grid.AppSurface.hoverFill),
+ ),
+ );
+
+ return Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ action(
+ zoomed ? 'Restore agents' : 'Zoom $name',
+ zoomed ? LucideIcons.minimize : LucideIcons.maximize,
+ onZoom,
+ ),
+ const SizedBox(width: 2),
+ action('Delete agent', LucideIcons.trash2, onDelete, destructive: true),
+ const SizedBox(width: 2),
+ action('Close pane', LucideIcons.x, onClose),
+ ],
+ );
+ }
+}
diff --git a/desktop/lib/widgets/terminal_panel.dart b/desktop/lib/widgets/terminal_panel.dart
index 8279cfa3c..a59fb4838 100644
--- a/desktop/lib/widgets/terminal_panel.dart
+++ b/desktop/lib/widgets/terminal_panel.dart
@@ -31,7 +31,7 @@ import '../terminal/terminal_viewport.dart';
import '../shared/theme/app_theme.dart' as grid;
import '../theme/app_theme.dart';
import 'engine_identity.dart';
-import 'pane_actions_menu.dart';
+import 'pane_header_actions.dart';
/// The pane header's own horizontal inset.
const double _stripPadding = 14;
@@ -47,11 +47,7 @@ class TerminalPanel extends StatefulWidget {
final VoidCallback? onClose;
final VoidCallback? onDelete;
- /// Whether this tile keeps its slot when the grid moves under it, and the
- /// control that changes that. Null where there is no grid to hold a slot in.
- final bool pinned;
- final VoidCallback? onTogglePin;
- final VoidCallback? onToggleZoom, onSplitRight, onSplitDown;
+ final VoidCallback? onToggleZoom;
final bool zoomed;
/// This native terminal took the keyboard, so its grid tile becomes focused.
@@ -95,11 +91,7 @@ class TerminalPanel extends StatefulWidget {
this.onToggleComposer,
this.onClose,
this.onDelete,
- this.pinned = false,
- this.onTogglePin,
this.onToggleZoom,
- this.onSplitRight,
- this.onSplitDown,
this.zoomed = false,
this.onRendererFocus,
this.paneDrag,
@@ -1086,7 +1078,7 @@ class _TerminalPanelState extends State<TerminalPanel>
maintainSize: true,
maintainAnimation: true,
maintainState: true,
- child: _buildHeader(context, remote: remote),
+ child: _buildHeader(context),
),
if (_find != null)
Positioned.fill(
@@ -1257,14 +1249,12 @@ class _TerminalPanelState extends State<TerminalPanel>
/// Visibility and focus affect the renderer, not its title and controls.
/// Retain that subtree until its presentation changes. Callback wrappers
/// resolve the current widget so cached controls never retain an old action.
- Widget _buildHeader(BuildContext context, {required bool remote}) {
+ Widget _buildHeader(BuildContext context) {
final session = widget.session;
final machine = widget.notifier.stateOf(session.machineId);
final agent = machine?.agents
.where((a) => a.id == session.agentId)
.firstOrNull;
- final canToggleComposer =
- remote && !widget.readOnly && widget.onToggleComposer != null;
final presentation = (
theme: Theme.of(context),
brightness: grid.AppTheme.brightness.value,
@@ -1281,16 +1271,10 @@ class _TerminalPanelState extends State<TerminalPanel>
agent: agent,
project: agent == null ? null : machine?.projectOf(agent),
compact: widget.compactHeader,
- pinned: widget.pinned,
close: widget.onClose != null,
delete: widget.onDelete != null,
- pin: widget.onTogglePin != null,
zoomed: widget.zoomed,
zoom: widget.onToggleZoom != null,
- splitRight: widget.onSplitRight != null,
- splitDown: widget.onSplitDown != null,
- composer: canToggleComposer,
- composerVisible: widget.composerVisible,
dragId: widget.paneDrag?.ref.paneId,
dragSize: widget.paneDrag?.size,
);
@@ -1303,21 +1287,13 @@ class _TerminalPanelState extends State<TerminalPanel>
readOnly: widget.readOnly,
compact: widget.compactHeader,
zoomed: widget.zoomed,
- onToggleZoom: widget.onToggleZoom,
- onSplitRight: widget.onSplitRight,
- onSplitDown: widget.onSplitDown,
+ onToggleZoom: widget.onToggleZoom == null
+ ? null
+ : () => widget.onToggleZoom?.call(),
onClose: widget.onClose == null ? null : () => widget.onClose?.call(),
onDelete: widget.onDelete == null
? null
: () => widget.onDelete?.call(),
- pinned: widget.pinned,
- onTogglePin: widget.onTogglePin == null
- ? null
- : () => widget.onTogglePin?.call(),
- onToggleComposer: canToggleComposer
- ? () => widget.onToggleComposer?.call()
- : null,
- composerVisible: widget.composerVisible,
paneDrag: widget.paneDrag,
);
}
@@ -1335,13 +1311,9 @@ class _TerminalHeader extends StatelessWidget {
/// Ends the agent (with a confirmation), as the rail's row menu does. Null
/// where the pane cannot name a live agent to end.
final VoidCallback? onDelete;
- final bool pinned;
final bool compact;
- final VoidCallback? onTogglePin;
- final VoidCallback? onToggleZoom, onSplitRight, onSplitDown;
+ final VoidCallback? onToggleZoom;
final bool zoomed;
- final VoidCallback? onToggleComposer;
- final bool composerVisible;
/// This strip's drag gesture, or null when there is nothing to drag.
///
@@ -1360,15 +1332,9 @@ class _TerminalHeader extends StatelessWidget {
this.readOnly = false,
this.onClose,
this.onDelete,
- this.pinned = false,
this.compact = false,
- this.onTogglePin,
this.onToggleZoom,
- this.onSplitRight,
- this.onSplitDown,
this.zoomed = false,
- this.onToggleComposer,
- this.composerVisible = false,
this.paneDrag,
});
@@ -1484,7 +1450,10 @@ class _TerminalHeader extends StatelessWidget {
),
),
),
- if (compact && status == null && project?.branch != null) ...[
+ if (compact &&
+ constraints.maxWidth >= 360 &&
+ status == null &&
+ project?.branch != null) ...[
const SizedBox(width: 16),
Tooltip(
message: '${project!.branch}\n${project.cwd}',
@@ -1606,41 +1575,13 @@ class _TerminalHeader extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 2),
child: _LinkModeMark(mode: session.linkMode!),
),
- // Before the close button: pinning is the rarer act, and a control
- // that appears to the LEFT of the one people aim for by muscle
- // memory cannot shift it under their pointer.
- if (!compact && onTogglePin != null)
- PanePinButton(pinned: pinned, onPressed: onTogglePin!),
- if (compact) ...[
- if (onToggleZoom != null)
- IconButton(
- tooltip: zoomed
- ? 'Restore agents'
- : 'Zoom ${session.agentName}',
- onPressed: onToggleZoom,
- icon: Icon(
- zoomed ? Icons.fullscreen_exit : Icons.fullscreen,
- size: 18,
- ),
- constraints: const BoxConstraints.tightFor(
- width: 28,
- height: 28,
- ),
- padding: EdgeInsets.zero,
- ),
- PaneActionsMenu(
- name: session.agentName,
- onSplitRight: onSplitRight,
- onSplitDown: onSplitDown,
- onTogglePin: onTogglePin,
- pinned: pinned,
- onToggleComposer: onToggleComposer,
- composerVisible: composerVisible,
- onClose: onClose,
- onDelete: onDelete,
- ),
- ] else if (onClose != null)
- PaneCloseButton(onPressed: onClose!),
+ PaneHeaderActions(
+ name: session.agentName,
+ zoomed: zoomed,
+ onZoom: onToggleZoom,
+ onDelete: onDelete,
+ onClose: onClose,
+ ),
],
),
),
diff --git a/desktop/test/swarm_interactions_test.dart b/desktop/test/swarm_interactions_test.dart
index 00ce804ad..675222700 100644
--- a/desktop/test/swarm_interactions_test.dart
+++ b/desktop/test/swarm_interactions_test.dart
@@ -16,8 +16,8 @@ import 'package:harness/state/swarm_catalog.dart';
import 'package:harness/terminal/terminal_binary.dart';
import 'package:harness/widgets/codex_profile_field.dart';
import 'package:harness/widgets/new_agent_dialog.dart';
+import 'package:harness/widgets/pane_header_actions.dart';
import 'package:harness/widgets/swarm_dialogs.dart';
-import 'package:harness/widgets/terminal_composer.dart';
import 'package:harness/widgets/terminal_find_bar.dart';
import 'swarm_screen_test.dart' show mount, terminal;
@@ -121,24 +121,60 @@ void main() {
},
);
- testWidgets('a remote compact pane exposes its message composer', (
+ testWidgets('pane controls zoom, confirm deletion and close only this view', (
tester,
) async {
final app = createApp();
app.machineStates['m']!.nodeOnline = true;
- app.adoptSessionForTest(terminal('a0', []));
+ final input = <TerminalBinaryFrame>[];
+ final session = terminal('a0', input);
+ app.adoptSessionForTest(session);
+ final original = app.activeSwarm;
+ app.newSwarm();
+ await app.addAgentToSwarm('m', 'a0');
+ final pane = app.panes.single;
+ app.adoptSessionForTest(terminal('a1', []));
await mount(tester, app);
- expect(find.byType(TerminalComposer), findsNothing);
- await tester.tap(find.byTooltip('Actions for Session a0'));
+
+ final controls = find.byType(PaneHeaderActions).first;
+ expect(
+ find.descendant(of: controls, matching: find.byType(IconButton)),
+ findsNWidgets(3),
+ );
+ await tester.tap(find.byTooltip('Zoom Session a0'));
await tester.pump();
- await tester.tap(find.text('Show message composer'));
+ expect(app.zoomedPaneId, pane.id);
+ await tester.tap(find.byTooltip('Restore agents'));
await tester.pump();
- expect(find.byType(TerminalComposer), findsOneWidget);
- await tester.tap(find.byTooltip('Actions for Session a0'));
+ expect(app.zoomedPaneId, isNull);
+
+ await tester.tap(
+ find.descendant(of: controls, matching: find.byTooltip('Delete agent')),
+ );
+ await tester.pumpAndSettle();
+ expect(find.text('Delete agent'), findsOneWidget);
+ expect(app.panes, contains(pane));
+ expect(original.panes.single.session, same(session));
+ await tester.tap(find.text('Cancel'));
+ await tester.pumpAndSettle();
+ expect(app.panes, contains(pane));
+
+ await tester.tap(
+ find.descendant(of: controls, matching: find.byTooltip('Close pane')),
+ );
await tester.pump();
- await tester.tap(find.text('Hide message composer'));
+ expect(app.panes.single.agentId, 'a1');
+ expect(original.panes.single.session, same(session));
+ app.selectSwarm(original.id);
await tester.pump();
- expect(find.byType(TerminalComposer), findsNothing);
+ tester.testTextInput.enterText('x');
+ await tester.pump(const Duration(milliseconds: 20));
+ expect(
+ String.fromCharCodes(
+ input.where((f) => f.kind == TerminalBinaryKind.input).single.bytes,
+ ),
+ 'x',
+ );
await tester.pumpWidget(const SizedBox());
app.dispose();
});
diff --git a/desktop/test/terminal_panel_presentation_test.dart b/desktop/test/terminal_panel_presentation_test.dart
index 5e9161baa..9766f2c6d 100644
--- a/desktop/test/terminal_panel_presentation_test.dart
+++ b/desktop/test/terminal_panel_presentation_test.dart
@@ -15,6 +15,8 @@ void main() {
final session = terminal('a0', []);
final revision = ValueNotifier(0);
final closed = <int>[];
+ final deleted = <int>[];
+ final zoomed = <int>[];
tester.view.devicePixelRatio = 1;
tester.view.physicalSize = const Size(1100, 700);
addTearDown(tester.view.reset);
@@ -28,6 +30,9 @@ void main() {
focused: version.isEven,
compactHeader: true,
onClose: () => closed.add(version),
+ onDelete: () => deleted.add(version),
+ onToggleZoom: () => zoomed.add(version),
+ zoomed: version >= 2,
),
),
),
@@ -35,11 +40,13 @@ void main() {
await tester.pump();
revision.value = 1;
await tester.pump();
- await tester.tap(find.byTooltip('Actions for ${session.agentName}'));
- await tester.pump();
- await tester.tap(find.text('Remove from swarm'));
+ await tester.tap(find.byTooltip('Zoom ${session.agentName}'));
+ await tester.tap(find.byTooltip('Delete agent'));
+ await tester.tap(find.byTooltip('Close pane'));
await tester.pump();
expect(closed, [1]);
+ expect(deleted, [1]);
+ expect(zoomed, [1]);
session.agentName = 'Renamed terminal';
app.machineStates['m']!.agents = [
const Agent(
@@ -59,6 +66,7 @@ void main() {
expect(find.text('Renamed terminal'), findsOneWidget);
expect(find.text('fast-focus'), findsOneWidget);
expect(find.byTooltip('fast-focus\n/work/terminal'), findsOneWidget);
+ expect(find.byTooltip('Restore agents'), findsOneWidget);
session.status = TerminalSessionStatus.takenOver;
revision.value = 3;
await tester.pump();
diff --git a/docs/harness-v2-handoff.md b/docs/harness-v2-handoff.md
index 60cd225e9..f44f52780 100644
--- a/docs/harness-v2-handoff.md
+++ b/docs/harness-v2-handoff.md
@@ -3,8 +3,10 @@
Updated September 14, 2026. **Read this first when resuming on another computer.**
This is the current product contract and next-work order. It supersedes conflicting
historical checkpoints in [the progress log](harness-v2-progress.md). The user
-requested a portable checkpoint, then asked this session to resume building;
-the overall goal is still active and unfinished.
+requested a portable checkpoint and later paused the broader goal pending a
+breaking change. The goal remains unfinished and is currently blocked. The latest
+pane-header simplification is a separately authorized, bounded change; wait for
+the user's instruction before resuming the broader backlog.
**Latest priority:** the user explicitly deferred native benchmarking and further
performance optimization. Focus on completing the agreed features and usability
@@ -17,7 +19,13 @@ explicit Archive/Resume plus bulk cleanup, preserving ordinary view closure.
This is a proposal for discussion, not implemented behavior or authorization to
archive/delete existing user sessions.
-The existing close-view action is now consistently labeled **Remove from swarm**.
+Pane headers now have three direct outline icons, in order: **Zoom**, **Delete
+agent**, **Close pane**. The overflow menu, split actions and pin control are gone
+from the header. Delete opens the existing confirmation; Close removes only this
+view and keeps the agent running. The native/menu close-view action remains
+**Remove from swarm**. Narrow headers give the name priority over the branch
+label; the identity tooltip retains the branch and working folder.
+
History recovery also reuses a partially restored swarm: reopening an agent and
then its original swarm adds the missing views to the same tab, retaining newer
choices and live sessions. No runtime cleanup was introduced.
diff --git a/docs/harness-v2-progress.md b/docs/harness-v2-progress.md
index 56393452c..09b4166fb 100644
--- a/docs/harness-v2-progress.md
+++ b/docs/harness-v2-progress.md
@@ -6,6 +6,27 @@ Updated 2026-09-14 after integrating the continuation into main. This is a worki
## Continue directly on main
+- Simplified the pane header to three direct outline icons: Zoom, Delete agent,
+ Close pane. Removed the overflow menu and its split/pin controls. Delete still
+ opens the shared confirmation; closing a pane preserves the agent and its
+ views in other swarms. Controls keep a consistent size/order and support
+ tooltips, keyboard focus and hover states. Narrow panes prioritize the agent
+ name over inline branch metadata. The retained header resolves the current
+ callback for all three actions, including Zoom. The broader goal remains
+ paused/blocked pending the user's breaking-change details; this is a bounded
+ follow-up request, not a resumption of the backlog or benchmarking.
+ Forty-two focused workflow checks and one real-font render check pass (43
+ total), including confirmation/cancellation, shared-session input after close,
+ current callbacks, existing keyboard splits and terminal interactions. The
+ rendered header fits 280/430/720px panes at normal and 2× text. Analysis has
+ zero errors/warnings and 14 existing infos. Logs:
+ `/private/tmp/harness-pane-controls-final-tests.log`,
+ `/private/tmp/harness-pane-controls-analyze.log` and
+ `/private/tmp/harness-pane-controls-render.log`.
+ The normal arm64 Release build succeeds at
+ `/private/tmp/harness-pane-controls-release/Build/Products/Release/Harness.app`
+ (log: `/private/tmp/harness-pane-controls-release.log`); it was not launched.
+ Main preserves the team's `f6b9849` welcome-background change.
- Preserved Add while trying New agent. Cancel/Escape from centered Add or either
split returns to the same query, caret/selection, highlighted result and
checked agents. Find existing after an uncertain creation also retains those