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

UI: Store layout state in sessionStorage #8786

Merged
merged 1 commit into from
Nov 12, 2019
Merged

UI: Store layout state in sessionStorage #8786

merged 1 commit into from
Nov 12, 2019

Conversation

ghengeveld
Copy link
Member

What I did

This adds { persistence: 'session' } to all store.setState calls in layout.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.

@ghengeveld ghengeveld requested a review from ndelangen November 11, 2019 15:50
@vercel
Copy link

vercel bot commented Nov 11, 2019

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/storybook/monorepo/el5ygmmhs
🌍 Preview: https://monorepo-git-remember-layout.storybook.now.sh

@github-actions
Copy link
Contributor

Fails
🚫

PR is not labeled with one of: ["cleanup","doc-dependencies:update","BREAKING CHANGE","feature request","bug","documentation","maintenance","dependencies:update","dependencies","other"]

Generated by 🚫 dangerJS against 7841383

layout: {
...state.layout,
panelPosition: position,
panelPosition: state.layout.panelPosition === 'right' ? 'bottom' : 'right',
Copy link
Member Author

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.

@ndelangen ndelangen added this to the 5.3.0 milestone Nov 11, 2019
@ndelangen ndelangen added the bug label Nov 11, 2019
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NICE!!!

@shilman shilman added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Nov 11, 2019
@shilman shilman modified the milestones: 5.3.0, 5.2.x Nov 11, 2019
@shilman shilman changed the title Keep the layout state in sessionStorage. UI: Store layout state in sessionStorage Nov 11, 2019
@shilman shilman merged commit 3531f4f into next Nov 12, 2019
@shilman shilman deleted the remember-layout branch November 12, 2019 03:56
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Nov 30, 2019
shilman added a commit that referenced this pull request Nov 30, 2019
UI: Store layout state in sessionStorage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug core patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants