-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Keep the Link Control settings drawer persistent #47989
base: trunk
Are you sure you want to change the base?
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @abhi3315! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
You could make a new hook (separate file) to get the preference and then mock the hook in the tests so you can control it. For the existing tests we should set it to always return See |
Minor: we tend to favour rebasing against trunk rather than merge commits. |
de13764
to
78a4f34
Compare
useEffect( () => { | ||
dispatch( preferencesStore ).set( | ||
'core/editor', | ||
'linkControlSettingsOpen', | ||
settingsOpen | ||
); | ||
}, [ settingsOpen ] ); | ||
|
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.
@getdave As per the comment you made on my earlier PR #47930 (comment)
I should not query the store in the component itself. So I might have to refactor the code.
@draganescu I think you were envisaging some kind of heuristic here to determine when the drawer setting should be toggled? Perhaps
If we do that I guess we'd need to store the temp "how many times toggled" state in Session Storage and then clear it once the preference is set? |
What?
This PR will keep the Link Control setting open if it is opened or closed if it was closed earlier.
By default, the setting drawer will be closed.
Why?
#47821
#47821 (comment)
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast