refactor(ui): remove sidebar open-workspace button
This commit is contained in:
parent
57fe420113
commit
a02fdb385c
@ -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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user