-
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
[Edit Post]: Toggle Distraction free mode mode based on compatibility #54073
Conversation
@@ -131,6 +137,9 @@ export default function useCommonCommands() { | |||
label: __( 'Toggle top toolbar' ), | |||
callback: ( { close } ) => { | |||
toggle( 'core/edit-post', 'fixedToolbar' ); | |||
if ( isDistractionFree ) { |
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.
For now this is the only one left from the issue, because we call directly the preferences store action.
Size Change: +95 B (0%) Total Size: 1.51 MB
ℹ️ View Unchanged
|
Flaky tests detected in fa8e730. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6028066587
|
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.
In my testing this worked great! 👏🏻
What?
Part of: #53993
Distraction free mode in combination with some commands/shortcuts etc may cause layout corruption. This is mostly due to the fact that DFM expect there are no sidebars opened. Currently in trunk we handled some of these cases by manually closing those sidebars and toggling some settings like the top toolbar. In order to avoid having to do this every time we need to, I've moved this logic in some of the actions.
This is very similar PR with #54030, that handled most cases in site editor.
Testing Instructions for post editor
Test when we enable DFM either through shortcut or command, that any sidebar is closed.
Whenever we toggle the DFM observe that a snackbar appears with related information.
Test the following commands when DFM is on and observe that the sidebars are closed: