-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
feat: store panel open state in storage #641
Conversation
@@ -0,0 +1,12 @@ | |||
import { useEffect, useState } from 'react'; | |||
import store from 'store2'; |
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.
I don't think this store actually works, I'm realising now that its in the lastViewed hook but I think its just an artifact from me copy/pasting a bit too freely from the web code 😅
We have the storage from the getStorybookUI thats required maybe we can pass that down to the ui
Edit:
Wait i guess if this is for web only that would work 🤔
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.
Yes it's only web, but I can take a look at the other storage solution and migrate to that so maybe we can drop store2 usage later alltogether.
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.
yeah the thing is that we also want tablets and other wide screen devices to work so that would be ideal
@tlow92 I had a go at adjusting it to use the user provided storage, let me know what you think of this solution |
@dannyhw Only checked code right now, but looks good to me! 👍 This is much cleaner I think |
Issue:
In my team we often don't use the addons panel actively, but it opens again everytime you refresh storybook in web.
What I did
I reused the storage solution from
lastViewedStoryIds
which leveragesstore2
and store the addons panel and sidebar open state in storage.