Merge commit '82418d31a76548ef5d5965a4472582740036dbc6' into pipelines/run-20261112-1022-settings-as-a-top-level-destination-5a4e
This commit is contained in:
@@ -52,8 +52,8 @@ class AppTerminals {
|
||||
|
||||
/// [shell] with the terminal panel, window or page around it, and the
|
||||
/// app's floating [windows] above both.
|
||||
/// [onChat]: the phone shortcut that reopens the terminal shows on the
|
||||
/// Chat tab only.
|
||||
/// [onChat]: whether the phone shortcut that reopens the terminal shows on
|
||||
/// this page. Pages whose own bar carries Terminal pass false.
|
||||
Widget surround(Widget shell, {bool onChat = true, Widget? windows}) =>
|
||||
TerminalSurface(
|
||||
hub: hub,
|
||||
|
||||
@@ -828,7 +828,11 @@ class _PipelinesAppState extends State<PipelinesApp>
|
||||
valueListenable: _attentionCount,
|
||||
builder: (context, count, _) => _terminals.surround(
|
||||
_shellFor(route, count),
|
||||
onChat: route.kind == AppRouteKind.chat,
|
||||
// Every narrow Chat bar carries Terminal itself (the list's top bar
|
||||
// and an open chat's bar, see terminalChatBarAction), so the floating
|
||||
// bubble is off on every route. It otherwise covered the list's
|
||||
// header and duplicated the open chat's Terminal entry.
|
||||
onChat: false,
|
||||
windows: WindowHost(manager: _windows, reservesRail: true),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -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,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user