Repository navigation
fix(desktop): navigate to branched session route - #95992
mashenchina-max wants to merge 1 commit into
Conversation
95992 — fix(desktop): navigate to branched session route — navigation correctness.
|
|
I opened #97359 for a complementary branch failure found in a real non-default-profile Project session.
I linked this PR in #97359 and called the fixes complementary; there is no intent to supersede the navigation fix here. |
|
Heads-up: I've cherry-picked this fix (with original authorship preserved — commit 59fe527) into #98025, which already reworks the same If maintainers prefer, landing #98025 first makes this PR's diff fully contained (it can be closed as absorbed, with the authorship surviving in-tree); alternatively I'm happy to rebase #98025 on top of this one. Just flagging so neither PR blocks the other. |
|
Superseded by #100879, which consolidates the full branch-load path. Your commit is cherry-picked there with authorship preserved.\n\nThe route/selection split was real and separate from the routing bugs \u2014 a correctly created, correctly owned child still sat behind the loader without it. |
Summary
When branching the session already open in the primary workspace, navigate the router to the child session before resuming it.
This is a narrow follow-up to #93663. That change correctly made the child the selected primary session, but the URL could remain on the parent. The primary chat then saw
routeSessionMismatchand kept its centered loading spinner mounted even though the branched child existed and was readable.Root cause
forkBranch()called:resumeSession()updates$selectedStoredSessionId, but it does not change the route. The resulting state was:routeSessionMismatch: trueThis also let route-resume keep trying to restore the parent instead of converging on the child.
Change
sessionRoute(routedSessionId)withreplace: truebefore resuming the child.Regression proof
With the production
navigate(...)line temporarily removed, the focused test fails with:Restoring the line makes the complete
use-session-actions.test.tsxsuite pass: 83/83.Verification
npx vitest run --project ui src/app/session/hooks/use-session-actions.test.tsx— 83 passednpm run check— passed (typecheck, lint, UI, Desktop, platform, and plugin gates; Electron platform tail: 586/586)Session not foundretry-loop log appeared after waiting beyond the previous retry interval.Relationship to existing reports