-
-
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
[Bug]: autodocs pages that only contain a single story show the same story twice #20969
Comments
leaving both seems like the "least magical" option to me. i know that i would be confused if i was navigating between docs for single and multiple story components and the default just wasn't there (in the case above) i'd be inclined to leave it as is and see if it bothers anyone. it's a very logical default. |
I tend to agree with @chantastic on this - keeping it is less magical than removing it, but I also get why you'd think that it's a bit weird to see.
@chantastic yes we have plenty of configurations under Background infoThis is caused by the recent decision to also show the primary story in the list below (before, the primary story was always omitted). Which was caused by the question "where do we show the description for the primary story (which is NOT the same as the component description)?" to which the answer was "for consistency, we'll render the primary story in the list below, so it has a place for its description". So if we wanted to get rid of the second story below in this one-story scenario, a question we'd need to answer is "where do we show the description for the story then, while also making it distinguishable from the component description?". |
More feedback here: https://discord.com/channels/486522875931656193/1072612950747132004/1072688449037025350 And here: #20604 (comment) |
I vote hiding the stories section when there's just a single story. It doesn't make sense and looks like a bug, and we're already hearing that from users. |
Alright, and what do you suggest we do with the primary story's description then? Move it up below the component description, or omit it altogether? |
Ermahgerd!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-beta.54 containing PR #21178 that references this issue. Upgrade today to the
|
@yannbf @JReinhold @shilman Hi, what configuration I need to add to show only docs and not stories? |
Do you mean --docs? |
@yannbf exactly!!! can I build a storybook with only docs and deploy it? |
Yes, please read the docs that I shared, it covers that. Also, you please use the https://discord.gg/storybook discord community for more questions, you will probably get better help there! |
@yannbf great, that's what I'm looking for |
Describe the bug
To Reproduce
Access a Storybook 7 project with autodocs, and create a single story for a component. Look at the docs entry and you will see two component, which seems redundant.
One would assume that there should be no need to display the same component twice, while others might argue the top one is a playground, and the bottom one is the fixed story (with original looks). Providing the story at the bottom when there are multiple stories does seem to make more sense, it just feels weird when there is a single story.
The text was updated successfully, but these errors were encountered: