Toolbar: Remove extra toolbar divider when zoom controls not shown#33731
Merged
valentinpalkovic merged 2 commits intostorybookjs:nextfrom Feb 3, 2026
Merged
Conversation
Fixes storybookjs#21429 In docs mode, the menu tool was rendering a Separator that had no tools following it, causing an orphaned divider to appear in the toolbar. The Separator in menuTool is intended to visually separate the menu button from subsequent tools (like remountTool). However, in docs mode, remountTool and other left-side tools are filtered out by their match function, leaving the separator with nothing to separate. The fix makes the Separator conditional on viewMode === 'story', since that's when the other left-side tools are actually visible.
Contributor
📝 WalkthroughWalkthroughAdded viewMode state to the menu component's data mapping and implemented conditional rendering of a Separator element based on the current view mode, ensuring the separator only displays when viewMode equals 'story'. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
valentinpalkovic
approved these changes
Feb 3, 2026
valentinpalkovic
approved these changes
Feb 3, 2026
8 tasks
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 18 | 18 | 0 |
| Self size | 1.66 MB | 1.64 MB | 🎉 -18 KB 🎉 |
| Dependency size | 9.25 MB | 9.25 MB | 🎉 -565 B 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/addon-vitest
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 2 | 2 | 0 |
| Self size | 403 KB | 382 KB | 🎉 -21 KB 🎉 |
| Dependency size | 338 KB | 338 KB | 🎉 -3 B 🎉 |
| Bundle Size Analyzer | Link | Link |
storybook
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 49 | 49 | 0 |
| Self size | 20.21 MB | 20.40 MB | 🚨 +190 KB 🚨 |
| Dependency size | 16.52 MB | 16.52 MB | 🎉 -2 B 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 534 | 534 | 0 |
| Self size | 650 KB | 646 KB | 🎉 -4 KB 🎉 |
| Dependency size | 59.89 MB | 59.93 MB | 🚨 +34 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 92 | 92 | 0 |
| Self size | 1.12 MB | 1.12 MB | 🎉 -1 KB 🎉 |
| Dependency size | 22.45 MB | 22.49 MB | 🚨 +32 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-native-web-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 124 | 124 | 0 |
| Self size | 30 KB | 30 KB | 🎉 -154 B 🎉 |
| Dependency size | 23.74 MB | 23.77 MB | 🚨 +32 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 82 | 82 | 0 |
| Self size | 35 KB | 35 KB | 🎉 -98 B 🎉 |
| Dependency size | 20.24 MB | 20.27 MB | 🚨 +32 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-webpack5
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 271 | 271 | 0 |
| Self size | 24 KB | 24 KB | 🎉 -74 B 🎉 |
| Dependency size | 44.52 MB | 44.55 MB | 🚨 +34 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/cli
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 183 | 183 | 0 |
| Self size | 779 KB | 776 KB | 🎉 -3 KB 🎉 |
| Dependency size | 67.35 MB | 67.50 MB | 🚨 +147 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/codemod
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 176 | 176 | 0 |
| Self size | 32 KB | 32 KB | 🎉 -70 B 🎉 |
| Dependency size | 65.88 MB | 66.07 MB | 🚨 +190 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
create-storybook
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 50 | 50 | 0 |
| Self size | 1.04 MB | 1000 KB | 🎉 -43 KB 🎉 |
| Dependency size | 36.74 MB | 36.93 MB | 🚨 +190 KB 🚨 |
| Bundle Size Analyzer | node | node |
@storybook/preact
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 2 | 2 | 0 |
| Self size | 23 KB | 16 KB | 🎉 -7 KB 🎉 |
| Dependency size | 32 KB | 32 KB | 🎉 -3 B 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 58 | 57 | 🎉 -1 🎉 |
| Self size | 1.19 MB | 1.23 MB | 🚨 +36 KB 🚨 |
| Dependency size | 13.19 MB | 12.93 MB | 🎉 -264 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
Merged
1 task
This was referenced Mar 18, 2026
Merged
1 task
This was referenced Mar 18, 2026
This was referenced Mar 31, 2026
1 task
This was referenced Apr 2, 2026
1 task
This was referenced Apr 5, 2026
1 task
This was referenced Apr 6, 2026
1 task
This was referenced Apr 8, 2026
Closed
1 task
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.
Description
Fixes #21429
In docs mode, an extra divider/separator was appearing in the toolbar even though no tools followed it.
Problem
The
menuToolcomponent renders a<Separator />after the menu button. This separator is intended to visually separate the menu button from subsequent tools (likeremountTool).However, in docs mode:
remountToolhasmatch: ({ viewMode }) => viewMode === 'story'menuToolstill renders its separatorSolution
Made the
<Separator />conditional onviewMode === 'story', since that's when the other left-side tools are actually visible.Before/After
Before (docs mode):
After (docs mode):
Story mode (unchanged):
Summary by CodeRabbit