Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Store layout (full screen mode and panel visibility) into permalink #5

Merged
merged 1 commit into from
Jun 21, 2016

Conversation

timkindberg
Copy link

@timkindberg timkindberg commented Jun 18, 2016

So it can be persisted across refresh and also shared to others. Also fix various lint errors.

closes storybookjs/storybook#180, storybookjs/storybook#200

if (!api) return;

const { selectedKind, selectedStory } = api;
const queryString = qs.stringify({ selectedKind, selectedStory });

if (queryString === '') return;

const url = `?${queryString}`;
const { goFullScreen, showDownPanel, showLeftPanel } = shortcuts;
Copy link
Contributor

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.

@arunoda
Copy link
Contributor

arunoda commented Jun 19, 2016

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.

@timkindberg
Copy link
Author

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.

@arunoda
Copy link
Contributor

arunoda commented Jun 20, 2016

@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';
Copy link
Author

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.

@timkindberg
Copy link
Author

This should be good now.

@arunoda
Copy link
Contributor

arunoda commented Jun 20, 2016

Okay. This looks great.
I'll take this tomorrow and do a new release.
Thanks you for your great effort.

@timkindberg
Copy link
Author

👍

@arunoda arunoda merged commit d0ed51a into storybook-eol:master Jun 21, 2016
@arunoda
Copy link
Contributor

arunoda commented Jun 21, 2016

Just merged this and publish this with [email protected]

ndelangen pushed a commit that referenced this pull request Apr 2, 2017
ndelangen added a commit that referenced this pull request Apr 2, 2017
Merge branch 'master' of github.com:storybooks/react-storybook
ndelangen pushed a commit that referenced this pull request Apr 10, 2017
ndelangen pushed a commit that referenced this pull request Apr 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Store panel visibility / full screen mode into permalink or local storage
2 participants