-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Zoom Out: Move the device type to the block editor store #64468
Conversation
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
@@ -468,7 +469,7 @@ export const __experimentalGetPreviewDeviceType = createRegistrySelector( | |||
alternative: `select( 'core/editor' ).getDeviceType`, | |||
} | |||
); | |||
return select( editorStore ).getDeviceType(); | |||
return select( blockEditorStore ).getDeviceType(); |
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 assume I need to create a new deprecation rather than updating this.
Can you detail why we need to change the "device" when triggering zoom-out (how as well) |
Another question: What should happen when you leave "browse styles", should you go back to "mobile" (in the video you shared)? |
Size Change: +119 B (+0.01%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
Because when zoom out is triggered the preview becomes quite small, so it makes sense to keep the desktop view. We don't offer zoomed out and mobile as an option in the device previews.
Probably yes - we can do that if this approach makes sense, but I wanted to get clarity on the path before proceeding too far down it! |
I'm thinking that maybe before doing a big change like this one we can try something smaller. What if |
Good idea! Trying that here: #64476 |
What?
Moves the deviceType store setting from the editor store to the block editor store.
Fixes #64256.
Why?
We need to change the device preview type in the zoom out hook, which means it needs to be in the block editor store, not the editor store.
How?
Moving the code around. I've not done the cleanup in case this is a bad idea.
Testing Instructions
Screenshots or screencast
Screen.Recording.2024-08-13.at.10.42.37.mov