Skip to content

Preserve mode flags when updating URL#6

Open
tristanmanchester wants to merge 1 commit intoopenai:mainfrom
tristanmanchester:fix-mode-url-params
Open

Preserve mode flags when updating URL#6
tristanmanchester wants to merge 1 commit intoopenai:mainfrom
tristanmanchester:fix-mode-url-params

Conversation

@tristanmanchester
Copy link
Copy Markdown

Summary

  • Preserve editor=true when URLManager.updateURL() rewrites application state into the query string.
  • Preserve frontend-only=true the same way.
  • Delete each flag when the corresponding app mode is false, matching the existing set/delete pattern for markdown, metadata, jmespath, and grid state.

Bug

updateConfigsFromURL() reads editor and frontend-only query parameters to enable editor mode and frontend-only mode, but updateURL() did not write those parameters back out when other state changed. Any action that called updateURL(), 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.isEditorMode controls editor=true
  • this.app.isFrontendOnlyMode controls frontend-only=true

This keeps mode state stable across normal URL updates while still removing the flags when those modes are disabled.

Verification

  • Reviewed updateConfigsFromURL() to confirm both flags are read from the URL.
  • Confirmed common app actions call this.urlManager.updateURL(), making the reported stripping path legitimate.
  • Ran pnpm run build successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant