Merge main into chat drag
This commit is contained in:
@@ -288,6 +288,23 @@ class ChatWorkspaceController extends ChangeNotifier {
|
||||
_changed();
|
||||
}
|
||||
|
||||
/// Replaces a pane after its caller has already validated [newId]. Unlike
|
||||
/// [replaceSession], this does not ask the window host to show a floating
|
||||
/// chat; keyboard cycling filters those chats before calling this method.
|
||||
void replacePaneSession(String paneId, String newId) {
|
||||
if (newId.isEmpty) return;
|
||||
final pane = panes.where((p) => p.id == paneId).firstOrNull;
|
||||
if (pane == null) return;
|
||||
final existing = panes.where((p) => p.sessionId == newId).firstOrNull;
|
||||
if (existing != null) {
|
||||
close(pane.id);
|
||||
activate(existing.id);
|
||||
return;
|
||||
}
|
||||
_root = _replace(_root!, pane.id, ChatWorkspacePane(pane.id, newId));
|
||||
_changed();
|
||||
}
|
||||
|
||||
ChatWorkspaceNode _replace(
|
||||
ChatWorkspaceNode node,
|
||||
String id,
|
||||
|
||||
Reference in New Issue
Block a user