Skip to content

Fix keyboard navigation in the Open Recent dialog - #725

Merged
hannesa2 merged 2 commits into
masterfrom
open-recent-with-return
Sep 25, 2026
Merged

hannesa2 merged 2 commits into
masterfrom
open-recent-with-return

Conversation

@goneng

@goneng goneng commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Make the keyboard in the Open Recent dialog open and select the row it
points at, whether the list or the search field has focus.

Description

Tabbing from the search field to the list and picking a row with the
arrow keys left Return with nothing to do, so it just beeped; only the
search field handled it. With the search field focused, Up stepped two
rows at a time and threw on the top row, which AppKit swallows as a
lost keypress.

  • Open the selection on Return or keypad Enter from the list, and track
    the selection when it moves by keyboard, not only on a click
  • Step Up by exactly one row in the search field, staying on the top row
  • Cover each case with tests that drive the dialog through key events

Screenshots

In this case (when the list is in focus), pressing [Enter] just bleeps:

image

Test plan

  • New OpenRecentControllerKeyboardTests fail before each fix and pass
    after it; the full unit suite passes (220 tests)
  • Debug build: Tab to the list, Down, then Return opens the repository;
    in the search field, Up moves one row and stops on the top row

Make the keyboard open what the arrow keys picked, the same as a double
click does, when the list rather than the search field has focus.

* Open the selection on Return or keypad Enter reaching the controller
  from the list, which forwards those keys unhandled
* Track the selection when it moves by keyboard, not only on a click
* Cover both keys with tests that drive the list through key events
@goneng goneng changed the title Fix Return in the Open Recent list not opening the chosen repository Fix keyboard navigation in the Open Recent dialog Sep 25, 2026
Move the selection up by exactly one row while the search field has
focus, and stay put on the top row instead of throwing.

* Step up from the current row once, not twice, which also stops the
  unsigned index wrapping below zero on the top row
* Cover both cases with tests that type into the search field
@goneng
goneng force-pushed the open-recent-with-return branch from b4b5d76 to 74c8782 Compare September 25, 2026 17:18
@goneng
goneng marked this pull request as ready for review September 25, 2026 17:20
@hannesa2

Copy link
Copy Markdown
Contributor

Screenshot differs: emulatorApi=arm64 with 4 screenshot(s)

setpoint (old) | diff | actual screenshot (new)

commit-context-menu.pngscreenshot

history-view.pngscreenshot

settings-general.pngscreenshot

settings-integration.pngscreenshot

@goneng
goneng requested a review from hannesa2 September 25, 2026 18:27
@goneng goneng added the bugfix label Sep 25, 2026
@hannesa2
hannesa2 merged commit 6351570 into master Sep 25, 2026
3 checks passed
@hannesa2
hannesa2 deleted the open-recent-with-return branch September 25, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants