Skip to content
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

check if docsOnly is set to hide the addon panels #9687

Merged
merged 1 commit into from
Jan 31, 2020

Conversation

atanasster
Copy link
Member

Issue: #9684

What I did

added additional check for docsOnly for hiding addon panels
the use case is what user goes to a 'story' path out of a mdx page

How to test

the flow of this code is really complicated, I have the use cases in official-storybook but comes also that depending on the setup it can get even more complicated.
At some point, you might decide to not set 'story' by default if user navigates to the main age - and show addons/toolbars only after the first story was loaded, so we know if its a documentation only story. There will be a slight delay to displaying the addon panel if its actually a canvas story, but long term will avoid UI complications

Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems right to me. I'm a little confused by your comment though -- is there an example in the official storybook that demonstrates this behaviour?

@atanasster
Copy link
Member Author

@tmeasday - the example is provided by the referenced issue.

for example the first page of a storybook is an mdx documentation page and they don't want to show the canvas tab at all. I think its a common practice with a mdx welcome page.

However storybook sets 'story' as the default viewMode and displays addon panels, toolbars even before an actual story is loaded to know f this is a "docsOnly" the story. So currently there is a flicker showing the addon panels and them when the story actually loads, it hides the addon panels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants