Skip to content

Fix Home navigation from the editor: derive the landing deep-link redirect from the router url#323

Merged
milanofthe merged 1 commit into
mainfrom
fix/landing-redirect-reactivity
Jul 11, 2026
Merged

Fix Home navigation from the editor: derive the landing deep-link redirect from the router url#323
milanofthe merged 1 commit into
mainfrom
fix/landing-redirect-reactivity

Conversation

@milanofthe

@milanofthe milanofthe commented Jul 11, 2026

Copy link
Copy Markdown
Member

The landing page computed redirecting once at component init from window.location.search. During a client-side navigation from /editor back to /, the component initializes before the history entry updates, so the check still saw the editor's query (e.g. ?model=... from an example deep link). redirecting came out spuriously true: the landing rendered empty and immediately bounced back to the editor via replaceState. Net effect: the Home button set the URL but never navigated.

Fix: derive redirecting from page.url.searchParams ($app/state), and move the redirect from a one-shot onMount into an $effect reacting to the same source. Direct deep-link loads (/?model=..., ?backend=...) behave exactly as before.

Repro before the fix: landing -> click an example (lands on /editor?model=...) -> click the Home button in the nav bar.

@milanofthe milanofthe merged commit 46e4c23 into main Jul 11, 2026
4 checks passed
@milanofthe milanofthe deleted the fix/landing-redirect-reactivity branch July 11, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant