Repository navigation
fix(share): shared links lose links under custom token separators (BLD-214) - #21
Merged
Merged
Conversation
Hydration loaded the project before the link's settings, so connections were pruned against tokens built with the default separators. A diagram that split a line with a custom separator such as `-` lost every link past that line's first token. Add projectStore.loadState, which loads settings first, and route the home page, examples, and gallery previews through it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The compact wire wrote `mg` only alongside another non-default setting, so a link where only the join character changed decoded back to `+`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.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.
Problem
A user reported that shared links restore only the first link group. Their payload contains all six connections and
"sp":"|-"; the diagram's middle line is split with-.Fixes
Links pruned before the link's settings load. The home page hydrated the project first.
loadSnapshotV2pruned connections against tokens built with the default separators (|only), so the--split line was a single token and every link pastt-0was dropped.settingsStore.loadran afterwards, too late. NewprojectStore.loadStateloads settings first; the home page,loadExample, andExamplePreviewEmbedall go through it.Merge char lost when it is the only changed setting.
compact-v4wrotemgonly alongside another non-default setting, so a link where only the join character changed decoded back to+. Token count is unaffected, so links survived, but token text rendered wrong. Existing payloads are byte-identical; only merge-char-only states now emits.Tests
project-load-state.test.ts: encodes a three-line diagram with-as a separator, decodes it, loads it. With the old hydration order it keeps 2 of 6 links, matching the user's video; withloadStateit keeps all 6._and empty as the only non-default setting.vitest(205 passed),svelte-check, prettier, and eslint are clean. Not checked in a browser.🤖 Generated with Claude Code