-
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
Editor: Move the device type state to the editor package #56866
Conversation
Size Change: +84 B (0%) Total Size: 1.72 MB
ℹ️ View Unchanged
|
Flaky tests detected in c4bf3dd. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7128834515
|
@@ -189,7 +185,7 @@ export default function DocumentTools( { | |||
/* translators: button label text should, if possible, be under 16 characters. */ | |||
label={ __( 'Zoom-out View' ) } | |||
onClick={ () => { | |||
setPreviewDeviceType( 'Desktop' ); | |||
setDeviceType( 'Desktop' ); |
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.
Having an API like this with Capital letters seems a bit weird, but I guess we can alway lowercase this later if needed.
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.
Just mentioning it since we're stabilising.
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 can switch but it's going to have an impact on the deprecations, just make them harder. So maybe just keep that for now?
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.
Sounds good to me.
Related to #52632
What?
This PR centralizes the selected "device" state into the "editor" store, unifying and stabilizing the selectors from edit-post and edit-site. The next steps is going to be the UI to change the device and also the resizing styles that are added when you change devices.
Testing Instructions
No functional changes, just code being moved around.