-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
UI: Store layout state in sessionStorage #8786
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/storybook/monorepo/el5ygmmhs |
layout: { | ||
...state.layout, | ||
panelPosition: position, | ||
panelPosition: state.layout.panelPosition === 'right' ? 'bottom' : 'right', |
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.
This is just GitHub rendering a weird diff.
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.
NICE!!!
UI: Store layout state in sessionStorage
What I did
This adds
{ persistence: 'session' }
to allstore.setState
calls inlayout.ts
. This will make sure panel visibility and other layout settings are retained between page reloads.How to test
Toggle one of the layout settings (fullscreen, nav, addons, toolbar) and reload the page. Notice your settings will be retained.