Use the visible chat list to choose an added pane
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user