Repository navigation
Web: open tabs share settings changes, so one tab no longer undoes another's (#8644) - #8832
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…other's (tangency-labs#8644) Every open tab of the web app saved its whole copy of the settings to the same browser storage, every 30 s and on focus loss, so a tab still holding old settings put them back over a toolbar change made in another tab. A tab now writes its settings in the frame they change, and the other open tabs load them from the browser's storage event, so their own saves keep them. Settings loaded that way aren't written back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
austin62jake
marked this pull request as ready for review
October 29, 2026 13:48
bherbruck
enabled auto-merge
October 29, 2026 21:27
bherbruck
added this pull request to the merge queue
Oct 29, 2026
Merged
via the queue into
tangency-labs:main
with commit Oct 29, 2026
9b97e06
144 of 156 checks passed
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.
Fixes #8644
Change
All open tabs of the web app share one place in the browser's storage for the settings (
solidcraft.prefs). eframe saves each tab's whole copy there every 30 s and whenever the page loses focus, so the tab that saves last wins. As the reporter found in #8685, a toolbar change made in one tab was overwritten by another open tab's next save, which still held the old toolbar.Now:
storageevent to every other tab of the page when one writes. Each tab listens for it on the settings key, and its next frame loads the settings withSolveApp::load_prefs, so its own saves keep them instead of putting its older copy back. Settings a tab loaded this way aren't written back.So a setting changed in one tab also shows in the other open tabs right away. A tab in the background picks them up when it's next shown, before it can save anything.
Embedded pages (
?embed) don't keep settings, and don't listen either.One case this doesn't change: with Preferences open in tab B, a change made in tab A shows in B's Preferences, but Cancel in B puts back what B had when Preferences opened, A's change included.
Changes a default: no
Tests
solidcraft-web:changed_settings_are_written_once_and_loaded_ones_not_at_allandonly_settings_another_tab_wrote_are_loaded, for the two small pieces of logic the browser code uses.prefs::tests::settings_loaded_over_changed_ones_replace_them_all: the sync relies on loading replacing a running app's settings whole. A tab that had pinned a command to Shortcuts, added a keyboard shortcut, changed the toolbar and more, then loads another tab's settings, ends up saving exactly the other tab's settings.Validation
On Windows 10 x86_64, on
mainat 07d692e:cargo test --profile ci -p solidcraft-web: 26 passed.cargo test --profile ci -p solidcraft-ui-egui --lib -- prefs: 123 passed.cargo clippy --profile ci -p solidcraft-ui-egui -p solidcraft-web --all-targets -- -D warnings: pass. For--target wasm32-unknown-unknownit finds nothing in the changed code (it reports twouseless_conversionerrors ininstall.rs, which this PR doesn't touch).cargo xtaskassets, licences --check, lists, skills, layers and ui-containers: pass.cargo xtask wasm: 12 crates build for wasm32.cargo fmt --all -- --check: pass.In the browser:
trunk serve --release, settings cleared, two tabs of the same page, each with a new design open. Tab A removed Hole from the Model toolbar, and tab B showed it gone; tab B removed Revolve, and tab A showed that. After more than 30 s with frames in each tab (eframe's own save), the stored toolbar still had both changes. Then tab B was closed and tab A reloaded: both changes kept.Integration status
Branched from
mainat 07d692e. The only other open PR changingapps/solidcraft-web/src/main.rsis #8515 (DXF), in other parts of the file.🤖 Generated with Claude Code