-
-
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: Add an experimental API for adding sidebar bottom toolbar #23778
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.
Seems pretty neat!
Couple comments/qns:
-
Naming: maybe it should be
SIDEBAR_BOTTOM
? I feel likeBOTTOM
is a bit ambiguous and we might regret it later? -
Are we thinking down the track we might remove this API in favour of a tighter API that only allows you to put sidebar filtering buttons in this space? If so, we should make it clear in the jsdoc that it's intended to be a temporary API.
-
How does it work if two addons put buttons in the space and then we turn a filter on? Wouldn't we want the space to only display the "clear" button of a single addon at that point? How are we thinking about that in this more general API? (This is a reason why I think a more constrained API might be a better idea)
@tmeasday I think this slot is not JUST for filtering buttons. That's what we'll use it for, but not necessarily what other addon creators will be using it for. Adding and disabling filter functions is simply replacing filter functions with different ones. |
I'd seem wise for addons to be conservative when adding items in this slot. But it's not something we can really control.
Each filter-function has a unique id, addons know the id they injected, so they can replace that one.
When multiple filters are active, if 1 filter removes an item, it's gone, even if the other filter would allow it.
Let's generalize when the pattern has more then 1 use. |
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.
Co-authored-by: Yann Braga <[email protected]>
@yannbf I'm now no longer rendering the bottom bar during loading. |
That's pretty good @ndelangen! There is still some layout shift, but I think that's quite minor and we can do something about it at a later iteration |
add notice when index is empty that this could be caused by filter-functions
Telescoped off: #23722
What I did
I added a new type of addon that will be injected into a new bottom bar of the sidebar.
It looks like this:
How to test
Here's how to use it:
Checklist
MIGRATION.MD
Maintainers
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/src/sandbox-templates.ts
["cleanup", "BREAKING CHANGE", "feature request", "bug", "build", "documentation", "maintenance", "dependencies", "other"]
🦋 Canary release
This pull request has been released as version
0.0.0-pr-23778-sha-fa3b4d8f
. Install it by pinning all your Storybook dependencies to that version.More information
0.0.0-pr-23778-sha-fa3b4d8f
norbert/add-sidebar-footer-slot
fa3b4d8f
1692797052
)To request a new release of this pull request, mention the
@storybookjs/core
team.core team members can create a new canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=23778