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): attach files to a new harness, as the web does

Dev jacob27683bc554cc
diff --git a/desktop/lib/screens/swarm_screen.dart b/desktop/lib/screens/swarm_screen.dart
index 52b10ff57..10fa759da 100644
--- a/desktop/lib/screens/swarm_screen.dart
+++ b/desktop/lib/screens/swarm_screen.dart
@@ -2972,9 +2972,7 @@ class _SwarmScreenState extends State<SwarmScreen> {
swarmId: swarmId,
split: split,
placement: placement,
- attachments: widget.chrome?.attachesFiles == true
- ? HarnessAttachments(onDeliveryProblem: _showPaneActionHint)
- : null,
+ attachments: HarnessAttachments(onDeliveryProblem: _showPaneActionHint),
);
_newHarnessFormKey = GlobalKey<NewHarnessFormState>();
_newHarnessDevicePort = DeviceFormPort();
diff --git a/desktop/lib/state/workspace_chrome.dart b/desktop/lib/state/workspace_chrome.dart
index 85ed6eae3..88a94a69e 100644
--- a/desktop/lib/state/workspace_chrome.dart
+++ b/desktop/lib/state/workspace_chrome.dart
@@ -79,7 +79,6 @@ class WorkspaceChrome {
this.viewMachineCloses = false,
this.showsShareStatus = false,
this.scrollsTabsByArrows = false,
- this.attachesFiles = false,
this.compactTabs,
this.compactFooter,
this.compactBelow = 0,
@@ -110,9 +109,6 @@ class WorkspaceChrome {
/// True puts arrows either side of a tab list too long for the bar.
final bool scrollsTabsByArrows;
- /// True lets New Harness take files — a button and drops on its box.
- final bool attachesFiles;
-
/// Below [compactBelow] of window width the workspace goes compact: this
/// replaces the tab list (the Store button steps aside), and only the focused
/// harness is drawn — a phone has room for neither a tab row nor a grid.
diff --git a/desktop/lib/web/shell/web_chrome.dart b/desktop/lib/web/shell/web_chrome.dart
index c2d5f08dc..635cce188 100644
--- a/desktop/lib/web/shell/web_chrome.dart
+++ b/desktop/lib/web/shell/web_chrome.dart
@@ -21,7 +21,6 @@ WorkspaceChrome webWorkspaceChrome(AppNotifier app) => WorkspaceChrome(
viewMachineCloses: true,
showsShareStatus: true,
scrollsTabsByArrows: true,
- attachesFiles: true,
compactTabs: (context, commands) =>
WebTabSwitcher(app: app, commands: commands),
compactFooter: (context, footer) => WebFooterBar(footer: footer),
diff --git a/desktop/lib/widgets/new_harness_form.dart b/desktop/lib/widgets/new_harness_form.dart
index 946e3d083..9c761a117 100644
--- a/desktop/lib/widgets/new_harness_form.dart
+++ b/desktop/lib/widgets/new_harness_form.dart
@@ -1846,12 +1846,26 @@ class NewHarnessFormState extends State<NewHarnessForm> {
return Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
- NewHarnessAttachButton(attachments: attachments, enabled: !box.locked),
- const SizedBox(width: 6),
Expanded(
- child: NewHarnessAttachmentChips(
- attachments: attachments,
- enabled: !box.locked,
+ // Right after the task it sits under, so Start stays last.
+ child: FocusTraversalOrder(
+ order: const NumericFocusOrder(4.5),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.end,
+ children: [
+ NewHarnessAttachButton(
+ attachments: attachments,
+ enabled: !box.locked,
+ ),
+ const SizedBox(width: 6),
+ Expanded(
+ child: NewHarnessAttachmentChips(
+ attachments: attachments,
+ enabled: !box.locked,
+ ),
+ ),
+ ],
+ ),
),
),
const SizedBox(width: 12),
diff --git a/desktop/test/desktop_dialog_interaction_test.dart b/desktop/test/desktop_dialog_interaction_test.dart
index 9351ec09c..55c6e8971 100644
--- a/desktop/test/desktop_dialog_interaction_test.dart
+++ b/desktop/test/desktop_dialog_interaction_test.dart
@@ -248,6 +248,13 @@ void main({bool nativeSmoke = false}) {
expect(_ownsFocus(tester, _task), isTrue);
});
+ journey('the desktop box takes files: 📎 and drops', (tester) async {
+ await _mount(tester);
+ await _new(tester);
+ expect(find.byKey(const ValueKey('new-harness-attach')), findsOneWidget);
+ expect(find.byKey(const ValueKey('new-harness-drop')), findsOneWidget);
+ });
+
journey('Tab and Shift-Tab remain inside the composer and reach controls', (
tester,
) async {
diff --git a/desktop/test/web/web_app_menu_test.dart b/desktop/test/web/web_app_menu_test.dart
index ddf56a341..4f9c50e0c 100644
--- a/desktop/test/web/web_app_menu_test.dart
+++ b/desktop/test/web/web_app_menu_test.dart
@@ -86,7 +86,7 @@ void main() {
await tester.pump();
expect(find.byType(WorkspaceMachinePrompt), findsNothing);
expect(find.byType(NewHarnessForm), findsOneWidget);
- // The browser attaches files to a new harness; desktop's box has no 📎.
+ // A new harness takes files: 📎 and drops on its box.
expect(find.byKey(const ValueKey('new-harness-attach')), findsOneWidget);
expect(find.byKey(const ValueKey('new-harness-drop')), findsOneWidget);
expect(tester.takeException(), isNull);