Repository navigation
Scope persisted visualizer state to each <Visualizer> with storageKey - #1205
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: f7defc2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
Micheal Parks (micheal-parks)
requested a review
from Devin T. Currie (DTCurrie)
November 25, 2026 16:48
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.
Scopes everything the visualizer persists to each
<Visualizer>instance, so an embedded viewer such as a test widget no longer reads or overwrites the standalone app's state.Library
<Visualizer>gainsstorageKey?: string. Omitted, every persisted value lives in memory for that visualizer alone. With a key, values persist under<storageKey>:<baseKey>, and visualizers given the same key share them.usePersistedStates()(src/lib/hooks/usePersistedStates.svelte.ts) returns a lookup that resolves each base key to one live value per visualizer. Components in the same visualizer now see each other's writes, which fixesSharedPoseFieldsandMoveControlsholding separate copies of the orientation format.provideSettings(storageKey)andcreateEnvironment(storageKey?)persist only when given a key. Settings live in IndexedDB under<storageKey>:settings.motion-toolsprefix, sincestorageKeynow scopes them. For examplemotion-tools:environment-modeis nowenvironment-mode.expandedFoldersanduseControlWidgetsno longer hold module-level state.useControlWidgets()must now be called while a component initializes.App
storageKey="visualizer".migrateLegacyStorageruns once from+layout.tsload, before the visualizer mounts. It copies each pre-storageKeyvalue to its new key, never overwrites an existing one, and leaves the originals in place. It is marked for removal on 2027-02-25.svelteis pinned to 5.58.0 to avoid regressions in 5.58.1 ({#each}inside{#key}throws "Cannot read properties of undefined (reading 'e')" when two effects write in one flush (regression in 5.58.1) sveltejs/svelte#19371, Spreading state in an effect teardown restores a value replaced in the same flush (regression in 5.58.1) sveltejs/svelte#19360) that crash the world tree when switching machines.