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

Deep linking to "kinds" broken in SB5 #5925

Closed
shilman opened this issue Mar 6, 2019 · 12 comments
Closed

Deep linking to "kinds" broken in SB5 #5925

shilman opened this issue Mar 6, 2019 · 12 comments
Assignees
Milestone

Comments

@shilman
Copy link
Member

shilman commented Mar 6, 2019

H/t @NicoleGrondinAlayacare

Confirmed the old behavior in 4.x and the new (regressed) behavior in 5.x.

4.x: https://5c7e1a14bc4b210008a05f9f--storybooks-official.netlify.com/?selectedKind=Addons%7CKnobs.withKnobs

5.x: https://storybooks-official.netlify.com/?selectedKind=Addons%7CKnobs.withKnobs


Click on: https://storybooks-official.netlify.com/?path=/story/ui-menuitem--default

Before anything shows it will automatically re-route to: https://storybooks-official.netlify.com/?path=/story/ui-panel--default

Click on: https://storybooks-official.netlify.com/?selectedKind=UI%7CMenuItem&selectedStory=default&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybook%2Fstories%2Fstories-panel

It will (correctly) reroute to: https://storybooks-official.netlify.com/?path=/story/ui-menuitem--default

But then, before anything shows it will automatically re-route to: https://storybooks-official.netlify.com/?path=/story/ui-panel--default

@tmeasday
Copy link
Member

tmeasday commented Mar 7, 2019

But that's just because there is no story called "UI|MenuItem:default"?

This link works: https://storybooks-official.netlify.com/?path=/story/ui-layout-desktop-mocked--default

@tmeasday
Copy link
Member

tmeasday commented Mar 7, 2019

Not sure what's going on here 🤷‍♂️

@shilman
Copy link
Member Author

shilman commented Mar 7, 2019

Right on. This was a bad URL 👍

Deep linking is working in SB5

@shilman shilman closed this as completed Mar 7, 2019
@NicoleGrondinAlayacare
Copy link

Hum... maybe I'm not getting it. In storybook 4, you could link to storiesOf(X) without naming a specific story and it would default to the first story available.

Now you need to feed the name of a specific story to the url or you get an error screen:
screen shot 2019-03-07 at 9 29 29 am

This makes it more difficult to link to stories from outside storybook.

@shilman
Copy link
Member Author

shilman commented Mar 7, 2019

@tmeasday
Copy link
Member

tmeasday commented Mar 8, 2019

I reckon we can fix this but it's not trivial. Something for 5.1.0?

@shilman shilman changed the title Deep linking broken in SB5 Deep linking to "kinds" broken in SB5 Apr 12, 2019
@tmeasday
Copy link
Member

@tmeasday
Copy link
Member

Ok.

I fixed the regression here: #6688

I still want to look at linking to kind only.

I also worked out that the ordering difference between Safari & Chrome is due to this line: https://github.com/storybooks/storybook/blob/5925-fix-kind-deep-linking/lib/ui/src/components/sidebar/treeview/utils.js#L63

(You are supposed to return 1,0,or -1 from sort, I guess browsers differ if you return a bool).

I don't think the treeview should be sorting at all, due to reasons discussed (namely the keyboard shortcuts will be inconsistent with the treeview == much uggh). I will get rid off this and fix #5827 also

@shilman
Copy link
Member Author

shilman commented May 1, 2019

Boo-yah!! I just released https://github.com/storybooks/storybook/releases/tag/v5.1.0-alpha.37 containing PR #6688 that references this issue. Upgrade today to try it out!

Because it's a pre-release you can find it on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed May 1, 2019
@tmeasday tmeasday reopened this May 1, 2019
@tmeasday
Copy link
Member

tmeasday commented May 1, 2019

More to do

@shilman
Copy link
Member Author

shilman commented May 8, 2019

Zoinks!! I just released https://github.com/storybooks/storybook/releases/tag/v5.1.0-alpha.40 containing PR #6720 that references this issue. Upgrade today to try it out!

Because it's a pre-release you can find it on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed May 8, 2019
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