fix: keep worktree sessions in the right group

Prevents stale worktree lists from overwriting newly created worktrees
Uses the created worktree path when selecting linked worktree sessions
This commit is contained in:
Bohdan Triapitsyn
2026-06-03 15:16:36 +03:00
parent 2b098d36f5
commit 570ae9dbc8
5 changed files with 191 additions and 57 deletions
@@ -1679,7 +1679,7 @@ export const SessionSidebar: React.FC<SessionSidebarProps> = ({
setSessionSwitcherOpen(false);
}
if (options?.sessionId) {
setCurrentSession(options.sessionId);
setCurrentSession(options.sessionId, worktreePath);
return;
}
openNewSessionDraft({ directoryOverride: worktreePath });