[cherry-pick] sessions: navigate between chats in back/forward history#315632
Merged
Conversation
…tion (#315638) * sessions: read all observables before navigating guard and validate chat exists - Read session.status and chat.status before the _navigating early return so the autorun keeps tracking status transitions during navigation - Validate chat still exists in session.chats before calling openChat; fall back to openSession when the chat was deleted Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * sessions: add test for stale chat fallback in navigation Verify that goBack falls back to openSession when the target chat was deleted from the session after being recorded in history. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
benibenj
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of #315626 from
main.Summary
Extends the session back/forward navigation (#315382) to also track chat-level transitions within a session. Previously, switching between chats in a multi-chat session was not recorded in history.
Fixes #315623
Changes
sessionNavigation.tsINavigationEntrynow includes an optionalchatResource: URIalongsidesessionResourceactiveSession.activeChatin addition toactiveSession, reading both before the_navigatingguard to keep subscriptions alive_navigateTocallsopenChat(session, chatResource)when the entry has achatResource, otherwise falls back toopenSession()_isSameEntrycompares bothsessionResourceandchatResourcesessionNavigation.test.tsstubChatWithId()helper for creating chat stubs with unique IDsstubSession()to accept optionalchatsparameterMockSessionStorewithsetActiveChat()andopenChat()support, trackinglastOpenedChatResourcegoBackrestores previous chat within a session