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: -24 B (0%) Total Size: 1.83 MB
ℹ️ View Unchanged
|
524c772 to
e6ff0fe
Compare
|
Flaky tests detected in e6ff0fe. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12144080449
|
e6ff0fe to
8d93ba3
Compare
| if ( scaleValue < 1 ) { | ||
| if ( isZoomedOut ) { |
There was a problem hiding this comment.
I note the original conditional was scaleValue < 1 and now the conditional is scale !== 1.
Was that intentional?
There was a problem hiding this comment.
tl;dr: I think it's fine to use isZoomedOut here.
We can't check scale < 1 directly because scale could be the string auto-scaled.
The intention for this line before was to check for isZoomedOut, but we didn't want the useEffect to run when that changed. So, we used scaleValue and didn't notice the checks were different. I think using isZoomedOut here is better than the check before since it will always be the same result instead of having two different checks for the same thing.
jeryj
left a comment
There was a problem hiding this comment.
Working well! Glad this is finally combined into one useEffect! 👏🏻
| if ( scaleValue < 1 ) { | ||
| if ( isZoomedOut ) { |
There was a problem hiding this comment.
tl;dr: I think it's fine to use isZoomedOut here.
We can't check scale < 1 directly because scale could be the string auto-scaled.
The intention for this line before was to check for isZoomedOut, but we didn't want the useEffect to run when that changed. So, we used scaleValue and didn't notice the checks were different. I think using isZoomedOut here is better than the check before since it will always be the same result instead of having two different checks for the same thing.
| if ( ! isZoomedOut ) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
I do like the early return to show that we're not doing anything if we're not zoomed out. Could we add this to the combined useEffect to make it clearer it doesn't do anything if we're not zoomed out?
What?
Simplifies the zoom out animation trigger.
Why?
Code quality.
How?
Since we're no longer relying on the
useEffectdependencies to trigger the animation, we can consolidate that effect into the main one.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast