UI: Fix tags sort for browser back-compat#30547
Merged
Conversation
Contributor
There was a problem hiding this comment.
1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
Comment on lines
+106
to
+107
| const tags = Array.from(allTags); | ||
| tags.sort(); |
Contributor
There was a problem hiding this comment.
logic: mutates the original array since .sort() modifies in place. Consider using [...allTags] to create a new array
Suggested change
| 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 |
valentinpalkovic
approved these changes
Feb 14, 2025
This was referenced Feb 14, 2025
Merged
shilman
added a commit
that referenced
this pull request
Feb 14, 2025
UI: Fix tags sort for browser back-compat (cherry picked from commit be2ef66)
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.
Closes #30545
What I did
Downgrade from
toSortedtosortfor 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/coreteam 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.tsxfrom.toSorted()to.sort()