-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Blocks: IconGallery improvement #30743
base: next
Are you sure you want to change the base?
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.
LGTM
2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
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.
LGTM
2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
View your CI Pipeline Execution ↗ for commit b58f98b.
☁️ Nx Cloud last updated this comment at |
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.
LGTM
2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
Before | After | Difference | |
---|---|---|---|
Dependency count | 3 | 54 | 🚨 +51 🚨 |
Self size | 445 KB | 445 KB | 🚨 +44 B 🚨 |
Dependency size | 2.81 MB | 12.47 MB | 🚨 +9.66 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-interactions
Before | After | Difference | |
---|---|---|---|
Dependency count | 5 | 54 | 🚨 +49 🚨 |
Self size | 129 KB | 129 KB | 🚨 +70 B 🚨 |
Dependency size | 3.11 MB | 12.49 MB | 🚨 +9.39 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/experimental-addon-test
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 58 | 🚨 +58 🚨 |
Self size | 0 B | 845 KB | 🚨 +845 KB 🚨 |
Dependency size | 0 B | 13.95 MB | 🚨 +13.95 MB 🚨 |
Bundle Size Analyzer | Link | Link |
storybook
Before | After | Difference | |
---|---|---|---|
Dependency count | 98 | 51 | 🎉 -47 🎉 |
Self size | 21.54 MB | 19.39 MB | 🎉 -2.15 MB 🎉 |
Dependency size | 21.69 MB | 14.26 MB | 🎉 -7.43 MB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/experimental-nextjs-vite
Before | After | Difference | |
---|---|---|---|
Dependency count | 141 | 180 | 🚨 +39 🚨 |
Self size | 215 KB | 236 KB | 🚨 +21 KB 🚨 |
Dependency size | 39.38 MB | 49.14 MB | 🚨 +9.76 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/nextjs
Before | After | Difference | |
---|---|---|---|
Dependency count | 540 | 584 | 🚨 +44 🚨 |
Self size | 219 KB | 475 KB | 🚨 +257 KB 🚨 |
Dependency size | 58.82 MB | 83.40 MB | 🚨 +24.58 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/react-native-web-vite
Before | After | Difference | |
---|---|---|---|
Dependency count | 172 | 172 | 0 |
Self size | 35 KB | 45 KB | 🚨 +10 KB 🚨 |
Dependency size | 24.32 MB | 24.31 MB | 🎉 -8 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/react-vite
Before | After | Difference | |
---|---|---|---|
Dependency count | 122 | 124 | 🚨 +2 🚨 |
Self size | 31 KB | 15 KB | 🎉 -16 KB 🎉 |
Dependency size | 20.47 MB | 20.49 MB | 🚨 +21 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/svelte-vite
Before | After | Difference | |
---|---|---|---|
Dependency count | 131 | 131 | 0 |
Self size | 61 KB | 23 KB | 🎉 -38 KB 🎉 |
Dependency size | 36.55 MB | 36.56 MB | 🚨 +14 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/svelte-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 311 | 311 | 0 |
Self size | 9 KB | 7 KB | 🎉 -2 KB 🎉 |
Dependency size | 40.61 MB | 40.62 MB | 🚨 +7 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/sveltekit
Before | After | Difference | |
---|---|---|---|
Dependency count | 139 | 139 | 0 |
Self size | 100 KB | 48 KB | 🎉 -52 KB 🎉 |
Dependency size | 39.89 MB | 39.87 MB | 🎉 -24 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/vue3-vite
Before | After | Difference | |
---|---|---|---|
Dependency count | 104 | 104 | 0 |
Self size | 34 KB | 17 KB | 🎉 -17 KB 🎉 |
Dependency size | 42.74 MB | 42.75 MB | 🚨 +9 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/vue3-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 495 | 495 | 0 |
Self size | 24 KB | 7 KB | 🎉 -17 KB 🎉 |
Dependency size | 57.01 MB | 57.02 MB | 🚨 +9 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/web-components-vite
Before | After | Difference | |
---|---|---|---|
Dependency count | 12 | 12 | 0 |
Self size | 20 KB | 6 KB | 🎉 -14 KB 🎉 |
Dependency size | 1.94 MB | 1.94 MB | 🚨 +7 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/web-components-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 245 | 245 | 0 |
Self size | 20 KB | 7 KB | 🎉 -14 KB 🎉 |
Dependency size | 32.62 MB | 32.62 MB | 🚨 +7 KB 🚨 |
Bundle Size Analyzer | Link | Link |
sb
Before | After | Difference | |
---|---|---|---|
Dependency count | 99 | 52 | 🎉 -47 🎉 |
Self size | 1 KB | 1 KB | 0 B |
Dependency size | 43.24 MB | 33.65 MB | 🎉 -9.58 MB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/cli
Before | After | Difference | |
---|---|---|---|
Dependency count | 388 | 356 | 🎉 -32 🎉 |
Self size | 284 KB | 281 KB | 🎉 -3 KB 🎉 |
Dependency size | 93.38 MB | 84.30 MB | 🎉 -9.08 MB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/codemod
Before | After | Difference | |
---|---|---|---|
Dependency count | 309 | 274 | 🎉 -35 🎉 |
Self size | 614 KB | 617 KB | 🚨 +3 KB 🚨 |
Dependency size | 74.99 MB | 65.89 MB | 🎉 -9.10 MB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/test
Before | After | Difference | |
---|---|---|---|
Dependency count | 48 | 51 | 🚨 +3 🚨 |
Self size | 1.82 MB | 1.82 MB | 🚨 +24 B 🚨 |
Dependency size | 7.42 MB | 7.85 MB | 🚨 +425 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/html
Before | After | Difference | |
---|---|---|---|
Dependency count | 2 | 2 | 0 |
Self size | 38 KB | 47 KB | 🚨 +9 KB 🚨 |
Dependency size | 32 KB | 32 KB | 0 B |
Bundle Size Analyzer | Link | Link |
@storybook/vue3
Before | After | Difference | |
---|---|---|---|
Dependency count | 13 | 13 | 0 |
Self size | 78 KB | 87 KB | 🚨 +9 KB 🚨 |
Dependency size | 6.13 MB | 6.13 MB | 0 B |
Bundle Size Analyzer | Link | Link |
@storybook/web-components
Before | After | Difference | |
---|---|---|---|
Dependency count | 3 | 3 | 0 |
Self size | 55 KB | 62 KB | 🚨 +7 KB 🚨 |
Dependency size | 47 KB | 47 KB | 0 B |
Bundle Size Analyzer | Link | Link |
Closes #24764
What I did
I tried to improve the IconGallery using an approach that tries to balance between displaying the content of the icon label as much as possible and keeping the gallery layout consistent with long labels. This means that if the label is long it will be displayed on up to 2 lines, but if it is so long that it does not fit on 2 lines the content will be truncated, prioritizing the visual consistency of the gallery layout.
In addition, I changed the gallery layout implementation using CSS grid and reduced the font size of the label so that more cases where the label content is too long will not be truncated.
I added two cases in the block stories for example. Here are some screenshots:


Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
yarn storybook:ui
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.ts
Make sure this PR contains one of the labels below:
Available labels
bug
: Internal changes that fixes incorrect behavior.maintenance
: User-facing maintenance tasks.dependencies
: Upgrading (sometimes downgrading) dependencies.build
: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup
: Minor cleanup style change. Will not show up in release changelog.documentation
: Documentation only changes. Will not show up in release changelog.feature request
: Introducing a new feature.BREAKING CHANGE
: Changes that break compatibility in some way with current major version.other
: Changes that don't fit in the above categories.🦋 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
Improved IconGallery component to handle long icon labels by implementing CSS grid layout and text truncation after two lines, ensuring consistent visual presentation.
code/lib/blocks/src/components/IconGallery.tsx
for better layout controlItemLabel
styled componentIconGallery.stories.tsx
with long icon names to demonstrate truncation💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!