-
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
Polish zoom out inserter #66110
Polish zoom out inserter #66110
Conversation
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. |
Size Change: +41 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
as="button" | ||
layout={ ! isReducedMotion } |
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’t see why this is currently a button since it doesn’t have interactivity. Besides that if it’s a button I don’t think it should contain a div
.
The layout
prop doesn’t do anything in this context.
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.
Yes we've lost this context. We envisaged that when activated (via keyboard or mouse) focus would transfer to the "Search" of the Patterns Inserter. So this is why they were buttons.
I tried that but realised the approach was off so had to revert in #64748.
Given we're at RC for 6.7, I'm not sure we're going to land that feature unless it qualifies as an a11y bug fix. Maybe @jeryj can advise?
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.
Thanks for following up with this polish 👍
I'd like a confidence check from @jasmussen on the visual changes here. Code wise it seems good and the UX was solid for me.
Thanks again.
// Maintains an absolute font-size by counter-scaling based on the zoom level. | ||
font-size: calc(#{$default-font-size} / var(--wp-block-editor-iframe-zoom-out-scale)); |
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.
@jasmussen specifically want this to match the default editor font size but scaled for Zoom Out. From what I can see in testing this PR the font size continues to visually match but it would be good to get a confirmation from him.
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 further context, the goal here isn't so much to match the editor font size, as it is to resemble user interface rather than an element that could be part of the theme itself. I realize that requires some careful math. Ideally the same font, size, appearance applies to this message, as would apply to any other "Drag files here" message.
as="button" | ||
layout={ ! isReducedMotion } |
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.
Yes we've lost this context. We envisaged that when activated (via keyboard or mouse) focus would transfer to the "Search" of the Patterns Inserter. So this is why they were buttons.
I tried that but realised the approach was off so had to revert in #64748.
Given we're at RC for 6.7, I'm not sure we're going to land that feature unless it qualifies as an a11y bug fix. Maybe @jeryj can advise?
animate={ { height: '120px' } } | ||
animate={ { | ||
// Use a height equal to that of the zoom out frame size. | ||
height: 'calc(1 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)', |
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.
The result seems to be that these drop zones have become smaller. The scale may be correct but I'd recommend a design confidence check from @jasmussen.
exit={ { height: 0 } } | ||
transition={ { | ||
type: 'tween', | ||
duration: 0.2, | ||
duration: isReducedMotion ? 0 : 0.2, |
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.
Good catch 👍
@@ -124,10 +125,11 @@ export function ZoomOutSeparator( { | |||
<motion.div | |||
initial={ { opacity: 0 } } | |||
animate={ { opacity: 1 } } | |||
exit={ { opacity: 0 } } | |||
exit={ { opacity: 0, transition: { delay: -0.125 } } } |
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.
Nit: we should consider a comment here to explain why the delay is necessary without the developer having to go and look up a lot of history to understand.
duration: 0.1, | ||
delay: 0.125, |
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.
Nit: we should consider a comment here to explain why the delay is necessary without the developer having to go and look up a lot of history to understand.
Looks good enough. Here's the branch: Here's trunk: It's not clear the font size matches the 13px default UI font size (look at "Template" in the document title) in either, but that's less important and can always be tuned. The key is ensuring the font size isn't arbitrary, that it looks like block editor UI, and that it's legible. Thanks for the work! |
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.
Taking into account feedback from @jasmussen I'm happy we merge this.
Thanks for the improvement 👍
All drop zones (e.g. for media) and markers (e.g. the line when inserting a block) are blue. This one is grey. |
No, it wasn't tried. We can try it but let's merge this and iterate. |
I changed the labelling here to correctly reflect the fact that this PR fixed bugs in the implementation of Zoomed Out introduced during this cycle. |
* Hide overflow; add delay to prompt; revise font scale * Tweak prompt text transition
I just cherry-picked this PR to the wp/6.7 branch to get it included in the next release: 69e6747 |
* Hide overflow; add delay to prompt; revise font scale * Tweak prompt text transition
What?
Polishing or fixing some details of the zoom out inserter and its animation. Some of the changes seem like easy wins and others not too difficult to decide upon.
Why?
A few things seem off or worth trying to do better:
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Before
Watch for the overflowing prompt text at the start of the enter animations:
zoom-out-separator-animation-trunk.mp4
After
zoom-out-separator-animation-revised.mp4