fix(storybook): redirect legacy wind- story paths to apollo-wind-#824
Open
1980computer wants to merge 1 commit into
Open
fix(storybook): redirect legacy wind- story paths to apollo-wind-#8241980computer wants to merge 1 commit into
1980computer wants to merge 1 commit into
Conversation
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>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Dependency License Review
License distribution
Excluded packages
|
There was a problem hiding this comment.
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 toapollo-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()); |
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.
Summary
managerHeadinmain.tsthat intercepts?path=/story/wind-*URLs on load and rewrites them to the current?path=/story/apollo-wind-*equivalentRoot cause
The Storybook
titlePrefixforapollo-windwas renamed from'Wind'→'Apollo Wind'in the IA update (c3fcf17e). This changed all story IDs (e.g.wind-introduction-getting-started--default→apollo-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
https://apollo-design.vercel.app/?path=/story/wind-introduction-getting-started--defaultafter deploy — should redirect cleanly to theapollo-wind-*equivalenthttps://apollo-design.vercel.app/with no path — should land on the default Introduction story with no error🤖 Generated with Claude Code