Skip to content

fix(ux): auto-scroll selected item into view during keyboard navigation in Command Palette and Quick Switcher #1369

Closed

Description

@ZhuchkaTriplesix

Summary

In CommandPaletteDialog (lib/features/command_palette/command_palette_dialog.dart, lines 84–91, 151–196) and QuickSwitcherDialog (lib/features/command_palette/quick_switcher_dialog.dart, lines 131–137, 220–250):

Both dialogs support Arrow Up / Arrow Down keyboard navigation (_move(delta)). However, their ListView.builder widgets do not have a ScrollController and do not scroll to keep the highlighted item in view.

Problem Details

  • The modal dialog height is constrained to 360px (itemExtent: 36 / 40), showing at most ~8 visible items at a time.
  • When searching schemas or commands with 10+ results, pressing Arrow Down moves _selected beyond index 8.
  • Because there is no ScrollController or Scrollable.ensureVisible call, the selection moves off-screen into hidden items.
  • The user cannot see what item is currently selected or what command/schema will be executed when pressing Enter.
  • Additionally, list items in the builder do not declare Semantics(selected: active), preventing screen readers from announcing which item is currently highlighted.

Scope

  • Attach a ScrollController to ListView.builder in both CommandPaletteDialog and QuickSwitcherDialog.
  • In _move(delta), compute the target scroll offset based on itemExtent and animate / jump to keep _selected visible in the viewport.
  • Wrap items in Semantics(selected: active, button: true).
  • Add widget tests verifying that pressing Arrow Down scrolls the list when selection crosses the viewport boundary.

Activity

  1. added
    bugSomething isn't working
    frontendTheme parser epic label: frontend
    accessibilityReduced motion, OS accessibility preferences
    uxUser experience, keyboard shortcuts and interactions
    P2Medium priority / Parity & Refactoring
    on Oct 10, 2026
  2. ZhuchkaTriplesix commented on Oct 11, 2026

    @ZhuchkaTriplesix
    MemberAuthor

    Done in #1397 (merged into dev).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority / Parity & RefactoringaccessibilityReduced motion, OS accessibility preferencesbugSomething isn't workingfrontendTheme parser epic label: frontenduxUser experience, keyboard shortcuts and interactions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions