Skip to content

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.

@gonfunko gonfunko requested a review from a team as a code owner September 11, 2024 18:26
@github-actions github-actions bot added the PR: fix Fixes a bug label Sep 11, 2024
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 RaspberryPiFoundation:rc/v12.0.0 Sep 11, 2024
@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