Skip to content

Framework switcher targets deployed origin, not localhost#66

Merged
sjoerdbeentjes merged 1 commit into
mainfrom
fix/framework-picker
Jul 1, 2026
Merged

Framework switcher targets deployed origin, not localhost#66
sjoerdbeentjes merged 1 commit into
mainfrom
fix/framework-picker

Conversation

@sjoerdbeentjes

Copy link
Copy Markdown
Collaborator

Summary

  • On the deployed GitHub Pages site, the Storybook framework switcher hardcoded http://localhost:6006/6007, so clicking React/Angular in the toolbar sent users to localhost instead of the live /react/ or /angular/ paths.
  • The switcher now resolves the peer's base URL from the current window.location: localhost ports in dev, and a same-origin /<framework>/ path swap when deployed.

Test plan

  • Verified locally with both Storybooks running (6006/6007): switching frameworks via the toolbar navigates correctly.
  • Verified the path-based resolution logic against simulated GitHub Pages URLs (e.g. https://surfnet.github.io/DesignSystem/react/....../angular).
  • pnpm lint passes.

…d localhost

On GitHub Pages both Storybooks share one origin under /react/ and /angular/
paths, so the switcher must derive the peer's URL from the current location
instead of the hardcoded localhost ports.
@sjoerdbeentjes sjoerdbeentjes changed the title fix: framework switcher targets deployed origin, not localhost Framework switcher targets deployed origin, not localhost Jul 1, 2026
@sjoerdbeentjes sjoerdbeentjes merged commit 21375bb into main Jul 1, 2026
1 check passed
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