-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Configure default tab #12111
Comments
As it turns out this is actually already possible. I've added a
I'm on version |
Maybe I am wrong but is that the same as doing
|
Likely if it's working. Mabye @shilman can give more insight here? |
Yes. |
First page (with clean Application cache) opens tab «Canvas» if even tab «Canvas» is hidden:
|
My versions from package.json
|
Hmm.. Have you tried to do it via the |
Yes. Application cache is clean for your firs visit? My import { PARAM_KEY as docsViewId } from '@storybook/addon-docs/dist/shared';
import { addParameters } from '@storybook/react';
addParameters({
viewMode: docsViewId,
}); |
I've imported |
shouldn't make a difference @openscript |
@openscript |
Yes, I've started the server and then open my storybook with an incognito tab. It works just like expected. Always the docs page is shown first. Here is the whole project: https://github.com/openscript/react-dsv-import |
Is your site using it now? Your site is not being opened tab «Docs» with an incognito. |
No the currently deployed version is outdated. I suggest to clone, install the dependency and run |
I checked your repository on branches: master, develop. It doesn't work: https://i.imgur.com/3Mg34ee.mp4. You see Canvas of MDX which looks like Docs but it isn't Docs. I delete first MDX Story All Demos: https://imgur.com/a/YCZYT5h. |
I've checked it on the develop branch and it works in Firefox and Chromium: I've no idea where is the difference 😕 |
Try to do the same. |
You are right. There is probably a bug:
Even the canvas is hidden it is shown.. |
Maybe you transit this issue to status "open"? :) |
I think it would be better to create a new issue. If I have time later I'll do that. |
Is there a new issue for this? |
I've never created one. |
The problem with I'd prefer to make the Docs tab default, but not at the expense of having to keep clicking Canvas every time I switch components. |
That could be useful in some cases. I think I prefer it in my case, if the docs are looking great, then steer the user onto them, but they can click into Canvas to look at something, almost a kind of drill in. Also hope to see it being simpler to land on the doc page as the user first visits the Storybook. I'm not sure if that's included in this issue or if there's a way I haven't discovered as yet. |
None of the above solutions worked for me. Should this issue be closed? |
With the following in my
|
I'm having this issue as well with a story that I wish to default to docs and have no canvas tab. If I click the story title in the nav it goes to the docs tab, but if I click the story's group (which this is the first story inside) it goes to canvas... missing the parameters I have set. As mentioned, the idea to go to the Docs tab as default for a certain story without messing around what the default behaviour is seems like a nice idea. I may have to put the Docs in Canvas and hide the docs tab to make it work consistently tho :/ |
@thedamon we're getting rid of the docs tab entirely in 7.0, so i don't expect us to fix this in 6.5 unless it's community contributed & an easy fix We're actively working on the Docs behavior for v7 now and would love feedback for what needs to be done to suit your use case. You can read about the changes here: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#docs-changes And you can try it out with:
It's still pretty raw & we'll be adding a bunch of migration support between now & final release |
My usecase is to include a README.md from a package as my story as it doesn't really have a story. I thought using Docs with a content override would work since it's more doc than canvas, but I think now I ought to just stick it in canvas with mdx. I'll have a look tho! |
I think you can do that very directly in v7: // Readme.mdx
import { Meta } from '@storybook/blocks';
import Readme from 'path/to/README.md';
<Readme /> We might even be able to support All that said, I think you should be able to do the same thing in V6:
There's a |
yup. i need to make a wrapper component i think because (for now) we rely on markdown NOT being transcluded in a custom Changelog tab. I just created a component manually like:
Using "Canvas" I should be able to just make the above my story. |
Is there any solution for this ? |
Is your feature request related to a problem? Please describe.
I'm always frustrated when I cannot make it as easy as possible for the user like when the user has to click something unnecessarily.
Describe the solution you'd like
It would be great, if the default tab is configurable. Currently the default tab is always
canvas
.Describe alternatives you've considered
Thanks to #7066 and #9095 we are able to hide the
canvas
tab, but this is not an option, because I want to keep it. My users want to see thedocs
tab by default and switch to another if they need to.Are you able to assist bring the feature to reality?
Yes I can, if you tell me some starting points to implement this.
Additional context
Even though the
canvas
tab is hidden on my start page, the canvas tab is selected by default:Written regarding the storybook version 6.0.12.
The text was updated successfully, but these errors were encountered: