[Bug]: Docs stories filtered with '!autodocs'
behaves weird in Primary
, Stories
, Controls
, etc. components
#27048
Labels
'!autodocs'
behaves weird in Primary
, Stories
, Controls
, etc. components
#27048
Describe the bug
In 8.1, we introduced the
autodocs
tag per story. It introduces a slightly inconsistent behavior:TheSomewhat fixed in Docs: Fix MDX Stories block tag-filtering behavior #27144Stories
doc block automatically filters out any stories that don't have'autodocs'
- even if it is in a manually written attached MDX. Is that weird?Primary
doc block doesn't take the filter into account at all, meaning that if the primary story has'!autodocs'
it will still be selected as the primary story. Should it?Controls
and any other doc block supporting primary stories.useOf
andresolveOf
doesn't do any automatic filtering, causing the issue with 2 and 3 above. We briefly explored filtering out all'!autodocs'
stories internally inDocsContext
to solve all problems above, but that wasn't the best idea. It would make it impossible to resolve a story with'!autodocs'
in a manual MDX, which seems counter intuitive.I don't know what the right solution is here, or if there even is any, but we should be aware of this.
Additional context
@shilman proposes that all Storybook-provided doc blocks should automatically filter out
'!autodocs'
stories - even when used manually in MDX/DocsPage, S a way for users to easily re-create the autodocs experience.But all user-written doc blocks (those that use
useOf()
orresolveOf()
) should not do automatic filtering. Instead we should provide the tools to apply a filter if needed, either by passing afilter: true
boolean somewhere, or make the filter function easily accessible.The text was updated successfully, but these errors were encountered: