Preserve mode flags when updating URL#6
Open
tristanmanchester wants to merge 1 commit intoopenai:mainfrom
Open
Preserve mode flags when updating URL#6tristanmanchester wants to merge 1 commit intoopenai:mainfrom
tristanmanchester wants to merge 1 commit intoopenai:mainfrom
Conversation
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
editor=truewhenURLManager.updateURL()rewrites application state into the query string.frontend-only=truethe same way.Bug
updateConfigsFromURL()readseditorandfrontend-onlyquery parameters to enable editor mode and frontend-only mode, butupdateURL()did not write those parameters back out when other state changed. Any action that calledupdateURL(), such as pagination, markdown/metadata toggles, layout changes, or search, could rewrite the URL without these mode flags.For editor mode this meant a user could remain in editor mode during the current session, but after refresh the URL no longer contained
editor=true, so the app reopened outside editor mode.Fix
updateURL()now mirrors the read-side URL flags:this.app.isEditorModecontrolseditor=truethis.app.isFrontendOnlyModecontrolsfrontend-only=trueThis keeps mode state stable across normal URL updates while still removing the flags when those modes are disabled.
Verification
updateConfigsFromURL()to confirm both flags are read from the URL.this.urlManager.updateURL(), making the reported stripping path legitimate.pnpm run buildsuccessfully.