-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
UI: Fix tags sort for browser back-compat #30547
Conversation
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.
1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
const tags = Array.from(allTags); | ||
tags.sort(); |
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.
logic: mutates the original array since .sort() modifies in place. Consider using [...allTags] to create a new array
const tags = Array.from(allTags); | |
tags.sort(); | |
const tags = [...Array.from(allTags)].sort(); |
View your CI Pipeline Execution ↗ for commit 0f256ad.
☁️ Nx Cloud last updated this comment at |
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
Before | After | Difference | |
---|---|---|---|
Dependency count | 108 | 108 | 0 |
Self size | 17 KB | 17 KB | 0 B |
Dependency size | 42.60 MB | 42.61 MB | 🚨 +12 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/vue3
Before | After | Difference | |
---|---|---|---|
Dependency count | 17 | 17 | 0 |
Self size | 87 KB | 87 KB | 0 B |
Dependency size | 6.13 MB | 6.14 MB | 🚨 +12 KB 🚨 |
Bundle Size Analyzer | Link | Link |
UI: Fix tags sort for browser back-compat (cherry picked from commit be2ef66)
Closes #30545
What I did
Downgrade from
toSorted
tosort
for compatibility with older browsers.Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
Click the tags filter and observe that the tags are sorted.
🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/core
team here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>
Greptile Summary
This PR addresses a browser compatibility issue by replacing the
.toSorted()
array method with.sort()
in the TagsFilter component to support older browsers like Chrome 91./code/core/src/manager/components/sidebar/TagsFilter.tsx
from.toSorted()
to.sort()