refactor(ui): remove sidebar open-workspace button

This commit is contained in:
Haitao Pan 2026-03-29 09:34:24 +08:00
parent 57fe420113
commit a02fdb385c
2 changed files with 5 additions and 34 deletions

View File

@ -211,28 +211,6 @@ class _AssistantArtifactSidebarState extends State<AssistantArtifactSidebar> {
size: 14,
),
),
if (canOpenWorkspace)
IconButton(
key: const Key(
'assistant-artifact-pane-open-workspace-ref',
),
tooltip: appText(
'在文件浏览器中打开',
'Open in file browser',
),
visualDensity: VisualDensity.compact,
padding: EdgeInsets.zero,
constraints: const BoxConstraints(
minWidth: 24,
minHeight: 24,
),
onPressed: () =>
unawaited(_openWorkspace()),
icon: const Icon(
Icons.open_in_new_rounded,
size: 14,
),
),
],
),
),

View File

@ -117,10 +117,9 @@ void main() {
expect(find.text('HTML Preview'), findsOneWidget);
});
testWidgets('AssistantArtifactSidebar copies and opens local workspace paths', (
testWidgets('AssistantArtifactSidebar copies local workspace paths', (
WidgetTester tester,
) async {
var openCount = 0;
final snapshot = AssistantArtifactSnapshot(
workspaceRef: '/tmp/thread',
workspaceRefKind: WorkspaceRefKind.localPath,
@ -132,9 +131,7 @@ void main() {
tester,
snapshot: snapshot,
previewForEntry: (_) => const AssistantArtifactPreview.empty(),
onOpenWorkspace: () async {
openCount += 1;
},
onOpenWorkspace: () async {},
);
final copyButton = tester.widget<IconButton>(
@ -143,13 +140,9 @@ void main() {
),
);
copyButton.onPressed!.call();
final openButton = tester.widget<IconButton>(
find.byKey(
const Key('assistant-artifact-pane-open-workspace-ref'),
),
expect(
find.byKey(const Key('assistant-artifact-pane-open-workspace-ref')),
findsNothing,
);
openButton.onPressed!.call();
expect(openCount, 1);
});
}