Skip to content

perf(grid): hoist secondary click (context menu) and tooltip handling from _GridCell to grid level (#1346) - #1473

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/1346-grid-hoist-context-menu-tooltip
Oct 11, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue/1346-grid-hoist-context-menu-tooltip

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Closes #1346

Summary of Changes:

  1. Hoisted Context Menu:
    • Replaced mounting per-cell ContextMenu and Listener(onPointerDown) with grid-level secondary mouse click handling in _onGridPointerDown.
    • Context menus are opened on-demand at pointer location using exported showContextMenuListenable / showContextMenuBuilder from shadcn_flutter.
    • Items are built strictly on secondary tap, retaining lazy menu item construction count guarantees.
  2. Hoisted Cell Tooltips:
    • Replaced mounting per-cell material.Tooltip with a grid-level MouseRegion hover listener and an OverlayEntry displayed with a 450 ms debounce.
    • Cleans up and dismisses tooltip on horizontal/vertical scrolling, pointer down, and hover exit.
  3. Optimized _GridCell & _DataRow:
    • Removed 10+ context menu callbacks forwarded through _DataRow and _GridCell.
    • Simplified _GridCell.sameAs from 31 checked fields down to 18 fields.
    • Reduced widget tree depth by eliminating ~4200 redundant intermediate widgets per 600 visible cells.
  4. Tests:
    • Added widget tests verifying cells do not mount ContextMenu or Tooltip in their subtree.
    • Added interaction tests verifying hover over cell displays the tooltip overlay and mouse exit dismisses it.

@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit dc3d361 into dev Oct 11, 2026
12 of 13 checks passed
@github-actions github-actions Bot added frontend Theme parser epic label: frontend performance Theme parser epic label: performance ui User interface components and widgets data-grid Interactive data grid, cell editor, filtering, groupings P2 Medium priority / Parity & Refactoring labels Oct 11, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue/1346-grid-hoist-context-menu-tooltip branch October 11, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data-grid Interactive data grid, cell editor, filtering, groupings frontend Theme parser epic label: frontend P2 Medium priority / Parity & Refactoring performance Theme parser epic label: performance ui User interface components and widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant