Context
Split out from #21144 (re-cut 2026-11-18) so #21144 (Part 1: the workbench Code View, shipped in PR #21413 4d3b26857f) landed cleanly as its own unit. Reopened and scheduled into Engine 14 on 2026-11-21 per operator scope ruling ("almost all open tickets MUST get into v14"; valid open tickets are built rather than closed for open-count reduction). Design authority: operator direction of 16 Nov & 21 Nov 2026, #21140, and #21144.
The Problem
In a workbench example (Neo.examples.ConfigurationViewport), a visitor changes inspector configs and discovers a component configuration worth bookmarking or sharing, yet reloading the page resets every config to initial defaults and no URL carries that state to a colleague.
The Architectural Reality
The Fix
Serialize the workbench's changed literal configs (relative to initialConfigValues) into the example's URL hash in place (history.replaceState via Neo.Main.setRoute({value, replace: true})) whenever tracked configs change, parse and restore valid typed configs onto exampleComponent and its inspector controls after snapshotInitialState() on load (both sync and async createConfigurationComponents()), and clear the URL hash cleanly on onReset() or when configs return to initial defaults.
Contract Ledger
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
Neo.examples.workbench.formatConfig (serializeConfigParams, parseConfigParams — new pure helpers) |
#21411, #21144 (4d3b26857f) |
Deterministically encodes changed literal configs as sorted key=value hash parameters (bare strings when unambiguous; JSON tokens for null, booleans, finite numbers, arrays, plain objects, and literal-colliding strings) and decodes valid pairs back to typed JS values. |
Skips protoChainKeys (__proto__, constructor, prototype), excluded keys, non-literal values (describeNonLiteralReason), non-finite numbers, and malformed JSON/URI tokens without throwing. |
Yes (JSDoc) |
test/playwright/unit/examples/ConfigurationViewport.spec.mjs |
Neo.examples.ConfigurationViewport (getInitialUrlHash, getUrlHash, restoreUrlConfigs, syncUrlState, onHashHistoryChange, resetToInitialValues, destroy — new/extended methods; snapshotInitialState, trackExampleConfig, onConfigChange, onConfigRecordChange, onRadioChange, onReset) |
#21411, #21140 |
Restores valid initial URL hash parameters onto exampleComponent and matching initialControlStates controls (Radio groups, CheckBox/Switch, ComboBox/Select, NumberField, TextField) after snapshotInitialState(), updates the URL hash in place (replace: true) alongside updateCodeView(), handles external HashHistory navigations with a FIFO #pendingUrlWrites echo queue, and clears the URL hash on onReset(). |
Ignores unknown/internal/prototype-chain keys, invalid enum/store choices, and mismatched types; suppresses intermediate URL writes during restoration and deduplicates unchanged hash strings. |
Yes (JSDoc) |
test/playwright/unit/examples/ConfigurationViewport.spec.mjs, test/playwright/e2e/core/WorkbenchCodeViewNL.spec.mjs |
Neo.main.DomEvents#parseHash(str), Neo.main.DomEvents#setRoute(route, replace=false) & Neo.Main#setRoute({value, replace=false}) |
#21411, src/Main.mjs:801, src/main/DomEvents.mjs:1061, src/main/DomEvents.mjs:1208 |
parseHash preserves anchors, key[] arrays, and typed values while skipping malformed URI or prototype-chain entries so cold/live Main-to-App route delivery keeps valid sibling parameters usable; when replace === true, setRoute updates the URL in place via history.replaceState (preserving location.pathname, location.search, and history.state, removing # cleanly when route === '', and calling sendRoute()). |
setRoute defaults replace=false, preserving location.hash = route and history.pushState(null, ...) behavior for all existing callers; no-ops when the target URL already matches location. |
Yes (JSDoc) |
test/playwright/unit/main/DomEvents.spec.mjs, test/playwright/unit/examples/ConfigurationViewport.spec.mjs, test/playwright/e2e/core/WorkbenchCodeViewNL.spec.mjs |
Acceptance Criteria
Out of Scope
- The workbench Code View panel and clipboard copy (delivered by #21144 / PR #21413).
- Per-example custom multi-target mutations outside inspector-bound
exampleComponent configs unless explicitly bound through inspector controls.
- Persisting state in
localStorage, generated standalone example files, or an in-Portal example page of its own (#21140, After the cut item 2).
Avoided Traps
- State in
localStorage. Browser-local storage cannot be copied as a link or opened by a colleague on another machine.
- Unbounded object serialization or history spam. Encode only JSON-safe literal config diffs that differ from
initialConfigValues, skip unknown/malformed/prototype-chain keys safely across both DomEvents#parseHash and parseConfigParams, and replace the current URL entry in place (history.replaceState) rather than pushing a new browser history entry on every keystroke or spinbutton step.
Related
Parent #21140 · Workbench Code View prerequisite #21144 completed through PR #21413 (4d3b26857f).
Live latest-open + closed sweep: checked latest 20 open issues + open/closed search (workbench URL state ConfigurationViewport) at 2026-11-18T22:51Z and re-verified at intake on 2026-11-21T23:55Z; no duplicate open owner exists.
A2A in-flight sweep: latest unread/outbox messages checked at 2026-11-21T23:55Z: no in-flight collision.
MC sweep: "workbench example reload starts over link cannot carry config state", 5 results, no overlapping ticket beyond #21140 / #21144.
Structure-map: N/A (examples/, src/Main.mjs, src/main/DomEvents.mjs — existing files).
Decision Record impact: none.
Origin Session ID: 8d86fc2d-c555-43ca-b46d-9723f9e0a15d
Retrieval Hint: "workbench URL state, ConfigurationViewport hash persistence, formatConfig serializeConfigParams parseConfigParams"
— Maryam (Gemini 4 Carbon, Antigravity) · session 8d86fc2d-c555-43ca-b46d-9723f9e0a15d 🧭
Context
Split out from #21144 (re-cut 2026-11-18) so #21144 (Part 1: the workbench Code View, shipped in PR #21413
4d3b26857f) landed cleanly as its own unit. Reopened and scheduled into Engine 14 on 2026-11-21 per operator scope ruling ("almost all open tickets MUST get into v14"; valid open tickets are built rather than closed for open-count reduction). Design authority: operator direction of 16 Nov & 21 Nov 2026, #21140, and #21144.The Problem
In a workbench example (
Neo.examples.ConfigurationViewport), a visitor changes inspector configs and discovers a component configuration worth bookmarking or sharing, yet reloading the page resets every config to initial defaults and no URL carries that state to a colleague.The Architectural Reality
examples/ConfigurationViewport.mjsownssnapshotInitialState(),getChangedConfigs(),trackExampleConfig(),onConfigChange(),onConfigRecordChange(),onRadioChange(), andonReset().examples/workbench/formatConfig.mjsowns literal-vs-non-literal filtering (describeNonLiteralReason()).src/Main.mjs(setRoute),src/main/DomEvents.mjs(parseHash/getRouteConfig/sendRoute/setRoute),src/worker/Manager.mjs(config.hash->Neo.windowConfigs[windowId].hash), andsrc/util/HashHistory.mjsroute per-window URL hash state without requiring a server round-trip and without disturbinglocation.search(?theme=...).The Fix
Serialize the workbench's changed literal configs (relative to
initialConfigValues) into the example's URL hash in place (history.replaceStateviaNeo.Main.setRoute({value, replace: true})) whenever tracked configs change, parse and restore valid typed configs ontoexampleComponentand its inspector controls aftersnapshotInitialState()on load (both sync and asynccreateConfigurationComponents()), and clear the URL hash cleanly ononReset()or when configs return to initial defaults.Contract Ledger
Neo.examples.workbench.formatConfig(serializeConfigParams,parseConfigParams— new pure helpers)4d3b26857f)key=valuehash parameters (bare strings when unambiguous; JSON tokens fornull, booleans, finite numbers, arrays, plain objects, and literal-colliding strings) and decodes valid pairs back to typed JS values.protoChainKeys(__proto__,constructor,prototype), excluded keys, non-literal values (describeNonLiteralReason), non-finite numbers, and malformed JSON/URI tokens without throwing.JSDoc)test/playwright/unit/examples/ConfigurationViewport.spec.mjsNeo.examples.ConfigurationViewport(getInitialUrlHash,getUrlHash,restoreUrlConfigs,syncUrlState,onHashHistoryChange,resetToInitialValues,destroy— new/extended methods;snapshotInitialState,trackExampleConfig,onConfigChange,onConfigRecordChange,onRadioChange,onReset)exampleComponentand matchinginitialControlStatescontrols (Radiogroups,CheckBox/Switch,ComboBox/Select,NumberField,TextField) aftersnapshotInitialState(), updates the URL hash in place (replace: true) alongsideupdateCodeView(), handles externalHashHistorynavigations with a FIFO#pendingUrlWritesecho queue, and clears the URL hash ononReset().JSDoc)test/playwright/unit/examples/ConfigurationViewport.spec.mjs,test/playwright/e2e/core/WorkbenchCodeViewNL.spec.mjsNeo.main.DomEvents#parseHash(str),Neo.main.DomEvents#setRoute(route, replace=false)&Neo.Main#setRoute({value, replace=false})src/Main.mjs:801,src/main/DomEvents.mjs:1061,src/main/DomEvents.mjs:1208parseHashpreserves anchors,key[]arrays, and typed values while skipping malformed URI or prototype-chain entries so cold/live Main-to-App route delivery keeps valid sibling parameters usable; whenreplace === true,setRouteupdates the URL in place viahistory.replaceState(preservinglocation.pathname,location.search, andhistory.state, removing#cleanly whenroute === '', and callingsendRoute()).setRoutedefaultsreplace=false, preservinglocation.hash = routeandhistory.pushState(null, ...)behavior for all existing callers; no-ops when the target URL already matcheslocation.JSDoc)test/playwright/unit/main/DomEvents.spec.mjs,test/playwright/unit/examples/ConfigurationViewport.spec.mjs,test/playwright/e2e/core/WorkbenchCodeViewNL.spec.mjsAcceptance Criteria
exampleComponentand its inspector controls; clickingResetclears the URL state back to initial.Out of Scope
exampleComponentconfigs unless explicitly bound through inspector controls.localStorage, generated standalone example files, or an in-Portal example page of its own (#21140, After the cut item 2).Avoided Traps
localStorage. Browser-local storage cannot be copied as a link or opened by a colleague on another machine.initialConfigValues, skip unknown/malformed/prototype-chain keys safely across bothDomEvents#parseHashandparseConfigParams, and replace the current URL entry in place (history.replaceState) rather than pushing a new browser history entry on every keystroke or spinbutton step.Related
Parent #21140 · Workbench Code View prerequisite #21144 completed through PR #21413 (
4d3b26857f).Live latest-open + closed sweep: checked latest 20 open issues + open/closed search (
workbench URL state ConfigurationViewport) at2026-11-18T22:51Zand re-verified at intake on2026-11-21T23:55Z; no duplicate open owner exists. A2A in-flight sweep: latest unread/outbox messages checked at2026-11-21T23:55Z: no in-flight collision. MC sweep:"workbench example reload starts over link cannot carry config state", 5 results, no overlapping ticket beyond #21140 / #21144. Structure-map: N/A (examples/,src/Main.mjs,src/main/DomEvents.mjs— existing files).Decision Record impact: none.
Origin Session ID: 8d86fc2d-c555-43ca-b46d-9723f9e0a15d
Retrieval Hint: "workbench URL state, ConfigurationViewport hash persistence, formatConfig serializeConfigParams parseConfigParams"
— Maryam (Gemini 4 Carbon, Antigravity) · session 8d86fc2d-c555-43ca-b46d-9723f9e0a15d 🧭