From 486e9aa0a37074bf24c8f170a4562d2b32dd532f Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Wed, 11 Mar 2026 14:13:03 +0800 Subject: [PATCH] Move composer actions menu to the left --- lib/features/assistant/assistant_page.dart | 134 ++++++++++----------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/lib/features/assistant/assistant_page.dart b/lib/features/assistant/assistant_page.dart index a0df0256..37429950 100644 --- a/lib/features/assistant/assistant_page.dart +++ b/lib/features/assistant/assistant_page.dart @@ -678,6 +678,73 @@ class _ComposerBar extends StatelessWidget { child: Row( mainAxisSize: MainAxisSize.min, children: [ + PopupMenuButton( + tooltip: 'Composer actions', + offset: const Offset(0, -180), + onSelected: (value) { + switch (value) { + case 'attach': + onPickAttachments(); + break; + case 'plan': + onModeChanged(mode == 'Plan' ? 'Ask' : 'Plan'); + break; + case 'gateway': + onOpenGateway(); + break; + case 'route': + break; + } + }, + itemBuilder: (context) => [ + const PopupMenuItem( + value: 'attach', + child: ListTile( + contentPadding: EdgeInsets.zero, + leading: Icon(Icons.attach_file_rounded), + title: Text('添加照片和文件'), + ), + ), + PopupMenuItem( + value: 'plan', + child: ListTile( + contentPadding: EdgeInsets.zero, + leading: Icon( + mode == 'Plan' + ? Icons.task_alt_rounded + : Icons.alt_route_rounded, + ), + title: Text(mode == 'Plan' ? '退出计划模式' : '计划模式'), + ), + ), + PopupMenuItem( + value: 'gateway', + child: ListTile( + contentPadding: EdgeInsets.zero, + leading: Icon( + connected + ? Icons.lan_rounded + : Icons.link_rounded, + ), + title: const Text('连接网关'), + ), + ), + PopupMenuItem( + value: 'route', + child: ListTile( + contentPadding: EdgeInsets.zero, + leading: const Icon(Icons.hub_rounded), + title: Text( + autoAgentLabel ?? 'Browser / Coding / Research', + ), + ), + ), + ], + child: const _ComposerIconButton( + icon: Icons.add_rounded, + ), + ), + const SizedBox(width: 8), PopupMenuButton( tooltip: 'Execution target', onSelected: (value) { @@ -758,73 +825,6 @@ class _ComposerBar extends StatelessWidget { ), ), const SizedBox(width: 8), - PopupMenuButton( - tooltip: 'Composer actions', - offset: const Offset(0, -180), - onSelected: (value) { - switch (value) { - case 'attach': - onPickAttachments(); - break; - case 'plan': - onModeChanged(mode == 'Plan' ? 'Ask' : 'Plan'); - break; - case 'gateway': - onOpenGateway(); - break; - case 'route': - break; - } - }, - itemBuilder: (context) => [ - const PopupMenuItem( - value: 'attach', - child: ListTile( - contentPadding: EdgeInsets.zero, - leading: Icon(Icons.attach_file_rounded), - title: Text('添加照片和文件'), - ), - ), - PopupMenuItem( - value: 'plan', - child: ListTile( - contentPadding: EdgeInsets.zero, - leading: Icon( - mode == 'Plan' - ? Icons.task_alt_rounded - : Icons.alt_route_rounded, - ), - title: Text(mode == 'Plan' ? '退出计划模式' : '计划模式'), - ), - ), - PopupMenuItem( - value: 'gateway', - child: ListTile( - contentPadding: EdgeInsets.zero, - leading: Icon( - connected - ? Icons.lan_rounded - : Icons.link_rounded, - ), - title: const Text('连接网关'), - ), - ), - PopupMenuItem( - value: 'route', - child: ListTile( - contentPadding: EdgeInsets.zero, - leading: const Icon(Icons.hub_rounded), - title: Text( - autoAgentLabel ?? 'Browser / Coding / Research', - ), - ), - ), - ], - child: const _ComposerIconButton( - icon: Icons.add_rounded, - ), - ), - const SizedBox(width: 8), _ComposerToolbarChip( icon: Icons.bolt_rounded, label: modelLabel,