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

Navigating from a story’s Docs panel to a story with the Docs panel hidden still shows that story’s Docs panel. #14111

Open
brandondurham opened this issue Mar 3, 2021 · 1 comment

Comments

@brandondurham
Copy link

Describe the bug
I’ve hidden the Docs tab in my story using the following parameter:

<Meta
	component={ AppFrame }
	parameters={{
		previewTabs: {
			'storybook/docs/panel': {
				hidden: true,
			},
		},
	}}
	title="Docs/Grid"
/>

The tab is hidden when you go directly to the story, but if you navigate to another story, click the Docs tab for that story, then navigate back to the Docs/Grid story, you’re in the Docs panel, even though Docs is hidden for that story.

To Reproduce
Steps to reproduce the behavior:

  1. Add the following config to a story to hide the Docs tab:

    <Meta
        parameters={{
      	  previewTabs: {
      		  'storybook/docs/panel': {
      			  hidden: true,
      		  },
      	  },
        }}
    />
  2. Navigate to a different story that doesn’t have the “Docs” tab hidden.

  3. Click the “Docs” tab.

  4. Navigate back to the original story with the hidden “Docs” tab.

  5. This story will be in the “Docs” panel, even though it should be hidden.

Expected behavior
I would expect that when navigating to a story with a hidden “Docs” panel from another story’s “Docs” panel, you would be redirected to the default “Canvas” panel for that story.

Screenshots
This is what it looks like when you’ve navigated back to the story with the hidden “Docs” tab from another story’s “Docs” panel.
image

Code snippets
This is the config I have set up for the story with. the hidden “Docs” panel:

<Meta
	component={ AppFrame }
	parameters={{
		controls: { disable: true },
		previewTabs: {
			'storybook/docs/panel': {
				hidden: true,
			},
		},
	}}
	title="Docs/Grid"
/>

System

Environment Info:

  System:
    OS: macOS 11.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 15.6.0 - ~/.nvm/versions/node/v15.6.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.4.0 - ~/.nvm/versions/node/v15.6.0/bin/npm
  Browsers:
    Chrome: 88.0.4324.192
    Firefox: 84.0.2
    Safari: 14.0.2
  npmPackages:
    @storybook/addon-a11y: ^6.1.17 => 6.1.17
    @storybook/addon-actions: ^6.1.17 => 6.1.17
    @storybook/addon-essentials: ^6.1.17 => 6.1.17
    @storybook/addon-links: ^6.1.21 => 6.1.21
    @storybook/react: ^6.1.17 => 6.1.17
    @storybook/theming: ^6.1.17 => 6.1.17
@ajkl2533
Copy link
Contributor

ajkl2533 commented Apr 7, 2021

@brandondurham you can add viewMode: 'story', into parameters for stories with disabled docs. After that, it will redirect into the canvas tab even when you were on docs before.

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

3 participants