-
-
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
5.0.0-rc.9: Option sortStoriesByKind is not working #5827
Comments
Also an issue with the other options in the ui object: enableShortcuts and sidebarAnimations |
This is still happening in 5.0.1 for us. |
Uncertain if it's related but I've also found since updating to 5.0.1 (from a 4.* ver) that my welcome story that used to show up as the first thing is now showing up as the last, no matter how I play around with naming conventions or import order. |
I have the same with this options
|
It does not seem like |
My hope is that there's some kind of API in the works that'll allow us to provide our own sorting function! ❤️ In v4, we had hacked something into Would be soooo sweet to be able to supply |
Still not working in v5.0.5 |
I found out that the order of the stories is now sorted by the folder name where there story is inside. To make a correct ordering you can rename the folder to the same structure you want to see. I will rename my folders to 01_feature/... 02_feature/... and so on |
Hm, I have the stories co-located to the actual implementation of the component. I wouldn't want to order my UI components in folders based on how Storybook wants to have it, but rather how it fits best for my UI libraries project folder structure. So that's no option for me unfortunately |
Pure WTF. @leoyli @shilman @ndelangen Please remove from documentation, or show a giant warning next to each option which is "todo" |
is there another way to sort these stories? |
Looks like we'll have a way soon: #6472 |
We're in the final phase of the 5.1 release. I just had a short discussion with @shilman & @tmeasday about this, and although #6472 is very promising, we feel it's a bit too late into the process to merge this into 5.1. This will be get fixed in v5.2. Reason being: |
apparently was resolved in 5.1.0-rc.5 ? |
@DanielG2002 We removed from the docs, but didn't actually solve the issue AFAIK. Is it working for you now? |
@shilman well, I did a test on 5.1.1 and conclusions are:
|
If sortStoriesByKind is not working, the issue isn't resolved, is it? |
correct!, not resolved |
This is in the pipeline for 5.2 however! |
We released #6472 in |
Thank you @shilman 🎉 Tried it in 5.2.0-alpha.35 and it worked. Just in case: sortStoriesByKind changed to storySort and expects a function now.
|
Hello, I'm sorry if it's a silly question 😅 But I'm not used to Where do these Thank you for your help 😊 |
@mlegait I think
|
@rwieruch Thank you for your response :) When I log a and b, I get something like that:
So it's perfect if I want to sort stories alphabetically but I'd like to sort them manually. Is it possible to add a custom field |
@mlegait You could add a story parameter and sort by that? storiesOf(...).add('foo', () => <Foo />, { order: 1 }); In the new component story format: export const foo = () => <Foo/>;
foo.story = {
parameters: { order: 1 }
}; Pretty sure it will show up in |
Thank you very much for your quick answer :) I tried with
It's perfect! It'll allow me to order stories manually. I'm currently testing the new plugin addon-docs, which is so promising, and I was wondering if it's possible to do something similar in a mdx file in the |
@mlegait |
Perhaps the custom order is a a good addition for the docs :) |
works perfectly! I'll use this workaround while waiting for the final version. Thank you very much for your help 😄 |
@mlegait 💯💪🎉 |
FIXME: Need to deprecate this in favor of |
This has been documented, closing: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#storysort-option |
You can fix this with To choose a file or component as your landing file, you can specify in your
To sort stories alphabetically, you can do this
|
sortStoriesByKind is not working, true/false it's the same.
5.0.0-rc.9
The text was updated successfully, but these errors were encountered: