Skip to content

perf(commands): eliminate redundant search calls and double setState on item hover in CommandPalette and QuickSwitcher - #1426

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/1343-command-palette-hover-search
Oct 11, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue/1343-command-palette-hover-search

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Closes #1343

Summary of Changes

  1. Double setState on hover eliminated:
    • In both CommandPaletteDialog and QuickSwitcherDialog, moving the mouse over items triggered an exit on the previous item and an enter on the new item. Guarded with if (hovered && _selected != index) so only true transitions trigger rebuilds.
  2. Search caching in CommandPaletteDialog:
    • Previously, _hits getter executed full search() twice on every build() as well as on key handlers.
    • Cached _hits with _cachedQuery, invalidating on controller text changes and subscribing to QueryaCommandRegistry events.
  3. Tests:
    • Added unit test in test/features/command_palette/command_palette_dialog_test.dart verifying hover selection update.

…on item hover in CommandPalette and QuickSwitcher
@github-actions github-actions Bot added frontend Theme parser epic label: frontend performance Theme parser epic label: performance ui User interface components and widgets ux User experience, keyboard shortcuts and interactions P3 Low priority / Polish & Enhancements labels Oct 11, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 0c80ed5 into dev Oct 11, 2026
13 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue/1343-command-palette-hover-search branch October 11, 2026 15:02
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 P3 Low priority / Polish & Enhancements performance Theme parser epic label: performance ui User interface components and widgets ux User experience, keyboard shortcuts and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant