-
Notifications
You must be signed in to change notification settings - Fork 31
Store layout (full screen mode and panel visibility) into permalink #5
Conversation
if (!api) return; | ||
|
||
const { selectedKind, selectedStory } = api; | ||
const queryString = qs.stringify({ selectedKind, selectedStory }); | ||
|
||
if (queryString === '') return; | ||
|
||
const url = `?${queryString}`; | ||
const { goFullScreen, showDownPanel, showLeftPanel } = shortcuts; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to introduce a layout param which shows some numbers. Simply put readable queryParams in the URL. Like, goFullScreen=1.
Then it's easy to modify them manually as well.
This is very well done. Once we are okay with my comments above. We can merge this and make it available in the main repo. |
I had done that at first but it really made the URL overly long. I wanted a short version. What about full=1&left=1&down=1. And maybe if they are hidden not even put them in the URL. |
@timkindberg Okay. I like it. |
…o it can be persisted across refresh and also shared to others. closes #180 #200
}; | ||
|
||
const url = '?selectedKind=kk&selectedStory=ss&full=1&down=0&left=0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok so now the url will look like this.
This should be good now. |
Okay. This looks great. |
👍 |
Just merged this and publish this with [email protected] |
Merge branch 'master' of github.com:storybooks/react-storybook
Auto detect used components
So it can be persisted across refresh and also shared to others. Also fix various lint errors.
closes storybookjs/storybook#180, storybookjs/storybook#200