-
Notifications
You must be signed in to change notification settings - Fork 85
feat(version-picker): update version picker to use correct property #7702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
3029b89 to
da986c3
Compare
8ea11ad to
8885827
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a critical bug in the version picker component where it was attempting to set a non-existent content property instead of the correct title property. The changes restore the environment variable check to conditionally enable the version picker and add comprehensive test coverage.
Changes:
- Fixed property reference from
contenttotitlein the version picker's item formatting logic - Reinstated environment variable check (
USE_VERSION_PICKER) to conditionally register the version picker addon - Added comprehensive test suite covering success states, error handling, URL parameters, and fallback scenarios
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.storybook/version-picker/index.tsx |
Corrected the property name from content to title when appending "(latest)" label and updated TypeScript types |
.storybook/manager.ts |
Added environment variable check to conditionally register the version picker addon |
.storybook/version-picker/version-picker.test.tsx |
Added comprehensive test coverage including success states, error handling, HTTP failures, and URL parameter parsing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .sort((a, b) => compareBuild(b.id, a.id)); | ||
|
|
||
| formattedVersions[0].content = `${formattedVersions[0].content} (latest)`; | ||
| formattedVersions[0].title = `${formattedVersions[0].title} (latest)`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-blocking
| formattedVersions[0].title = `${formattedVersions[0].title} (latest)`; | |
| formattedVersions[0].title += " (latest)"; |
Proposed behaviour
Current behaviour
Checklist
d.tsfile added or updated if requiredQA
Additional context
Testing instructions