Allow specifying story name weights for universal sorting regardless of hierarchy #27521
chimericdream
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
My team has a monorepo set up where all of the docs are aggregated under a single Storybook instance. Because we have a mixture of apps, services, and libraries in the monorepo, there are multiple layers where we have a quasi-top-level "Intro to (thing)" page. Unfortunately, I can't dynamically instruct Storybook to always keep pages with the title "Introduction" sorted above their siblings, regardless of level.
Here is a trimmed-down version of my
storySort
option as it is today:Describe the solution you'd like
I'd like to be able to specify a relative weight to certain titles that affect the sorting, regardless of where they exist in the overall hierarchy. Essentially, I'd like to do something like this:
Describe alternatives you've considered
I started trying to write a custom
storySort
function, but it started to become overly complex. The other alternative, which is what we are currently doing, is to add an additional layer of['Introduction']
or even['Introduction', ['*', ['Introduction']]]
whenever a new case comes up where a library, sub-section, etc is added to the monorepo.Are you able to assist to bring the feature to reality?
Maybe, but I don't want to over-promise.
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions