Merge main into chat drag
This commit is contained in:
@@ -23,6 +23,7 @@ class ChatCompactSidebar extends StatelessWidget {
|
||||
required this.activeSessionId,
|
||||
this.visibleSessionIds = const {},
|
||||
required this.onOpen,
|
||||
required this.onNewChat,
|
||||
required this.onExpand,
|
||||
this.navigation,
|
||||
});
|
||||
@@ -31,6 +32,7 @@ class ChatCompactSidebar extends StatelessWidget {
|
||||
final String? activeSessionId;
|
||||
final Set<String> visibleSessionIds;
|
||||
final ValueChanged<JsonMap> onOpen;
|
||||
final VoidCallback onNewChat;
|
||||
final VoidCallback onExpand;
|
||||
final Widget? navigation;
|
||||
static const width = 72.0;
|
||||
@@ -156,6 +158,7 @@ class ChatCompactSidebar extends StatelessWidget {
|
||||
width: width,
|
||||
child: Column(
|
||||
children: [
|
||||
_button(context, 'New chat', const Icon(Icons.add), onNewChat),
|
||||
_button(
|
||||
context,
|
||||
'Expand chat list',
|
||||
|
||||
@@ -100,10 +100,10 @@ class ChatSessionsScreen extends StatefulWidget {
|
||||
final ChatSectionFolds? folds;
|
||||
|
||||
@override
|
||||
State<ChatSessionsScreen> createState() => _ChatSessionsScreenState();
|
||||
ChatSessionsScreenState createState() => ChatSessionsScreenState();
|
||||
}
|
||||
|
||||
class _ChatSessionsScreenState extends State<ChatSessionsScreen> {
|
||||
class ChatSessionsScreenState extends State<ChatSessionsScreen> {
|
||||
late final ChatSessionsController _controller =
|
||||
(widget.controller ??
|
||||
ChatSessionsController(
|
||||
@@ -235,6 +235,9 @@ class _ChatSessionsScreenState extends State<ChatSessionsScreen> {
|
||||
if (session != null && mounted) widget.onOpen(session);
|
||||
}
|
||||
|
||||
/// Starts the same machine picker and create dialog used by the list action.
|
||||
Future<void> newChat() => _newChat();
|
||||
|
||||
void _markOpened(JsonMap session) =>
|
||||
unawaited(_controller.markOpened(session));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user