Repository navigation
perf(erd): hover rebuilds only the cards it changes (#1169) - #1242
Merged
Merged
Conversation
The card stack listened to the hover notifier as a whole, so every move over a card rebuilt all cards and the neighbour map. Each card now has its own focus notifier, and the edges have one; a single sync moves only the notifiers whose highlight or fade changed. The neighbour map is built once per load. A widget test counts card builds: hovering one table rebuilds one card.
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.
Refs #1169
Problem
The ERD card stack listened to the hover notifier as a whole. Every pointer move over a card rebuilt all cards, the neighbour map, and the edge layer.
Change
highlighted,faded). The edge layer has one notifier for the focused table._syncFocus()runs after every change to hover, pick or drag. It moves only the notifiers whose value changed.Test
hovering a card rebuilds only the cards it changescounts_TableCardbuilds (erdCardBuilds, a@visibleForTestingseam). Hovering one table rebuilds one card. Moving to a related card rebuilds at most three.Not covered here: drag still rebuilds the stack through
setStateon each move, and there is no benchmark report yet. Both remain open under #1169.