Skip to content

fix(desktop): branched sessions open in the main workspace, not just the sidebar (#93444, salvage #93461) - #93663

Merged
teknium1 merged 5 commits into
mainfrom
salv/93444-branch-opens-primary
Aug 24, 2026
Merged

teknium1 merged 5 commits into
mainfrom
salv/93444-branch-opens-primary

Conversation

@teknium1

Copy link
Copy Markdown
Collaborator

Summary

Branching a session now opens the branch in the main workspace — previously it only appeared as a sidebar row (the fork deliberately avoided selecting it as primary), so in the default layout nothing visible happened and users thought the branch was lost. Fixes #93444.

Changes

  • apps/desktop/src/app/session/hooks/use-session-actions/index.ts: forkBranch ends with primary resumeSession in the default layout; tiled layouts keep the tile behavior; scoped to branching the currently selected session so sidebar branches of background sessions don't steal focus (guards the fix(desktop): open branched chat in a new tab and switch to it #69750 regression)
  • Duplicate-message and right-click branch entry points route through the same fixed path

Validation

Before After
Branch current session (default layout) sidebar row only opens in workspace
Branch background session from sidebar — keeps tile path (no focus steal)
Tests — 58/58 (primary-selection, main-XOR-tile invariant, view preservation)

Salvaged from #93461 (@chelsealong), cherry-picked with authorship preserved.

Infographic

Branched sessions open in the workspace

chelsealong and others added 3 commits August 24, 2026 00:08
… a tile

forkBranch ended by opening the branch as a session-tile and leaving the
primary selection on the parent (#69750). In the default layout there is
no visible tile pane, so branching only added a sidebar row with no
feedback in the main area — and openSessionTile no-ops when the target
is already the selected session, the common case of branching the chat
you're viewing.

Load the branch as the primary session via resumeSession instead, which
reuses the runtime already warm-cached by forkBranch's
ensureSessionState/updateSessionState calls, so it doesn't cost an extra
resume RPC.

Fixes #93444
…ssion

forkBranch was unconditionally routing every branched session into the
main pane via resumeSession, including sidebar/background branches of
a session the user isn't currently viewing. That reintroduces the
#69750 focus-stealing bug for that path: branching a different session
from the sidebar yanked the active view away from whatever was open.
Only take over the main pane when the branch's parent is the session
already selected; otherwise keep opening it as its own tile.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Aug 24, 2026
@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

૮ >ﻌ< ა ci review

ran on 7ea9ad8 — ci: retrigger after 0-job workflow startup failure

⚠️ Warnings

CI timings · View report · View job

Wall time 57m19s vs 10m27s (+448.5%). 1 job(s) slower, 5 faster,

  • OSV scan / Scan lockfiles / osv-scan: -165.0s
  • Check no committed infographics / check-no-committed-infographics: -84.0s
  • JS & TS checks / JS & TS checks: -58.0s
  • OSV scan / Emit review status: -22.0s
  • Detect affected areas: -8.0s

OSV vulnerability scan · View job

7 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.

@teknium1
teknium1 merged commit 9fbe3cc into main Aug 24, 2026
48 of 50 checks passed
@teknium1
teknium1 deleted the salv/93444-branch-opens-primary branch August 24, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

desktop: branched session opens only in sidebar, not in main workspace (default layout)

3 participants