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

[addon-docs] Add a check for multiple stories before rendering the Stories component in the DocsPage. #9269

Closed
afebbraro opened this issue Dec 30, 2019 · 1 comment

Comments

@afebbraro
Copy link
Contributor

afebbraro commented Dec 30, 2019

Bug or support request summary

Check for multiple stories before rendering the the Stories component in the DocsPage. Without this check, unnecessary rendering of the Stories component headline would occur.

Expect to not see a "Stories" headline with nothing underneath it.

Steps to reproduce

Go to the examples HTML storybook app and check out a component that only has one story. For example, '/docs/addons-centered--story-1'. You will see that there is a headline at the bottom that reads "Stories". This headline is not needed. This happens in react/angular ETC ETC too. Just using the HTML one as an example to help explain the problem.

This is current in SB HTML. You can see the unneeded "Stories" heading.
Screen Shot 2019-12-30 at 10 57 35 AM

This is with my PR #9269. The heading is removed because there is only one story.
Screen Shot 2019-12-30 at 11 15 32 AM

Please specify which version of Storybook and optionally any affected addons that you're running

  • @storybook/html x v5.3.0-rc.4

  • @storybook/addon-docs v5.3.0-rc.4

  • but happens in all frameworks!

@afebbraro afebbraro changed the title Added a check for multiple stories before rendering the the Stories component in the DocsPage. Add a check for multiple stories before rendering the the Stories component in the DocsPage. Dec 30, 2019
@afebbraro afebbraro changed the title Add a check for multiple stories before rendering the the Stories component in the DocsPage. [addon-docs] Add a check for multiple stories before rendering the Stories component in the DocsPage. Dec 30, 2019
@shilman
Copy link
Member

shilman commented Dec 30, 2019

Gadzooks!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.3.0-rc.5 containing PR #9271 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants