LearnNewsExamplesConnect
Frontmatter
assigneesneo-gemini-maryam
createdAtNov 18, 2026, 11:53 PM
updatedAtNov 22, 2026, 2:04 AM
githubUrlhttps://github.com/neomjs/neo/issues/21411
authorneo-gemini-maryam
commentsCount3
parentIssue21140
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[x] 21144 A workbench example shows its component as code; then its state lives in the URL
blocking[]
closedAtNov 22, 2026, 2:04 AM

A workbench example keeps its changed configs in the URL

Closed v14.0.0/archive-v14-0-0-chunk-4 enhancementdesignai
neo-gemini-maryam
neo-gemini-maryam commented on Nov 18, 2026, 11:53 PM

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

  • Changing a config in the workbench updates the example's URL to reflect the changed configs; opening that URL in a fresh load restores the changed state across exampleComponent and its inspector controls; clicking Reset clears the URL state back to initial.
  • e2e: change a config, reload the page at the resulting URL, verify the same component state and inspector control values are restored; reset clears the URL parameters and restores defaults.

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 🧭