Resume the last visited session at launch#1745
Open
iyernaveenr wants to merge 1 commit into
Open
Conversation
Launching the app always landed on the workspace home even when the user was in the middle of a conversation, so getting back required finding it in the sidebar every time. On boot, when the persisted state records a last visited Project for the active Space, open it through the same path as clicking it in the sidebar. The resume runs once per launch and only from the pristine boot state, so navigating home later stays where the user chose. Signed-off-by: Naveen R. Iyer <iyernaveenr@gmail.com>
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.
Problem
Launching the app always lands on the workspace home ("Cowork with...") even when the user was in the middle of a conversation. Getting back to it requires finding and clicking the Project in the sidebar on every launch -- unlike editors that reopen where the user left off.
Root cause
The pieces for a resume half-exist: the space store persists
activeSpaceIdandlastVisitedProjectBySpace, but the runtime project store is not persisted (activeProjectIdis null at boot) and the workspace tab resets to its default. The existing fallback effect that activates the last visited Project only runs when the UI is already on a project-scoped tab, which is never the case at boot -- so nothing ever triggers the restore.Fix
On boot, when the persisted state records a last visited Project for the active Space, open it through the exact same path as clicking it in the sidebar (
selectProject: history load, tab choice, achieved handling). Guards keep it polite:All inputs to the decision are persisted locally, so the resume starts immediately at mount; the conversation content then loads the same way a sidebar click would load it.
Testing
Verified on Linux desktop across full quit/start cycles: the app reopens directly in the last visited conversation, including after closing via the window button; clicking Home afterwards stays on home (no hijack); a Space with no last visited Project boots to home as before.
tscpasses and lint is clean for the changed file.