Ensure device preview is always accurate when window is zoomed in - #81193
Conversation
|
Size Change: +79 B (0%) Total Size: 7.81 MB 📦 View Changed
|
| viewportSettings | ||
| ); | ||
|
|
||
| expect( previewWidth ).toBe( 480.25 ); |
There was a problem hiding this comment.
this is a very edge casey scenario but I guess we'd better account for it 🤷
|
Flaky tests detected in 9a9011d. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/30972124986
|
|
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. |
t-hamano
left a comment
There was a problem hiding this comment.
LGTM!
It was a bit difficult to reproduce, but on my Windows machine, I have the display scaling set to 125%. By changing the Chrome browser's zoom level to 150%, I was able to confirm this issue.
Before
The canvas width is 782.4px on tablets, so the styles for tablets are not applied.
After
The canvas width is 780.8px, and the styles for tablets are correctly applied.
Let's ship this PR to 7.1 RC1.
|
There was a conflict while trying to cherry-pick the commit to the wp/7.1 branch. Please resolve the conflict manually and create a PR to the wp/7.1 branch. PRs to wp/7.1 are similar to PRs to trunk, but you should base your PR on the wp/7.1 branch instead of trunk. |
…1193) * Ensure device preview is always accurate when window is zoomed in * simplify Co-authored-by: tellthemachines <isabel_brison@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org> Co-authored-by: jennydupuy <jdy68@git.wordpress.org>
|
Manual backport: #81215 |
|
This is an issue related to accessibility, so it's great. |
|
In WordPress 7.1-beta4-63014, when you zoom in (for example, to 130%) in the browser (Firefox), the styles display correctly based on the selected device. This is not the case with Chrome (with 125%). |
|
@jennydupuy, I don't think this PR is included in |
|
My bad! |
|
Thanks for merging and syncing to core @t-hamano ! |
…1193) * Ensure device preview is always accurate when window is zoomed in * simplify Co-authored-by: tellthemachines <isabel_brison@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org> Co-authored-by: jennydupuy <jdy68@git.wordpress.org>
What?
Fixes #81072
I've tested this on Firefox on macOS and (via playground PR tester) Chrome on Windows 11, with varying zoom levels. In both cases this change seems to fix the bug.
Testing Instructions
Use of AI Tools
I used codex/gpt 5.6 sol to make the code changes. Reviewed and tested by me.