Skip to content

fix(storybook): redirect legacy wind- story paths to apollo-wind-#824

Open
1980computer wants to merge 1 commit into
mainfrom
fix/storybook-landing-redirect
Open

fix(storybook): redirect legacy wind- story paths to apollo-wind-#824
1980computer wants to merge 1 commit into
mainfrom
fix/storybook-landing-redirect

Conversation

@1980computer

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a small inline script to managerHead in main.ts that intercepts ?path=/story/wind-* URLs on load and rewrites them to the current ?path=/story/apollo-wind-* equivalent
  • Fixes the broken first-visit experience on https://apollo-design.vercel.app/ for returning users who have the old story path cached/bookmarked

Root cause

The Storybook titlePrefix for apollo-wind was renamed from 'Wind''Apollo Wind' in the IA update (c3fcf17e). This changed all story IDs (e.g. wind-introduction-getting-started--defaultapollo-wind-introduction-getting-started--default). Returning users whose browser has the old ?path= URL in history or as a bookmark land on a "Couldn't find story" error page.

How the fix works

The redirect script runs synchronously in the manager <head> before Storybook initialises, so there's no flash of the error state — the URL is rewritten and the page reloads transparently.

Test plan

  • Visit https://apollo-design.vercel.app/?path=/story/wind-introduction-getting-started--default after deploy — should redirect cleanly to the apollo-wind-* equivalent
  • Visit https://apollo-design.vercel.app/ with no path — should land on the default Introduction story with no error

🤖 Generated with Claude Code

After the IA rename (titlePrefix 'Wind' → 'Apollo Wind'), returning users
with a bookmarked or cached ?path=/story/wind-* URL land on a "story not
found" error. This inline manager script intercepts those paths on load and
rewrites them to the current apollo-wind-* equivalent before Storybook
renders, eliminating the broken first-visit experience.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 15, 2026 21:10
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (PT)
apollo-design 🟢 Ready Preview, Logs Jun 15, 2026, 02:16:39 PM
apollo-docs 🟢 Ready Preview, Logs Jun 15, 2026, 02:16:39 PM
apollo-landing 🟢 Ready Preview, Logs Jun 15, 2026, 02:16:39 PM
apollo-vertex 🟢 Ready Preview, Logs Jun 15, 2026, 02:16:39 PM

@github-actions

Copy link
Copy Markdown
Contributor

Dependency License Review

  • 1922 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1692
ISC 89
Apache-2.0 55
BSD-3-Clause 27
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
MIT-0 3
CC0-1.0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.2.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a synchronous Storybook manager <head> redirect to transparently rewrite legacy ?path=/story/wind-* URLs to the new apollo-wind-* story IDs, preventing returning users from landing on the “Couldn’t find story” error page after the titlePrefix rename.

Changes:

  • Injects an inline manager-head script that rewrites legacy wind-* story paths to apollo-wind-* before Storybook initializes.

Comment on lines +126 to +128
if (path && path.indexOf('/story/wind-') === 0) {
params.set('path', path.replace('/story/wind-', '/story/apollo-wind-'));
window.location.replace('?' + params.toString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:storybook size:S 10-29 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants