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

[Bug]: Storybook v7 (Beta 54) does not respect parameters.options.storySort #21322

Closed
RobinBertilsson opened this issue Mar 1, 2023 · 3 comments · Fixed by #21353
Closed
Assignees

Comments

@RobinBertilsson
Copy link

Describe the bug

According to the documentation, you should be able to sort your stories by defining the storySort object (or method), but neither works in the latest beta version of Storybook v7.

I'm using @storybook/react (with TypeScript).

To Reproduce

  1. Clone https://github.com/RobinBertilsson/storybook-v7-sort-order-issue
  2. Run npm install.
  3. Run npm run storybook.
  4. The expected order, according to storySort.order would be Button, Introduction, Header, Page, but it's not.

System

Environment Info:

  System:
    OS: macOS 13.2.1
    CPU: (8) arm64 Apple M1 Pro
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
  Browsers:
    Chrome: 110.0.5481.177
    Firefox: 110.0
    Safari: 16.3

Additional context

No response

@tmeasday
Copy link
Member

tmeasday commented Mar 2, 2023

@shilman this is due to the change to the default export, we need to update this code:

export const getStorySortParameter = (previewCode: string) => {

@shilman
Copy link
Member

shilman commented Mar 2, 2023

Jeepers creepers!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-beta.60 containing PR #21353 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb@next upgrade --prerelease

@RobinBertilsson
Copy link
Author

Lovely @shilman, thanks for the quick help! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants