Skip to content
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

fix: improve flyout performance #8571

Merged
merged 2 commits into from
Sep 11, 2024
Merged

fix: improve flyout performance #8571

merged 2 commits into from
Sep 11, 2024

Conversation

gonfunko
Copy link
Contributor

The basics

The details

This PR improves performance of flyouts. Previously, flyouts were reflowing/repositioning their contents in response to every event fired by the flyout workspace; this was particularly problematic during populating the flyout, when blocks being added/removed could cause this to happen hundreds of times. Scrolling the flyout also triggered continuous relayouts due to viewport change events. Reflowing is now only triggered in response to block change events, which can legitimately require it when e.g. the user types into a field in a block in the flyout and the flyout needs to resize to accomodate the block's new dimensions.

Additionally, the flyout was also listening to all events from the main/target workspace, and running a handler to check for and disable blocks over the maximum allowed instances threshold. This has been updated to only run on block create/deletes, since these are the only events than can result in a block exceeding/falling back under this threshold.

The later call to reflow() itself winds up calling position(), so this calculation is redundant.
Copy link
Collaborator

@rachel-fenichel rachel-fenichel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So simple.

@gonfunko gonfunko merged commit def80b3 into google:rc/v12.0.0 Sep 11, 2024
7 checks passed
@gonfunko gonfunko deleted the deflow branch September 11, 2024 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants