🤖 fix: restore the open chat on hard refresh#3151
Open
ammar-agent wants to merge 1 commit intomainfrom
Open
Conversation
Collaborator
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
dfcb7d7 to
665f749
Compare
Collaborator
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Summary
This follow-up to #3141 keeps an open workspace chat on hard refresh and also simplifies the startup routing architecture behind that decision. Browser and standalone startup now classify
/workspace/:idrestores from the actual navigation type instead of relying on session-storage bookkeeping spread across initialization paths.Background
#3141 intentionally kept browser fresh-launch behavior from blindly reopening a stale
/workspace/:idURL unless the user explicitly chose last workspace. That was still correct for true first loads, but hard refresh got lumped into the same bucket and could bounce an open chat back to the project/new-workspace page.The first fix for this used per-session flags, which worked for reloads but added more startup coordination state to an already subtle routing area. This revision simplifies that architecture by making RouterContext answer one clearer question on startup: is this a restore-style navigation or a fresh launch?
Implementation
getStartupNavigationType()andshouldRestoreWorkspaceUrlOnStartup()inRouterContextperformance.navigationfallback) to distinguishreload/back_forwardrestores from freshnavigateloadsRouterProvidereffect that existed only to maintain themfile://restore path and launch-behavior handling unchangedValidation
bun test src/browser/contexts/RouterContext.test.tsxbun test src/browser/contexts/WorkspaceContext.test.tsxmake static-checkRisks
This changes browser/PWA startup route restoration logic. A regression here would affect whether
/workspace/:idis treated as a fresh launch or a restore on page load, so the updated tests cover both cold-launch and reload behavior.Generated with
mux• Model:openai:gpt-5.4• Thinking:xhigh• Cost:$18.76