Skip to content

perf(erd): hover rebuilds only the cards it changes (#1169) - #1242

Merged
ZhuchkaTriplesix merged 2 commits into
devfrom
perf/1169-erd-hover-canvas
Oct 9, 2026
Merged

ZhuchkaTriplesix merged 2 commits into
devfrom
perf/1169-erd-hover-canvas

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

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

  • Each card has its own focus notifier (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.
  • The neighbour map is built once per load, not on each build.

Test

hovering a card rebuilds only the cards it changes counts _TableCard builds (erdCardBuilds, a @visibleForTesting seam). Hovering one table rebuilds one card. Moving to a related card rebuilds at most three.

Not covered here: drag still rebuilds the stack through setState on each move, and there is no benchmark report yet. Both remain open under #1169.

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.
@github-actions github-actions Bot added frontend Theme parser epic label: frontend performance Theme parser epic label: performance P2 Medium priority / Parity & Refactoring labels Oct 9, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit c22e64e into dev Oct 9, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Theme parser epic label: frontend P2 Medium priority / Parity & Refactoring performance Theme parser epic label: performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant