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

Addon-docs: Docs mode shouldn't render "Canvas" & "Docs" tabs #9518

Closed
patricklafrance opened this issue Jan 17, 2020 · 15 comments
Closed

Addon-docs: Docs mode shouldn't render "Canvas" & "Docs" tabs #9518

patricklafrance opened this issue Jan 17, 2020 · 15 comments

Comments

@patricklafrance
Copy link
Member

Describe the bug

In 5.2 when Storybook is compile in --docs mode the "Canvas" & "Docs" tabs are not rendered, which is great.

In 5.3.6 it doesn't seems to be the case anymore:

image

To Reproduce
Steps to reproduce the behavior:

  1. Start storybook with --docs

Expected behavior

"Canvas" & "Docs" tabs are not rendered.

image

Screenshots
If applicable, add screenshots to help explain your problem.

Code snippets
If applicable, add code samples to help explain your problem.

System:

Environment Info:

System:
OS: Windows 10 10.0.17763
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Binaries:
Node: 12.5.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.21.1 - C:\Dev\20_gsoft\sg-orbit\node_modules.bin\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 44.17763.831.0

Additional context
Add any other context about the problem here.

@shilman
Copy link
Member

shilman commented Jan 17, 2020

@patricklafrance Unable to repro. Can you try removing node_modules, reinstalling, maybe localStorage.clear(), removing .cache? I think it's something funny on your machine. (NOTE: it's messed up that --docs is sensitive to this stuff, but I really don't know what's going on)

@patricklafrance
Copy link
Member Author

patricklafrance commented Jan 18, 2020

Ok thanks for the reply, i’ll do some tests and keep you posted.

@patricklafrance
Copy link
Member Author

patricklafrance commented Jan 18, 2020

@shilman the issue occurs when I specify one of these:

addParameters({
    options: {
        showPanel: false,
        panelPosition: "right",
});

Otherwise it works fine.

@tscolbert
Copy link

I'm having this same issue. I removed node_modules, cleared localStorage, and I don't have a .cache to remove. Is there anything else I can do to get the --docs mode to work?

@shilman
Copy link
Member

shilman commented Jan 19, 2020

Are you using the options global parameter like @patricklafrance mentioned above?

@Zunaib
Copy link

Zunaib commented Jan 19, 2020

@patricklafrance is right, works without the
options.
But if you don't want canvas at all, why would you want a panel position ?
Anyways i think panel position has a preference over the --docs tag.

@tscolbert
Copy link

@Zunaib changing the options doesn't make any sort of difference for me.

Right now my config is only

import {configure} from '@storybook/react';
import "./stories.scss";

configure(require.context('../src/components', true, /\.stories\.tsx$/), module);

And I'm still having the issue, after again repeating what @shilman suggested.

Could it be an issue related to to using typescript w/ react?

@Zunaib
Copy link

Zunaib commented Jan 19, 2020

Can you show me you files in .storybook/ folder and the storybook version.
Might suggest a fix

@patricklafrance
Copy link
Member Author

patricklafrance commented Jan 19, 2020

@Zunaib

This is because I deploy 2 storybook, one with Stories & one with Docs only. They both share the same config.

I fix it by not setting the options when I compile my SB for docs only, but I don't see why it wouldn't works out of the box?

let optionsMessingWithDocsMode = {};

if (!isDocs) {
    optionsMessingWithDocsMode = {
        showPanel: false,
        panelPosition: "right"
    };
}

addParameters({
    options: {
        ...optionsMessingWithDocsMode,
        theme: customStorybookTheme,
        storySort: customStorySort
    },
    docs: {
        inlineStories: true
    }
});

@Zunaib
Copy link

Zunaib commented Jan 19, 2020

This should be looked into then by the Storybook Team. I'd try to reproduce it and get back.

@Zunaib
Copy link

Zunaib commented Jan 19, 2020

How's your file structure, is it the new one. Have you migrated yet to new files ?

@stale
Copy link

stale bot commented Feb 9, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Feb 9, 2020
@danielbayerlein
Copy link

Exists a solution for this problem?

@prsdta
Copy link

prsdta commented Apr 2, 2020

Hi, passing by as I had the same issue, @shilman advice worked for me.

I just had to clean the sessionStorage since I used the same browser to browse the development version and the --docs version.

@shilman
Copy link
Member

shilman commented Jun 14, 2023

This is fixed in 7.0 https://storybook.js.org/blog/storybook-7-docs/

@shilman shilman closed this as completed Jun 14, 2023
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

6 participants