-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
CHANGE isToolshown logic so it hides toolbar if there's only (hidden) canvas #10599
Conversation
Will this also make storybook navigate to the first non hidden tab? |
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.
Not obvious to me how this corresponds to the original issue. Can you provide a test, or a comment on why this logic makes sense?
const isToolshown = | ||
!(viewMode === 'docs' && tabs.filter((t) => !t.hidden).length < 2) && options.isToolshown; |
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.
When the viewMode is docs, we only show tabs
When the number of tabs is 1, there's no point in showing them
When we don't show anything, the toolbar should be collapsed
AFAIK this was exactly the issue in #10592
This code makes it so when there's only 1 tab shown in docsmode the toolbar collapses
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.
I didn't repro #10592 but @hipstersmoothie 's issue is that "nothing is rendered". AFAICT this change renders even less than what was there before, so I don't understand how this could solve that.
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.
I can set up an example repo if neeed
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.
Best is repro in official-storybook
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.
@ndelangen @shilman I've ran this locally and the only issue I see is that on initial load,
the MDX docs-only
page that I select on SET_STORIES
shows the toolbar like:
and after navigate another story with Canvas/Docs tab, and going back, it's not shown:
the tabs/reordering seems to work fine with beta.22
:D
now I'd like to know how to set the selectedTab
in a similar way as selectedPanel
hehe
@ndelangen I've confirmed that one of my issues (#10294)
|
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
I'm just gonna close this if those doesn't fix any issues people are having. |
@ndelangen this fixes an empty toolbar for docsOnly pages: the only missing detail is the initial-state, but this does PR the job |
@matheo would you have some time to make any changes to this PR you deem necessary? |
@ndelangen I'm not quite familiar with React's state management to figure out the initial-value fix. For me this PR does an important part of the job tho. I'm +1 to merge this and avoid the empty toolbar div first. |
Issue: #10592
What I did
Fixed a bug where the toolbar might be shown with nothing in it.