-
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
Add editor preference to keep Link Control settings toggle open by default #47821
Comments
I think we should try and mimick the behavior of other UI that is "smart" to respond to implicit preferences - such as the block inspector in the post editor: if it's closed it remain closed when new posts are opened, and if it's open it remain open. Same should be applied for the link drawer to remain open or closed based on last state when the link UI appears. I think adding an actual toggle in preferences is too much for this small thing. |
@draganescu I like that idea. Thank you. |
I also like that idea! |
I like the idea too mentioned by @draganescu. But I have a little query, Inspector control has a button to toggle it. If I click the Inspector control button it will be in an active state and by clicking the button the second time the drawer will be closed and the button is in the inactive state. But in the case of Link Control, the same There is no active or inactive state of the We can have a toggle state to this We can also separate out the I hope I made my point clear. |
Hi @abhi3315 :) The link control does open on toolbar action, but this issue suggests only the "drawer" with the settings - which does have a toggle - to be affected. The Link popover remains unchanged. |
Thanks @draganescu! I was just explaining a completely different thing. 😅 I would like to contribute this issue. |
We might need to add a property to data store to keep the state of Link Control setting. |
Hi @abhi3315. I think we will want to set an editor preference in the store. The details are in To quote from the docs:
wp.data
.select( 'core/preferences' )
.get( 'namespace/editor-or-plugin-name', 'myPreferenceName' ); // 1
wp.data
.dispatch( 'core/preferences' )
.set( 'namespace/editor-or-plugin-name', 'myPreferenceName', 2 );
wp.data
.select( 'core/preferences' )
.get( 'namespace/editor-or-plugin-name', 'myPreferenceName' ); // 2 What I'm not sure about yet is
@draganescu Has worked with preference in the Distraction Free mode before so perhaps he has some ideas. Moreover the genesis of the idea was his so he may have a clearer view than I do on the heuristics. |
We're managing the preferences at two levels, one is |
@abhi3315 I think you don't have to scope by editor name. The |
The tests are failing because of the toggle setting state because in each test setting drawer is supposed to be closed by default. But now the setting drawer state of One way to handle this is to reset the state in the preference store in each Is there anything on your mind @getdave? |
Add an editor settings which allows the Link Control settings drawer to be open by default.
Originally posted by @paaljoachim in #47328 (comment)
The text was updated successfully, but these errors were encountered: