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.

Merge remote-tracking branch 'origin/main' into feat/web

Dev jacob1d1447dad3fc
diff --cc desktop/lib/screens/swarm_screen.dart
index 80eb19f97,b44159632..5f92e10f7
--- a/desktop/lib/screens/swarm_screen.dart
+++ b/desktop/lib/screens/swarm_screen.dart
@@@ -73,8 -73,6 +73,7 @@@ import '../widgets/harness_activity_mar
import '../widgets/workspace_status_line.dart';
import '../widgets/workspace_pull_request_label.dart';
import '../widgets/workspace_bar_control.dart';
- import '../widgets/workspace_tab_close.dart';
+import '../widgets/workspace_tab_scroller.dart';
import '../widgets/session_work_dialog.dart';
import '../widgets/web_download_button.dart';
import '../widgets/workspace_share_button.dart';
@@@ -95,9 -94,11 +95,12 @@@ import '../widgets/restart_agent_action
import '../widgets/new_agent_dialog.dart';
import '../widgets/box_chrome.dart';
import '../widgets/new_harness_form.dart';
+ import '../widgets/desktop_chrome.dart';
+ import '../widgets/desktop_search_panel.dart';
+ import '../widgets/desktop_workspace_tab.dart';
import '../widgets/open_harness_intent.dart';
import '../widgets/pane_grid.dart';
+import '../widgets/pane_share_badge.dart';
import '../widgets/remote_folder_picker.dart';
import '../widgets/shortcuts_sheet.dart';
import '../widgets/harness_customize_pane.dart';
@@@ -6302,97 -6434,102 +6436,113 @@@ class _SwarmScreenState extends State<S
child: Stack(
children: [
Positioned.fill(
- child: PaneOpacity(
- opacity: appearancePrefsStore
- .value
- .effectivePaneOpacity,
- child: PaneGrid(
- notifier: app,
- swarmMode: true,
- onOpenModels: _openPaneModels,
- companionViewer:
- _creatureEnabled && _zoo.loaded
- ? _companionViewer
- : null,
- soloFocused: _compact(context),
- empty:
- app.panes.isEmpty &&
- !app
- .activeSwarm
- .isUtility &&
- !app
- .activeSwarm
- .isOrchestrator
- ? newHarnessOpensInBox ||
- app
- .activeSwarm
- .isNewTabPage
- ? _startGuide()
- : HarnessStartPage(
- key: ValueKey(
- 'harness-start:${app.activeSwarmId}',
- ),
- focusNode:
- _startSearchFocus,
- createSearch: () => SwarmSearchController(
- app,
- _navigation.recent,
- projects: _projects,
- commands:
- _searchCommands,
- recentCommands: () =>
- _navigation
- .recentCommands,
- // The first box a new
- // person meets is the same
- // box: its placeholder
- // promises `?` and a way
- // to create, so it has them.
- modes: _searchModes,
- adding: true,
- offersCreate: true,
- placement:
- HarnessPlacement
- .currentTab,
- catalog:
- _searchCatalog,
- ),
- onNewTab: _newTab,
- onNewPane: () =>
- unawaited(
- _addAgent(
- query: '',
+ child: PaneShareStatus(
+ visible:
+ widget.chrome?.showsShareStatus ==
+ true,
- child: PaneGrid(
- notifier: app,
- swarmMode: true,
- soloFocused: _compact(context),
- empty:
- app.panes.isEmpty &&
- !app
- .activeSwarm
- .isUtility &&
- !app
- .activeSwarm
- .isOrchestrator
- ? newHarnessOpensInBox ||
- app
- .activeSwarm
- .isNewTabPage
- ? _startGuide()
- : HarnessStartPage(
- key: ValueKey(
- 'harness-start:${app.activeSwarmId}',
- ),
- focusNode:
- _startSearchFocus,
- createSearch: () => SwarmSearchController(
- app,
- _navigation.recent,
- projects: _projects,
- commands:
- _searchCommands,
- recentCommands: () =>
- _navigation
- .recentCommands,
- // The first box a new
- // person meets is the same
- // box: its placeholder
- // promises `?` and a way
- // to create, so it has them.
- modes: _searchModes,
- adding: true,
- offersCreate: true,
- placement:
- HarnessPlacement
- .currentTab,
- catalog:
- _searchCatalog,
- ),
- onNewTab: _newTab,
- onNewPane: () =>
- unawaited(
- _addAgent(
- query: '',
++ child: PaneOpacity(
++ opacity: appearancePrefsStore
++ .value
++ .effectivePaneOpacity,
++ child: PaneGrid(
++ notifier: app,
++ swarmMode: true,
++ onOpenModels: _openPaneModels,
++ companionViewer:
++ _creatureEnabled &&
++ _zoo.loaded
++ ? _companionViewer
++ : null,
++ soloFocused: _compact(context),
++ empty:
++ app.panes.isEmpty &&
++ !app
++ .activeSwarm
++ .isUtility &&
++ !app
++ .activeSwarm
++ .isOrchestrator
++ ? newHarnessOpensInBox ||
++ app
++ .activeSwarm
++ .isNewTabPage
++ ? _startGuide()
++ : HarnessStartPage(
++ key: ValueKey(
++ 'harness-start:${app.activeSwarmId}',
++ ),
++ focusNode:
++ _startSearchFocus,
++ createSearch: () => SwarmSearchController(
++ app,
++ _navigation
++ .recent,
++ projects:
++ _projects,
++ commands:
++ _searchCommands,
++ recentCommands: () =>
++ _navigation
++ .recentCommands,
++ // The first box a new
++ // person meets is the same
++ // box: its placeholder
++ // promises `?` and a way
++ // to create, so it has them.
++ modes:
++ _searchModes,
++ adding: true,
++ offersCreate:
++ true,
++ placement:
++ HarnessPlacement
++ .currentTab,
++ catalog:
++ _searchCatalog,
++ ),
++ onNewTab: _newTab,
++ onNewPane: () =>
++ unawaited(
++ _addAgent(
++ query: '',
++ ),
+ ),
- ),
- onCommands:
- _showSearchCommands,
- onQuickStart:
- _learning.offer
- ? _startQuickStart
- : null,
- onPractice:
- _practiceKeyboard,
- onNew: () => _newAgent(
- placement:
- HarnessPlacement
- .currentTab,
- ),
- onNewWithTask:
- (
- task,
- ) => _newAgent(
- task: task,
- placement:
- HarnessPlacement
- .currentTab,
- ),
- onStore: _openStore,
- onResourceSearch:
- (
- query,
- ) => _openSearch(
- adding: true,
- query: query,
- ),
- onChoose:
- _chooseStartSearch,
- )
- : null,
++ onCommands:
++ _showSearchCommands,
++ onQuickStart:
++ _learning.offer
++ ? _startQuickStart
++ : null,
++ onPractice:
++ _practiceKeyboard,
++ onNew: () => _newAgent(
++ placement:
++ HarnessPlacement
++ .currentTab,
++ ),
++ onNewWithTask:
++ (
++ task,
++ ) => _newAgent(
++ task: task,
++ placement:
++ HarnessPlacement
++ .currentTab,
+ ),
- ),
- onCommands:
- _showSearchCommands,
- onQuickStart:
- _learning.offer
- ? _startQuickStart
- : null,
- onPractice:
- _practiceKeyboard,
- onNew: () => _newAgent(
- placement:
- HarnessPlacement
- .currentTab,
- ),
- onNewWithTask:
- (
- task,
- ) => _newAgent(
- task: task,
- placement:
- HarnessPlacement
- .currentTab,
- ),
- onStore: _openStore,
- onResourceSearch:
- (
- query,
- ) => _openSearch(
- adding: true,
- query: query,
- ),
- onChoose:
- _chooseStartSearch,
- )
- : null,
++ onStore: _openStore,
++ onResourceSearch:
++ (query) =>
++ _openSearch(
++ adding:
++ true,
++ query:
++ query,
++ ),
++ onChoose:
++ _chooseStartSearch,
++ )
++ : null,
++ ),
),
),
),
@@@ -6852,181 -6930,117 +6949,123 @@@
width: leadingWidth,
child: chrome.leading(context, _workspaceCommands),
),
- SizedBox(
- width: tabsWidth,
- child: ReorderableListView.builder(
- scrollController: _tabScroll,
- itemExtentBuilder: (index, _) => _tabWidths[index],
- scrollDirection: Axis.horizontal,
- shrinkWrap: true,
- buildDefaultDragHandles: false,
- itemCount: shown.length,
- onReorderItem: (old, to) =>
- app.reorderSwarm(shown[old].id, to),
- itemBuilder: (context, index) {
- final swarm = shown[index];
- final selected = app.activeSwarmId == swarm.id;
- final activity = activities[index];
- final nameHint = workspaceTabTooltip(
- labels[index],
- swarm.name,
- clipped:
- DesktopWorkspaceTab.naturalWidth(
- context,
- labels[index],
+ _withTabArrows(
+ arrows,
+ color: theme.foreground,
+ child: SizedBox(
+ width: tabsWidth,
+ child: ReorderableListView.builder(
+ scrollController: _tabScroll,
+ itemExtentBuilder: (index, _) => _tabWidths[index],
+ scrollDirection: Axis.horizontal,
+ shrinkWrap: true,
+ buildDefaultDragHandles: false,
+ itemCount: shown.length,
+ onReorderItem: (old, to) =>
+ app.reorderSwarm(shown[old].id, to),
+ itemBuilder: (context, index) {
+ final swarm = shown[index];
+ final selected = app.activeSwarmId == swarm.id;
+ final activity = activities[index];
+ final nameHint = workspaceTabTooltip(
+ labels[index],
+ swarm.name,
+ clipped:
- workspaceBarTextSizeOf(
- context,
- labels[index],
- ).width +
- (activity == null ? 0 : cell.width * 2) >
- _tabWidths[index] - cell.width * 2,
++ DesktopWorkspaceTab.naturalWidth(
++ context,
++ labels[index],
++ shortcutHint: _keymap.hint(
++ 'swarm.select_${index + 1}',
++ ),
++ hasActivity: activity != null,
++ ) >
++ _tabWidths[index],
+ );
+ final tabHint = [
+ ?nameHint,
+ if (activity != null) activity.label,
+ ].join('\n');
+ return ReorderableDragStartListener(
+ key: ValueKey(swarm.id),
+ index: index,
+ child: Listener(
+ onPointerDown: (event) {
+ _middleDownTab = event.buttons == kTertiaryButton
+ ? swarm.id
+ : null;
+ },
+ onPointerUp: (event) {
+ final armed = _middleDownTab;
+ _middleDownTab = null;
+ if (armed == swarm.id) {
+ unawaited(app.closeSwarm(swarm.id));
+ }
+ },
- child: GestureDetector(
- onDoubleTap: () => _rename(swarm.id),
- child: Center(
- child: WorkspaceBarControl(
- label:
- '${labels[index]}: ${swarm.name}${activity == null ? '' : ', ${activity.label}'}',
- tooltip: tabHint.isEmpty ? null : tabHint,
- selectedBackground:
- grid.AppPalette.swarmWelcome,
- selected: selected,
- highlighted:
- selected &&
- app.tabStripFocused &&
- _tabStripFocus.hasPrimaryFocus,
- onPressed: _shortcutsEnabled
- ? () => app.selectSwarm(swarm.id)
- : null,
- builder: (context, emphasized) => SizedBox(
- height: double.infinity,
- child: Padding(
- padding: EdgeInsets.symmetric(
- horizontal: cell.width,
- ),
- child: _withTabClose(
- closeCells > 0,
- id: swarm.id,
- visible: selected || emphasized,
- color: theme.foreground,
- child: Center(
- child: activity == null
- ? Text(
- labels[index],
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- textAlign: TextAlign.center,
- style: workspaceBarTextStyle(
- color: theme.foreground,
- emphasized: emphasized,
- ),
- )
- : Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- Text(
- '${index + 1}:',
- style:
- workspaceBarTextStyle(
- color:
- theme.foreground,
- emphasized:
- emphasized,
- ),
- ),
- Flexible(
- child: Text(
- names[swarm.id]!,
- maxLines: 1,
- overflow:
- TextOverflow.ellipsis,
- style:
- workspaceBarTextStyle(
- color: theme
- .foreground,
- emphasized:
- emphasized,
- ),
- ),
- ),
- SizedBox(width: cell.width),
- ListenableBuilder(
- listenable: _tabScroll,
- builder: (context, _) {
- final left = _tabWidths
- .take(index)
- .fold(
- 0.0,
- (a, b) => a + b,
- );
- final offset =
- _tabScroll.hasClients
- ? _tabScroll.offset
- : 0.0;
- return ActivityMark(
- key: ValueKey(
- 'tab-activity:${swarm.id}',
- ),
- activity: activity,
- color: activityColor(
- activity,
- theme,
- color: prefs.color,
- ),
- emphasized: emphasized,
- tooltip: false,
- visible:
- left <
- offset +
- tabsWidth &&
- left + _tabWidths[index] >
- offset,
- );
- },
- ),
- ],
- ),
- ),
- ),
- ),
- ),
- ),
++ child: DesktopWorkspaceTab(
++ id: swarm.id,
++ onRename: () => _rename(swarm.id),
++ label: labels[index],
++ selected: selected,
++ showShortcuts: _tabShortcutHints,
+ shortcutHint: _keymap.hint(
+ 'swarm.select_${index + 1}',
),
- hasActivity: activity != null,
- ) >
- _tabWidths[index],
- );
- final tabHint = [
- ?nameHint,
- if (activity != null) activity.label,
- ].join('\n');
- return ReorderableDragStartListener(
- key: ValueKey(swarm.id),
- index: index,
- child: Listener(
- onPointerDown: (event) {
- _middleDownTab = event.buttons == kTertiaryButton
- ? swarm.id
- : null;
- },
- onPointerUp: (event) {
- final armed = _middleDownTab;
- _middleDownTab = null;
- if (armed == swarm.id) {
- unawaited(app.closeSwarm(swarm.id));
- }
- },
- child: DesktopWorkspaceTab(
- id: swarm.id,
- onRename: () => _rename(swarm.id),
- label: labels[index],
- selected: selected,
- showShortcuts: _tabShortcutHints,
- shortcutHint: _keymap.hint(
- 'swarm.select_${index + 1}',
++ tooltip: tabHint.isEmpty ? null : tabHint,
++ activityLabel: activity?.label,
++ highlighted:
++ selected &&
++ app.tabStripFocused &&
++ _tabStripFocus.hasPrimaryFocus,
++ onSelect: _shortcutsEnabled
++ ? () => app.selectSwarm(swarm.id)
++ : null,
++ onClose: _shortcutsEnabled
++ ? () => unawaited(app.closeSwarm(swarm.id))
++ : null,
++ activity: activity == null || activity.mark.isEmpty
++ ? null
++ : ListenableBuilder(
++ listenable: _tabScroll,
++ builder: (context, _) {
++ final left = _tabWidths
++ .take(index)
++ .fold(0.0, (a, b) => a + b);
++ final offset = _tabScroll.hasClients
++ ? _tabScroll.offset
++ : 0.0;
++ return ActivityMark(
++ key: ValueKey(
++ 'tab-activity:${swarm.id}',
++ ),
++ activity: activity,
++ color: activityColor(
++ activity,
++ theme,
++ color: prefs.color,
++ ),
++ emphasized: selected,
++ tooltip: false,
++ visible:
++ left < offset + tabsWidth &&
++ left + _tabWidths[index] > offset,
++ );
++ },
++ ),
),
- tooltip: tabHint.isEmpty ? null : tabHint,
- activityLabel: activity?.label,
- highlighted:
- selected &&
- app.tabStripFocused &&
- _tabStripFocus.hasPrimaryFocus,
- onSelect: _shortcutsEnabled
- ? () => app.selectSwarm(swarm.id)
- : null,
- onClose: _shortcutsEnabled
- ? () => unawaited(app.closeSwarm(swarm.id))
- : null,
- activity: activity == null || activity.mark.isEmpty
- ? null
- : ListenableBuilder(
- listenable: _tabScroll,
- builder: (context, _) {
- final left = _tabWidths
- .take(index)
- .fold(0.0, (a, b) => a + b);
- final offset = _tabScroll.hasClients
- ? _tabScroll.offset
- : 0.0;
- return ActivityMark(
- key: ValueKey('tab-activity:${swarm.id}'),
- activity: activity,
- color: activityColor(
- activity,
- theme,
- color: prefs.color,
- ),
- emphasized: selected,
- tooltip: false,
- visible:
- left < offset + tabsWidth &&
- left + _tabWidths[index] > offset,
- );
- },
- ),
),
- ),
- );
- },
+ );
+ },
+ ),
),
),
- _statusToolSymbol(
+ _statusToolIcon(
'new-tab',
- 'New Swarm',
+ 'New Tab',
_newTab,
- '+',
+ AppIcons.plus,
Size(cell.width * 3, toolHeight),
theme,
- tooltip: 'New Swarm ${_keymap.hint('swarm.new') ?? ''}',
+ tooltip: 'New Tab ${_keymap.hint('swarm.new') ?? ''}',
),
const Spacer(),
_searchButton(theme),
@@@ -7093,40 -7107,7 +7132,22 @@@
onPressed: _shortcutsEnabled ? _showNotificationInbox : null,
);
- /// A host's narrow bar (the web on a phone): its tab switcher in place of
- /// the tab list, and no Store button, which the host's menu already offers.
+ /// The tab list, inside the arrows' scroller whenever the host scrolls tabs
+ /// by mouse — drawn only while [arrows], the list overflowing.
+ Widget _withTabArrows(
+ bool arrows, {
+ required Color color,
+ required Widget child,
+ }) => widget.chrome?.scrollsTabsByArrows != true
+ ? child
+ : WorkspaceTabScroller(
+ controller: _tabScroll,
+ arrows: arrows,
+ color: color,
+ child: child,
+ );
+
- /// A tab's label, with a close mark when the host closes tabs by mouse.
- Widget _withTabClose(
- bool closes, {
- required String id,
- required bool visible,
- required Color color,
- required Widget child,
- }) => !closes
- ? child
- : WorkspaceTabCloseSlot(
- tabId: id,
- visible: visible,
- color: color,
- onClose: () => unawaited(app.closeSwarm(id)),
- child: child,
- );
-
+ /// A compact host uses a tab switcher instead of the tab list.
Widget _compactTabStrip(WorkspaceChrome chrome, TerminalTheme theme) =>
Builder(
builder: (context) {
diff --cc desktop/lib/state/workspace_chrome.dart
index 44b4ed0bc,2a0aea1ea..c63b2085b
--- a/desktop/lib/state/workspace_chrome.dart
+++ b/desktop/lib/state/workspace_chrome.dart
@@@ -45,9 -45,7 +45,8 @@@ class WorkspaceChrome
this.pickerBar,
this.showsKeyHints = true,
this.viewMachineCloses = false,
-- this.closesTabs = false,
+ this.showsShareStatus = false,
+ this.scrollsTabsByArrows = false,
this.compactTabs,
this.compactBelow = 0,
});
@@@ -71,15 -69,9 +70,11 @@@
/// picker; false keeps View scoping the picker to its harnesses.
final bool viewMachineCloses;
-- /// True puts a close mark on the selected and hovered tab, for a host with
-- /// no ⌘W menu to close one — an empty New Tab included.
-- final bool closesTabs;
-
+ /// True marks each shared harness's pane header Public or Private.
+ final bool showsShareStatus;
+
+ /// True puts arrows either side of a tab list too long for the bar.
+ final bool scrollsTabsByArrows;
/// Below [compactBelow] of window width the workspace goes compact: this
/// replaces the tab list (the Store button steps aside), and only the focused
diff --cc desktop/lib/web/shell/web_chrome.dart
index 1ca63470f,e0225984d..0a60d7ca6
--- a/desktop/lib/web/shell/web_chrome.dart
+++ b/desktop/lib/web/shell/web_chrome.dart
@@@ -18,9 -18,7 +18,8 @@@ WorkspaceChrome webWorkspaceChrome(AppN
pickerBar: (context, picker) => WebPickerBar(picker: picker),
showsKeyHints: false,
viewMachineCloses: true,
-- closesTabs: true,
+ showsShareStatus: true,
+ scrollsTabsByArrows: true,
compactTabs: (context, commands) =>
WebTabSwitcher(app: app, commands: commands),
compactBelow: kWebCompactBelow,
diff --cc desktop/lib/widgets/workspace_tab_close.dart
index 5cf8a4444,5cf8a4444..000000000
deleted file mode 100644,100644
--- a/desktop/lib/widgets/workspace_tab_close.dart
+++ /dev/null
@@@ -1,58 -1,58 +1,0 @@@
--import 'package:flutter/material.dart';
--import 'package:lucide_icons_flutter/lucide_icons.dart';
--
--import '../shared/theme/workspace_bar_style.dart';
--
--/// Cells a tab reserves for its close mark, so hovering never reflows the row.
--const int kWorkspaceTabCloseCells = 2;
--
--/// A tab's label with a close mark after it, for hosts that close tabs by
--/// mouse ([WorkspaceChrome.closesTabs]). The mark keeps its cells while
--/// hidden and only shows on the selected or hovered tab, as browser tabs do.
--class WorkspaceTabCloseSlot extends StatelessWidget {
-- const WorkspaceTabCloseSlot({
-- super.key,
-- required this.tabId,
-- required this.visible,
-- required this.color,
-- required this.onClose,
-- required this.child,
-- });
--
-- final String tabId;
-- final bool visible;
-- final Color color;
-- final VoidCallback onClose;
-- final Widget child;
--
-- @override
-- Widget build(BuildContext context) {
-- final width =
-- workspaceBarCellSizeOf(context).width * kWorkspaceTabCloseCells;
-- return Row(
-- children: [
-- Expanded(child: child),
-- SizedBox(
-- width: width,
-- child: !visible
-- ? null
-- : Tooltip(
-- message: 'Close tab',
-- waitDuration: const Duration(milliseconds: 700),
-- child: MouseRegion(
-- cursor: SystemMouseCursors.click,
-- // Inside the tab's own tap target: the innermost detector
-- // wins the tap, so this closes without selecting first.
-- child: GestureDetector(
-- key: ValueKey('tab-close:$tabId'),
-- behavior: HitTestBehavior.opaque,
-- onTap: onClose,
-- child: Icon(LucideIcons.x, size: 13, color: color),
-- ),
-- ),
-- ),
-- ),
-- ],
-- );
-- }
--}
diff --cc desktop/test/terminal_panel_header_test.dart
index c1fe7718d,338fab05f..46ae68eb9
--- a/desktop/test/terminal_panel_header_test.dart
+++ b/desktop/test/terminal_panel_header_test.dart
@@@ -9,9 -11,7 +11,8 @@@ import 'package:harness/core/models.dar
import 'package:harness/state/app_state.dart';
import 'package:harness/terminal/terminal_session.dart';
import 'package:harness/theme/app_theme.dart';
+import 'package:harness/widgets/pane_share_badge.dart';
import 'package:harness/widgets/terminal_panel.dart';
- import 'package:lucide_icons_flutter/lucide_icons.dart';
import 'support/real_fonts.dart';
@@@ -128,63 -120,6 +129,64 @@@ void main()
});
}
+ const publicShare = {
+ 'link': {'id': 'l1', 'visibility': 'public'},
+ 'shares': [],
+ };
+
+ // A workspace pane's header is compact: its right side's budget holds only
+ // the close button, and a status beside the name fills the name's row. The
+ // mark sits at the right edge either way.
+ for (final width in [420.0, 900.0]) {
+ for (final status in [
+ TerminalSessionStatus.controlling,
+ TerminalSessionStatus.takenOver,
+ ]) {
+ testWidgets(
+ 'a shared pane says so at the right edge, ${status.name}, width $width',
+ (tester) async {
+ final session = sessionNamed('Desktop')..status = status;
+ addTearDown(session.dispose);
+ await pump(
+ tester,
+ session,
+ width: width,
+ compactHeader: true,
+ showsShares: true,
+ share: publicShare,
+ );
+ final badge = find.byKey(const ValueKey('pane-share:local:agent-1'));
+ expect(badge, findsOneWidget);
+ final rect = tester.getRect(badge);
+ expect(rect.width, greaterThan(12));
+ expect(
+ rect.left,
+ greaterThan(tester.getRect(find.text('Desktop')).right),
+ );
- expect(rect.right, greaterThan(width - 40));
++ // Only the header's own right-side controls (the close icon) follow.
++ expect(rect.right, greaterThan(width - 100));
+ expect(rect.right, lessThanOrEqualTo(width));
+ if (width > 560) expect(find.text('Public'), findsOneWidget);
+ expect(tester.takeException(), isNull);
+ await tester.pumpWidget(const SizedBox());
+ },
+ );
+ }
+ }
+
+ testWidgets('without the web scope a shared pane shows no mark', (
+ tester,
+ ) async {
+ final session = sessionNamed('Desktop');
+ addTearDown(session.dispose);
+ await pump(tester, session, compactHeader: true, share: publicShare);
+ expect(
+ find.byKey(const ValueKey('pane-share:local:agent-1')),
+ findsNothing,
+ );
+ await tester.pumpWidget(const SizedBox());
+ });
+
// Each shape describes the path topology, not an assumed speed: direct link, intermediate hop,
// backend server. Tooltip and semantics use the protocol names people will diagnose with.
testWidgets(
diff --cc desktop/test/web/web_app_menu_test.dart
index cc4d8f666,1b7977a09..67d781824
--- a/desktop/test/web/web_app_menu_test.dart
+++ b/desktop/test/web/web_app_menu_test.dart
@@@ -146,6 -144,6 +146,14 @@@ void main()
final tabs = app.swarms.length;
final empty = app.activeSwarmId;
expect(app.activeSwarm.panes, isEmpty);
++ // The close mark shows under the mouse, as on desktop.
++ final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);
++ addTearDown(mouse.removePointer);
++ await mouse.addPointer(location: Offset.zero);
++ await mouse.moveTo(
++ tester.getCenter(find.byKey(ValueKey('tab-close:$empty'))),
++ );
++ await tester.pump(const Duration(milliseconds: 200));
await tester.tap(find.byKey(ValueKey('tab-close:$empty')));
// Past the tab's double-tap-to-rename window, which holds the tap.
await tester.pump(const Duration(milliseconds: 400));
@@@ -156,76 -154,6 +164,79 @@@
app.dispose();
});
+ testWidgets('tabs too many for the bar scroll by arrows and wheel', (
+ tester,
+ ) async {
+ final app = await _mount(tester);
+ expect(find.byKey(const ValueKey('tab-scroll-right')), findsNothing);
+ for (var i = 0; i < 24; i++) {
+ app.newSwarm(newTabPage: true);
+ }
+ await tester.pump(const Duration(milliseconds: 200));
+ // The arrows read the list's extent after it lays out: one more frame.
+ await tester.pump();
+ final left = find.byKey(const ValueKey('tab-scroll-left'));
+ final right = find.byKey(const ValueKey('tab-scroll-right'));
+ expect(left, findsOneWidget);
+ expect(right, findsOneWidget);
+ bool enabled(Finder arrow) =>
+ tester.widget<WorkspaceBarControl>(arrow).onPressed != null;
- // The newest tab is selected and revealed: the strip rests at its end.
- expect(enabled(left), isTrue);
- expect(enabled(right), isFalse);
- await tester.tap(left);
- await tester.pump(const Duration(milliseconds: 400));
- expect(enabled(right), isTrue);
-
- // A plain vertical wheel over the strip moves it sideways.
+ final scrollable = tester.state<ScrollableState>(
+ find
+ .descendant(
+ of: find.byKey(const ValueKey('workspace-tab-bar')),
+ matching: find.byType(Scrollable),
+ )
+ .first,
+ );
- final before = scrollable.position.pixels;
++
++ // A plain vertical wheel over the strip moves it sideways — here all the
++ // way back to the first tab, where the left arrow has nowhere to go.
+ await tester.sendEventToBinding(
+ PointerScrollEvent(
+ position: tester.getCenter(left) + const Offset(80, 0),
- scrollDelta: const Offset(0, -120),
++ scrollDelta: const Offset(0, -100000),
+ ),
+ );
+ await tester.pump();
- expect(scrollable.position.pixels, lessThan(before));
++ expect(scrollable.position.pixels, scrollable.position.minScrollExtent);
++ expect(enabled(left), isFalse);
++ expect(enabled(right), isTrue);
++
++ await tester.tap(right);
++ // One frame starts the page animation, the next lands it.
++ await tester.pump();
++ await tester.pump(const Duration(milliseconds: 400));
++ expect(scrollable.position.pixels, greaterThan(0));
++ expect(enabled(left), isTrue);
+ expect(tester.takeException(), isNull);
+ await tester.pumpWidget(const SizedBox.shrink());
+ app.dispose();
+ });
+
+ testWidgets('crossing into and out of overflow keeps one tab list', (
+ tester,
+ ) async {
+ final app = await _mount(tester);
+ for (var i = 0; i < 12; i++) {
+ app.newSwarm(newTabPage: true);
+ }
+ for (final width in [1800.0, 900.0, 1800.0, 700.0, 1280.0]) {
+ tester.view.physicalSize = Size(width, 800);
+ await tester.pump();
+ await tester.pump();
+ expect(tester.takeException(), isNull, reason: 'width $width');
+ }
+ while (app.swarms.length > 2) {
+ await app.closeSwarm(app.swarms.last.id);
+ await tester.pump();
+ await tester.pump();
+ expect(tester.takeException(), isNull, reason: '${app.swarms.length}');
+ }
+ await tester.pumpWidget(const SizedBox.shrink());
+ app.dispose();
+ });
+
testWidgets('keys still reach Settings beside the menu', (tester) async {
final app = await _mount(tester);
await tester.sendKeyDownEvent(LogicalKeyboardKey.altLeft);