-
Notifications
You must be signed in to change notification settings - Fork 3
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
How do I correctly link to my storybook? #6
Comments
Bump. Looks like the button "Open in Storybook" defaults to the first story.
|
Hi Jurrian, There are a couple of question I'd like to ask about your setup. Button story you shared has only one story. export default {
title: 'Button', // -----> Story kind
component: Button,
decorators: [withA11y],
};
...
...
DefaultButton.story = {
name: 'default', // ------------> Story name
parameters: {
options: { selectedPanel: 'storybook/actions/panel' },
},
}; Checkout my comments on the code sample. Kind parameter is OK but you override story name as Another thing, I see that you also have manually defined some story names in the configuration file. Those values manually generate links without connecting to Storybook itself, just by using their URL format. Do those stories exist on a separate file? Can you see any of the links in Zeplin like Alexey has shown above? If you see them, are they correct? |
Hi Yuqu, Thanks for the fast response! I actually didn't know that by defining the story name it overwrites storyId. It is in no way my goal to manipulate the story's name. I've made some small changes in the meantime and it seems that Zeplin redirects to the right URL, but Storybook gives me this weird error. When I reload the page it doesn't... I'm so confused. I've made a copy of the repo and made it public, so if you like you can see for yourself. 😅 https://github.com/jurrianlammerts/connected-zeplin-components |
What do you see on the address bar when you have a problem on refresh? I gave it a try but could not reproduce it. Reloading the page is working for me but I could say after you open your story successfully, the URL we generated has no effect on Storybook. I remember I was experiencing something like that during the development of the plugin. Opening same link in a fresh browser was always working when that happens, so I was thinking the problem had been related to something on local storage/cookie etc. on Storybook side. |
I have the same issue as @jurrianlammerts , but I can also expand on my scenario a bit more since its not identical: In my
The plugin seems to do a decent job at picking up available stories. There are a couple of stories, first two look like this (and the plugin seems to always default to the first one):
Now to the part where things act up..
If I however append a trailing slash to the configured url (this is where the trailing slash config comes in), the browser (i.e. Storybook) translates [note the trailing slash] ...and at this point I am in the same situation as @jurrianlammerts - on the first load this image is presented: UPDATE: On the second/reload, we are looking at the correct source: UPDATE2: YET ANOTHER UPDATE: So for
to replace
and then If this is the direction you would like to go, I'd be happy to submit a PR. |
Hey @jurrianlammerts, We've got many reports of "No Preview" for the links generated by the plugin. We were using old format hyperlinks for compability between Storybook versions. The plugin now generates new format hyperlinks if the storybook instance is v5+. I've tried it out with your sample repository, it works fine. You don't even need to type in all kind and stories, it will automatically find Button stories. Using the following setup,
generated these links on Zeplin: |
I'm having a hard time figuring out how to link components to Storybook.
This is my connected-components config:
Below is my Button story
The 'Open in Storybook' link opens the following URL:
http://localhost:9009/?path=/story/button--default
But the right URL for this story is:
http://localhost:9009/?path=/story/button--default-button
What is the correct way to link to my story?
The text was updated successfully, but these errors were encountered: