Merge commit '82418d31a76548ef5d5965a4472582740036dbc6' into pipelines/run-20261112-1022-settings-as-a-top-level-destination-5a4e

This commit is contained in:
2026-11-12 10:40:58 +00:00
6 changed files with 282 additions and 20 deletions
@@ -11,6 +11,7 @@ import '../../../../ui/layout/content_width.dart';
import '../../../../core/api_gateway.dart';
import '../../../../shell/shell_bar.dart';
import '../../../../shell/shell_list_shortcuts.dart';
import '../../../terminal/terminal_open_action.dart';
import '../../data/chat_repository.dart';
import '../../domain/chat_colors.dart';
import '../../domain/chat_cycle.dart';
@@ -381,7 +382,7 @@ class _ChatSessionsScreenState extends State<ChatSessionsScreen> {
if (ShellBar.available(context)) {
return ShellBar(
active: widget.publishShellBar ?? widget.activeSessionId == null,
actions: _actions(),
actions: _actions(context),
// The Chat tab counts chats with messages not yet seen.
child: ShellBadge(
kind: ShellBadgeKind.unread,
@@ -396,7 +397,7 @@ class _ChatSessionsScreenState extends State<ChatSessionsScreen> {
alignment: AlignmentDirectional.centerEnd,
child: Row(
mainAxisSize: MainAxisSize.min,
children: _actions(),
children: _actions(context),
),
),
Expanded(child: body),
@@ -406,7 +407,7 @@ class _ChatSessionsScreenState extends State<ChatSessionsScreen> {
return Scaffold(
extendBodyBehindAppBar: true,
appBar: SegmentedBar(title: 'Chats', actions: _actions()),
appBar: SegmentedBar(title: 'Chats', actions: _actions(context)),
// The list scrolls behind the floating bar; New chat is the bar's
// own action, so there is no second create button.
body: body,
@@ -415,18 +416,24 @@ class _ChatSessionsScreenState extends State<ChatSessionsScreen> {
);
}
List<Widget> _actions() => [
ChatBarAction(
key: const Key('chat-new-chat'),
label: 'New chat',
onPressed: _newChat,
materialIcon: Icons.add,
),
ChatBarAction(
key: const Key('chat-refresh'),
label: 'Refresh',
onPressed: _controller.refresh,
materialIcon: Icons.refresh,
),
];
/// New chat, Refresh and, on a narrow layout, the terminal toggle (wide
/// layouts keep it on the shell bar, so it is null here).
List<Widget> _actions(BuildContext context) {
final terminal = terminalChatBarAction(context);
return [
ChatBarAction(
key: const Key('chat-new-chat'),
label: 'New chat',
onPressed: _newChat,
materialIcon: Icons.add,
),
ChatBarAction(
key: const Key('chat-refresh'),
label: 'Refresh',
onPressed: _controller.refresh,
materialIcon: Icons.refresh,
),
?terminal,
];
}
}