Open
Conversation
… overlay outside the container, and removing will-change to reduce composite layer thrashing
…animation stays on the compositor.
…ld creates a lot of DOM movement as options are loaded in—this in addition to shuffling the stacks can create performance issues
… previous stack wobbling left then right as the hover effect is removed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Problem
I noticed that stack-on-stack performance can degrade when you get a few layers deep and start playing with fields. This is especially noticeable when you open stack layers on a large viewport such as 2560px (5K monitor), where any performance shortcomings are laid bare.
For what it's worth, I'm noticing this on an M2 processor – stacks should perform better than they do on this machine.
What this PR Does
Fixes overlay performance and flicker by…
Moves the overlay outside the container
Animates with
transformrather thanleft/right– transform animations are usually handled by the GPU (compositor layer) and do not trigger layout recalculations.Stacks are no longer re-animated when a new field is picked. Picking a new field creates a lot of DOM movement as particular field options are loaded in—this, in addition to shuffling the stacks, seems to create performance issues
Suppress hover during the new stack’s enter animation, to prevent the previous stack wobbling left then right as the hover effect is removed. This was creating extra movement as the new stack was animating in
FYI Claude also recommended adding a
@keydown.esc handler for more reliable escape key handling. I'm not sure about that, so feel free to remove if you disagree.Here are some demos of before and after on a 27-inch 5K screen, so you can see the performance strains better
Before Safari
You'll notice it's OK up until the third level deep (where I add a checkbox field)
Safari is particularly sluggish. It doesn't have the same render flashing behaviour that Chrome has, instead it just feels like it's struggling.
Safari.Before.mp4
Before Chrome
You'll notice it's OK up until the third level deep (where I add a checkbox field)
When I close the third-level stack and re-open it to re-add the checkbox, it's really bad, with multiple render flashes.
It seems to get progressively worse the more you interact with the stacks, and the deeper you go.
Chrome.Before.mp4
After Safari
After.Safari.mp4
After Chrome
Chrome.After.mp4
FYI, Firefox's performance is similar.
How to Reproduce