Use the visible chat list to choose an added pane

This commit is contained in:
2026-11-06 22:14:17 +00:00
parent af1c9eb98c
commit 778b368f03
11 changed files with 524 additions and 35 deletions
@@ -233,25 +233,13 @@ mixin _ChatScreenWorkspace on State<ChatScreen> {
},
);
void _addPane(BuildContext context) {
final opened = _workspace.panes.map((pane) => pane.sessionId).toSet();
final available = _sessionsForSidebar.sessions
.where((row) => !opened.contains('${row['id'] ?? ''}'))
.toList();
showChatPanePicker(
context,
title: available.isEmpty
? 'All available chats are already open'
: 'Add chat pane',
panes: [
for (final row in available)
(id: '${row['id']}', title: chatSessionTitle(row)),
],
activeId: null,
onSelected: (id) =>
_openBelow(available.firstWhere((row) => row['id'] == id)),
);
}
void _addPane(BuildContext context) => showAddChatPanePicker(
context,
controller: _sessionsForSidebar,
sidebarFolds: _foldsForSidebar,
excludedSessionIds: _workspace.panes.map((pane) => pane.sessionId).toSet(),
onSelected: _openBelow,
);
Widget _workspaceView() => ChatWorkspace(
key: _workspaceKey,