Skip to content

feat: implement Tab/Shift+Tab navigation and remap autocomplete - #373

Open
cap153 wants to merge 5 commits into
pop-os:masterfrom
cap153:feat/tab-navigation
Open

feat: implement Tab/Shift+Tab navigation and remap autocomplete#373
cap153 wants to merge 5 commits into
pop-os:masterfrom
cap153:feat/tab-navigation

Conversation

@cap153

@cap153 cap153 commented Dec 14, 2025

Copy link
Copy Markdown

Description

This PR implements standard keyboard navigation using Tab and Shift+Tab to move selection up and down in the launcher list, addressing a common user expectation for GUI launchers.

Additionally, the autocomplete functionality (previously bound to Tab) has been remapped to the Right Arrow key to prevent conflict and align with shell/terminal behavior.

Changes

  1. Navigation Logic:

    • Tab: Now triggers FocusNext (Select next item).
    • Shift+Tab: Now triggers FocusPrevious (Select previous item).
    • Right Arrow: Now triggers Autocomplete (formerly TabPress).
  2. Refactor:

    • Renamed Message::TabPress to Message::Autocomplete. Since the action is no longer bound to the Tab key, this name better reflects the semantic intent.
  3. Focus Handling:

    • Introduced Message::KeepFocus.
    • Bound text_input's .on_tab() to Message::KeepFocus.
    • Rationale: The text_input widget captures the Tab key by default. By binding it to a no-op message (KeepFocus), we prevent the widget from consuming the event logic while keeping the input focused, allowing the global subscription to correctly handle Tab and Shift+Tab events for navigation.

Testing

Tested on Arch Linux by replacing the system binary:

  • Tab: Correctly moves selection down.
  • Shift+Tab: Correctly moves selection up.
  • Right Arrow: Correctly autocompletes the search query (e.g., completing a path).
  • Typing: Focus remains in the search bar during navigation.

Related Issue

Closes #312

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[enhancement] Tab key support as a synonym for down arrow

1 participant