fix(desktop): navigate to session when clicking most-recent from non-Chat tab - #67331
fix(desktop): navigate to session when clicking most-recent from non-Chat tab#67331kyssta-exe wants to merge 1 commit into
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused fix. The dead-click premise is confirmed on current main: apps/desktop/src/app/contrib/wiring.tsx:753-756 only navigates when focusOpenSession returns false, while apps/desktop/src/store/session-states.ts:424-447 returns true for both the main session and open tiles.
Problems
apps/desktop/src/app/contrib/wiring.tsx:761routes an already-open tile tosessionRoute(sessionId). AfterfocusOpenSessionhas focused that tile,apps/desktop/src/app/session/hooks/use-route-resume.ts:115-150treats the tile route as non-active and callsresumeSession;apps/desktop/src/app/session/hooks/use-session-actions/index.ts:446-450then makes it the selected/main session. The requested view switch should not promote an existing tile.- The changed routing decision has no regression coverage.
Suggested changes
- Route the non-chat, already-open path through the selected main-session route, falling back to the clicked id only if no main session exists.
- Add focused pure routing tests. The earlier open implementation in #66880 (
c39e7273c1e4d3743004a17831cf2a8cfe383828) covers the main-session, tile, and no-main cases.
Automated hermes-sweeper review.
| if (!focusOpenSession(sessionId)) { | ||
| navigate(sessionRoute(sessionId)) | ||
| } else if (appViewForPath(location.pathname) !== 'chat') { | ||
| navigate(sessionRoute(sessionId)) |
There was a problem hiding this comment.
For an already-open tile, this routes to the tile id after focusOpenSession has focused it. useRouteResume then resumes that id as the selected/main session, promoting the tile. Route through the selected main-session id here (with a no-main fallback) so this only reveals Chat while preserving the tile.
|
Closing as duplicate of #66880 (alt-glitch triage confirmed). The focusOpenSession success-path fix is already covered there. |
Problem
When viewing a non-Chat tab (Plugins, Artifacts, Capabilities, Messaging) and clicking the most recent session in the sidebar, nothing happened — the view stayed on the current page (
/plugins,/artifacts, etc.).Clicking any other session worked fine: it switched to Chat with that session loaded.
Root Cause
The
onResumeSessioncallback atwiring.tsx:753callsfocusOpenSession(sessionId)first. When the clicked session matches$selectedStoredSessionId(i.e. it's the most recent / last-opened session),focusOpenSessionreturnstrueafter callingrevealTreePane('workspace')andnoteActiveTreeGroup(null)— but it does not navigate the router. Since the user is on a non-Chat page, the workspace pane doesn't show chat, so nothing visible happens.For sessions that differ from
$selectedStoredSessionId(all but the topmost),focusOpenSessionreturnsfalse, andnavigate(sessionRoute(sessionId))runs as expected.Fix
After
focusOpenSessionreturnstruebut the current route is NOT a chat view, still callnavigate(sessionRoute(sessionId))to force the route change. This is a 2-line addition in the existing handler.Test
TypeScript compiles cleanly (
npx tsc --noEmitpasses). No test coverage exists for this specific wiring handler path.Closes #66875