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

CSF: Stylized title generation #11186

Closed
shilman opened this issue Jun 16, 2020 · 3 comments
Closed

CSF: Stylized title generation #11186

shilman opened this issue Jun 16, 2020 · 3 comments

Comments

@shilman
Copy link
Member

shilman commented Jun 16, 2020

Provide a method for stylized title generation, such as automatically generating a title based on file path or a template based approach with a set of known macros.

Why

Currently there are two options: fully static or fully dynamic titles. Fully dynamic titles (e.g. #10959) is a flexible way for users to configure Storybook's navigation sidebar in CSF based on things like file paths of the story files. Unfortunately, fully dynamic titles are difficult for tools to statically analyze, leading to limitations in the tooling.

What

Some options, TBD:

  1. Automatic title generation by default based on the path to the file (which can be manually overridden using a static title)
  2. A set of known macros (similar to __dirname)
@jackkoppa
Copy link

Thanks for creating this, @shilman - we came across this issue while trying out Storybook 6, and it took us a while to dig down to the root cause of #9582

Happy to see #10959 address that in at least some way, but I think we'd also be very happy with a standardized, filesystem-based approach to allow easy static analysis to continue, given that we're probably going to try to use static names for now, and see how unwieldy it feels (~30 components at the moment). Let us know if there's anything we can give feedback on or help with

@SamKirkland
Copy link
Contributor

We currently have over a thousand stories. This would be an amazing feature.

@shilman
Copy link
Member Author

shilman commented Jul 6, 2021

Fixed in #15376

@shilman shilman closed this as completed Jul 6, 2021
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

3 participants