diff --git a/lib/features/assistant/assistant_page.dart b/lib/features/assistant/assistant_page.dart index 5ee369b4..22720203 100644 --- a/lib/features/assistant/assistant_page.dart +++ b/lib/features/assistant/assistant_page.dart @@ -1754,8 +1754,6 @@ class _ConversationArea extends StatelessWidget { @override Widget build(BuildContext context) { final palette = context.palette; - final theme = Theme.of(context); - final statusStyle = _pillStyleForStatus(context, currentTask.status); return SurfaceCard( borderRadius: 0, @@ -1768,47 +1766,7 @@ class _ConversationArea extends StatelessWidget { child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - currentTask.title, - key: const Key('assistant-conversation-title'), - style: theme.textTheme.titleLarge?.copyWith( - fontWeight: FontWeight.w600, - ), - ), - const SizedBox(height: 4), - Wrap( - spacing: 6, - runSpacing: 6, - children: [ - _StatusPill( - label: currentTask.draft - ? appText('草稿任务', 'Draft task') - : _taskStatusLabel(currentTask.status), - backgroundColor: statusStyle.backgroundColor, - textColor: statusStyle.foregroundColor, - ), - _MetaPill( - label: currentTask.owner, - icon: Icons.smart_toy_outlined, - ), - _MetaPill( - label: currentTask.surface, - icon: Icons.forum_outlined, - ), - _MetaPill( - label: controller.currentSessionKey, - icon: Icons.tag_rounded, - ), - ], - ), - ], - ), - ), - const SizedBox(width: 8), + const Spacer(), Row( mainAxisSize: MainAxisSize.min, children: [ diff --git a/test/features/assistant_page_suite.dart b/test/features/assistant_page_suite.dart index 11044804..73116324 100644 --- a/test/features/assistant_page_suite.dart +++ b/test/features/assistant_page_suite.dart @@ -25,7 +25,7 @@ import '../test_support.dart'; void main() { testWidgets( - 'AssistantPage desktop shows thread rail and creates draft thread', + 'AssistantPage desktop hides conversation header text and shows thread rail', (WidgetTester tester) async { final controller = await createTestController(tester); @@ -36,19 +36,11 @@ void main() { ); expect(find.byKey(const Key('assistant-task-rail')), findsOneWidget); - - final titleBefore = tester.widget( + expect( find.byKey(const Key('assistant-conversation-title')), + findsNothing, ); - expect(titleBefore.data, '默认任务'); - - await tester.tap(find.byKey(const Key('assistant-new-task-button'))); - await tester.pumpAndSettle(); - - final titleAfter = tester.widget( - find.byKey(const Key('assistant-conversation-title')), - ); - expect(titleAfter.data, '新对话'); + expect(controller.currentSessionKey, 'main'); }, ); @@ -132,6 +124,8 @@ void main() { ); expect(find.text('当前 0'), findsOneWidget); + controller.dispose(); + await tester.pump(); }); testWidgets('AssistantPage lets users rename task titles', ( @@ -167,12 +161,6 @@ void main() { await tester.pumpAndSettle(); expect(find.text('研发任务'), findsWidgets); - expect( - tester - .widget(find.byKey(const Key('assistant-conversation-title'))) - .data, - '研发任务', - ); expect(controller.settings.assistantCustomTaskTitles['main'], '研发任务'); await pumpPage( @@ -362,7 +350,7 @@ void main() { expect(find.byKey(const Key('assistant-task-rail')), findsNothing); expect( - find.byKey(const Key('assistant-conversation-title')), + find.byKey(const Key('assistant-conversation-shell')), findsOneWidget, ); });