Repository navigation
Conversation
This PR tries to add additional animation when the sidebar open/closes. Specifically, it now animates the right-margin in lockstep with the sidebar opening and closing. This causes the main body content to animate, just like the sidebar, for a nicer experience. However in order to be performant, this means we add `will-change: transform;` to the .edit-post__layout-content`. This is causing an issue with the notices, which will be moot when #13614 gets merged, so *this PR is dependant on that landing first*. Secondly, although it's a small PR, the addition of the will-change property is likely going to need a lot of testing so it doesn't cause regressions. Things to look for are absolute, fixed, or sticky position elements and the like. In my own testing, only the notices regressed which as mentioned gets fixed when 13614 lands. But this will still need a lot of eyes.
|
When testing this out on smaller posts, this looks great! Really nice and smooth. I'm seeing performance decrease as the post gets longer though. 😕 Not quite a surprise, but if I test with a 300+ block post (I just duplicated the demo post a bunch of times), the sidebar animates in fine, but the content doesn't animate at all. Instead, there's a bit of a delay, and then it just snaps into place. My guess is that some of the wide/full blocks are causing the bulk of the hiccup, as they need to drastically resize media as the editing area gets smaller. I also have a general question about using
I'm wondering if we need to be a bit more careful about our use of it here? In general, can we use JS to add and remove that property as needed? |
|
You're absolutely right, But this is also why I pushed this as a separate PR. Sad to hear that it's not performant, and it won't be the end of the world if we can't do this. It's in our new principles: if we can't make it performant, leave it out. Have to walk the walk. I'm wondering how things such as Google Keep or Google Calendar (which uses the same technique) can make a smooth animation like this, without taking a performance hit? In the case of calendar, the main canvas does resize during the animation. Perhaps there's just overall less on the page? It'd be nice if we were sure we couldn't make it performant, before we close this. |
Can you share where you see this? The closest thing I can find in Google Calendar is this, but it just pops in with no animation for me: |
|
Ah yes, visit https://keep.google.com/ or https://calendar.google.com/calendar/r and click the hamburger menu. |
|
Ah cool, thanks. From a quick look, my guess is that they're just dealing with a lot less data. Calendar doesn't show more than one month on the screen at a time (and even then, there are no images involved). Keep does include images, but they don't appear to be resizing the actual content column: it just moves over as necessary. And once the screen gets too small, the sidebar panel slides in over the content, preventing any resize. |
|
Yep. You're right. It has to be fullwide images needing to resize that cause this. Closing this for now then! Thanks so much for taking a look. |

This PR is a followup to #13635 and tries to add additional animation when the sidebar open/closes. Specifically, it now animates the right-margin in lockstep with the sidebar opening and closing. This causes the main body content to animate, just like the sidebar, for a nicer experience.
However in order to be performant, this means we add
will-change: transform;to the .edit-post__layout-content`. This is causing an issue with the notices, which will be moot when #13614 gets merged, so this PR is dependant on that landing first.Secondly, although it's a small PR, the addition of the will-change property is likely going to need a lot of testing so it doesn't cause regressions. Things to look for are absolute, fixed, or sticky position elements and the like. In my own testing, only the notices regressed which as mentioned gets fixed when 13614 lands. But this will still need a lot of eyes.