flags: persist URL flags for the session, add flagEnabled - #321
Merged
Conversation
Flags were parsed from the URL on every page load but never written back, so a flag only applied to the page whose query string carried it. getFlags() already reads sessionStorage as a fallback; nothing ever populated it. - parseFlags() now persists URL-supplied flags to sessionStorage, so a flag set once holds for the rest of the tab session. A URL parameter still wins over a stored value, so "?optableDebug=0" corrects a stored "1". - Adds flagEnabled(), and switches the three buildRTD call sites to it. Flag values are strings and "0" is truthy, so "?optableForceSkipMerge=0" previously enabled the flag. Persisting values makes that stick for the session rather than one page, so the truthiness bug is fixed here rather than left to become permanent. setupAB is unaffected — it already compares against "1" and "0" explicitly, and optableControlGroup stays two-state. - Adds optableForceTokenize, optableResolveId5 and optableResolveID5ID to FLAG_KEYS. All three are in use but unrecognised, so they were neither parsed nor persisted. optableResolveID5ID becomes URL-settable for the first time; previously it could only be set by writing sessionStorage. Adds lib/core/flags.md and a README section — neither existed, so the flag names and their meanings were only discoverable by reading the source.
etiennelatendresse-optable
approved these changes
Aug 19, 2026
4 tasks
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.
Why
getFlags()reads flags from the URL but never writes them tosessionStorage, so a flag only applies to the page whose query string carried it. Navigate once and it's gone.What Changed
parseFlags()persists URL flags tosessionStorage. URL still wins over a stored value.flagEnabled(), used by the threebuildRTDcall sites. Flag values are strings and"0"is truthy, so?optableDebug=0used to turn debug on.setupABis untouched —optableControlGroupis two-state and already compares explicitly.optableForceTokenize,optableResolveId5,optableResolveID5IDtoFLAG_KEYS.lib/core/flags.mdand README section.How to Test
Load a page with
?optableForceGlobalRouting, then navigate to a second page without it. Routing should stay global.?optableDebug=0should leave RTD logging off.Notes