Repository navigation
fix(controls): clear saved settings before Reset all - #395
Merged
Merged
Conversation
App navigation during Reset all could copy stale rc.* settings into the new URL, so a page selector could restore the old page afterwards. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Reset-all changes URL persistence before asynchronous binding writes across navigation, reconnects, and checkout-identity recovery, warranting human review of the interacting lifecycle effects.
No open issues 🎉
3 files not reviewed
.github/extensions/replica-prototype/assets/canvas-bridge.js: Generated filehub/.storybook/preview-fixtures/build-controls/controls.js: Generated filehub/app/javascript/features/install-replica-controls-bridge/bridge.js: Generated file
What changed in this PR
Fixes Reset all in the shared Controls preview bridge so navigation triggered by resetting a page selector cannot carry stale saved settings forward. This supports the page-selector guidance added in #394.
Changes:
- Clears saved
rc.*settings before resetting app bindings. - Adds regression coverage for reset-triggered navigation and the subsequent history event.
- Updates the generated bridge and bumps the plugin version to 1.9.1.
| File | Description |
|---|---|
hub/app/javascript/features/install-replica-controls-bridge/bridge.js |
Regenerates the bundled bridge with the reset-ordering fix. |
hub/app/javascript/application/prototype-preview-bridge/controls.ts |
Clears saved settings before resetting bindings. |
hub/app/javascript/application/prototype-preview-bridge/controls.test.ts |
Checks that reset navigation does not retain the saved page. |
.github/extensions/replica-prototype/plugin.json |
Bumps the plugin patch version to 1.9.1. |
Review effort: Balanced (adaptive)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
lukasoppermann
added a commit
that referenced
this pull request
Nov 26, 2026
<!-- copilot-assessment:v1 --> ### Agent assessment Self-reported assessment, not an independent review. Assessed revision: `c1e7643d7d38976488ffd4bf2f02352845a267ad` | Dimension | Assessment | Rationale | |---|---|---| | Change confidence | 8/10 | ↑ Independent regression tests cover inactive legacy overrides, conditional initialization, and deferred reset.<br>↑ Local lint, format, tests, build, and Controls and extension asset checks pass.<br>↓ Checks ran locally rather than in the Hub devcontainer; CI for this revision is pending.<br>↓ Browser fixture evidence predates the latest merge and review fixes; native canvas and deployed authenticated Build behavior remain unverified. | <!-- /copilot-assessment --> <!-- Use a conventional commit-style title, such as "fix(hub): retain prototype history". --> ## Why <!-- Explain the problem and why this change matters in a short, plain-English paragraph. Link the issue when applicable. --> Page selectors currently write their declared default when Controls starts, which can replace a directly linked page. The app's router should remain the source of truth when users opt into app-owned initialization. Relates to github/replica-internal#82. ## What changes <!-- Describe what becomes different for a first-time reader. Explain necessary terms. Include accurate Mermaid diagrams when they clarify the proposal, using before/after diagrams when helpful. Add screenshots for meaningful UI changes. --> <!-- Omit validation sections, checklists, and routine test/CI summaries such as "CI is green" or "tests passed". Mention only known verification gaps that affect the change, not disclaimers about drafting this description. --> <!-- For UI changes, prune obsolete and duplicate stories in the affected catalogues as part of the change. Explain removed UI or consolidated coverage where needed; see hub/docs/storybook.md#ui-changes-and-pull-request-evidence. --> API value bindings can declare `"initial": "app"` to read the current app value without a startup write. These controls ignore legacy saved values and never enter `rc.*` settings or copied override URLs, including before an inactive set mounts. Back/Forward adopts the current route; edits and Reset still write through the app API, with Reset using the declared default. An inactive set writes its app-owned defaults when it returns after Reset all. Existing bindings and hidden-control default writes remain unchanged. The schema, runtime, shared bridge, persistence, generated assets and authoring guides are updated together. The plugin receives the approved patch bump from 1.10.1 to 1.10.2; definition and protocol versions stay at 1. Older runtimes reject the new field while leaving the ordinary app usable. Sharing settings is blocked while saved values cannot be checked. The Reset fix in #395 and the authoring guide in #394 are merged into main and included in this branch. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
6d79294876a0bdb15fc86a0b9399a54c028415d9↑ Hub, Controls and extension checks pass after merging main.
↓ Not checked manually in the canvas with a real routed prototype.
rc.navigation.pagesurviving Reset all before the fix.↓ No trace from the original report confirms this exact path.
Why
Reset all controls should remove every saved setting. For a page selector that changes the app's route, it didn't always do that. While Reset ran, the app navigated to the default page, but the preview still had the old
rc.*settings in memory and copied them into the new URL. The next Back/Forward or reconnect then restored the old page. Related to github/replica-internal#82 and the page-selector recipe in #394.What changes
The preview bridge now clears its saved
rc.*settings before it resets the bindings, instead of waiting for the host's laterurl ""update. Any navigation the app does during Reset then starts from a clean?rc=1URL.Single-scope reset and the protocol are unchanged. Two small side effects:
The plugin version moves to 1.10.1 (patch).