From b0d23185e7ca867ca5b2d54aaa9aac8d6c9a71a6 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Fri, 23 Oct 2026 18:51:57 +0100 Subject: [PATCH] WIP chat list actions --- .../ui/sessions/chat_sessions_screen.dart | 43 +++++++++---------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/app/lib/features/chat/ui/sessions/chat_sessions_screen.dart b/app/lib/features/chat/ui/sessions/chat_sessions_screen.dart index 16578eb9..7ba10d12 100644 --- a/app/lib/features/chat/ui/sessions/chat_sessions_screen.dart +++ b/app/lib/features/chat/ui/sessions/chat_sessions_screen.dart @@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../../../../core/api_gateway.dart'; +import '../../../../shell/shell_bar.dart'; import '../../data/chat_repository.dart'; import 'chat_adaptive.dart'; import 'chat_session_local.dart'; @@ -187,27 +188,6 @@ class _ChatSessionsScreenState extends State { final controls = chatControlsStyleOf(context); final body = Column( children: [ - ChatSearchField( - controller: _search, - onChanged: (_) => setState(() {}), - // Embedded under the shell there is no bar of its own: the - // create action sits beside search, as the web's chat toolbar. - trailing: widget.embedded - ? [ - ChatNewChatButton( - key: const Key('chat-new-chat'), - onPressed: _newChat, - ), - ChatBarAction( - key: const Key('chat-refresh'), - label: 'Refresh', - onPressed: _controller.refresh, - materialIcon: Icons.refresh, - cupertinoIcon: CupertinoIcons.refresh, - ), - ] - : const [], - ), if (_controller.error != null) ChatErrorNotice( message: _controller.error!, @@ -264,7 +244,26 @@ class _ChatSessionsScreenState extends State { ], ); - if (widget.embedded) return body; + // Under the shell, New chat and Refresh are its bar's actions; the + // list keeps the space without a search field. + if (widget.embedded) { + if (ShellBar.available(context)) { + return ShellBar( + active: widget.activeSessionId == null, + actions: _actions(), + child: body, + ); + } + return Column( + children: [ + Align( + alignment: AlignmentDirectional.centerEnd, + child: Row(mainAxisSize: MainAxisSize.min, children: _actions()), + ), + Expanded(child: body), + ], + ); + } if (chatControlsStyleOf(context) == ChatControlsStyle.cupertino) { return CupertinoPageScaffold(