storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.21k stars 9.26k forks source link

View mode "docs" seems to be ignored #10233

Closed jonhuteau closed 4 years ago

jonhuteau commented 4 years ago

Describe the bug

After upgrading from 6.0.0-alpha.28 to 6.0.0-alpha.29, it looks like all my default URLs of stories are wrong.

When I navigate between stories, I have http://localhost:6006/?path=/story/packages-ui-box even if in my MDX I define viewMod to docs (should be /docs/packages-ui-box).

Set addParameters({ viewMode: 'docs' }) in preview.js doesn't seem to fix this.

Expected behavior

I'd like to render docs page instead of story one by default.

Code snippets

<Meta
  title='Packages/UI/Box'
  component={AaBox}
  parameters={{ 'viewMode': 'docs', subcomponents: {'aa-box-footer': AaBoxFooter} }}
/>

System:

Environment Info:

  System:
    OS: Linux 4.15 Ubuntu 18.04.4 LTS (Bionic Beaver)
    CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
  Binaries:
    Node: 12.16.1 - /usr/bin/node
    npm: 6.14.4 - /usr/bin/npm
  Browsers:
    Chrome: 80.0.3987.149
    Firefox: 74.0
  npmPackages:
    @storybook/addon-a11y: ^6.0.0-alpha.29 => 6.0.0-alpha.29 
    @storybook/addon-docs: ^6.0.0-alpha.29 => 6.0.0-alpha.29 
    @storybook/addon-jest: ^6.0.0-alpha.29 => 6.0.0-alpha.29 
    @storybook/addon-knobs: ^6.0.0-alpha.29 => 6.0.0-alpha.29 
    @storybook/addon-viewport: ^6.0.0-alpha.29 => 6.0.0-alpha.29 
    @storybook/addons: ^6.0.0-alpha.29 => 6.0.0-alpha.29 
    @storybook/vue: ^6.0.0-alpha.29 => 6.0.0-alpha.29 
shilman commented 4 years ago

cc @ndelangen

marchaos commented 4 years ago

Seeing the same.

shilman commented 4 years ago

Ooh-la-la!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-alpha.44 containing PR #10292 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

jonhuteau commented 4 years ago

Can confirm it's fixed in v6.0.0-alpha.44. Thanks a lot !