Skip to content

Support MacOS Shortcuts for Nav - #21434

Merged
tidy-dev merged 5 commits into
desktop:developmentfrom
jackfreem:jf/NavHotkeysOnMac
Nov 24, 2026
Merged

tidy-dev merged 5 commits into
desktop:developmentfrom
jackfreem:jf/NavHotkeysOnMac

Conversation

@jackfreem

@jackfreem jackfreem commented Jan 6, 2026 •

Copy link
Copy Markdown
Contributor

Closes #7266

Description

  • Adds support for macOS standard keyboard shortcuts Ctrl+P (select up) and Ctrl+N (select down) to all list interfaces in GitHub Desktop. These are Emacs-inspired shortcuts widely supported across macOS applications like Spotlight, providing muscle-memory navigation without moving hands to arrow keys.
  • This reopens and completes the work started in Extend arrow navigation in lists for MacOS #8412, which was closed due to an unresolved issue with list wrapping behavior. This implementation fixes that issue by ensuring Ctrl+P/N navigation does not wrap at list boundaries.

Test cases:

  • Current Repository
  • Current Branch
  • Changes
  • History

Not implemneted

  • Hotkeys for Autocomplete (issue, emoji)

Screenshots

Desktop.Mac.Hotkeys.Demo.mov

Release notes

Notes: [macOS] Added Ctrl+P/N shortcuts for navigating lists

@github-actions github-actions Bot added external Pull request originating outside of the Desktop core team triage For incoming issues labels Jan 6, 2026
@jackfreem
jackfreem marked this pull request as ready for review January 6, 2026 20:09

@tidy-dev tidy-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jackfreem Thank you for this contribution. I have a couple requests.

  1. I would like to target this to only adding the handling of the macOS shortcuts and not modifying the wrapping as wrapping behavior needs discussed with the team. (Thanks for trying to help on that tho. ❤️ )
  1. It looks like we are copying the arrow up/down logic and putting it in a new if block multiple times. I think we could simplify this by making a helper method to share across these list components of isUpKeyEvent and isDownKeyEvent that checks if it is the ArrowUp/Down or the macOS shortcut and then proceeding with the appropriate movement logic.

@zainudinmuji4-commits zainudinmuji4-commits left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package-lock.json

@jackfreem
jackfreem requested a review from tidy-dev January 15, 2026 16:29
@jackfreem

Copy link
Copy Markdown
Contributor Author

@tidy-dev Just following up on this PR. I’ve addressed the feedback from the previous review, would you mind taking another look when you have a chance?

@jackfreem
jackfreem requested a review from a team as a code owner September 22, 2026 19:33
Copilot AI balanced review requested due to automatic review settings November 24, 2026 16:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Ctrl+P/N still wrap ordinary lists and cycle through the filter textbox at boundaries instead of stopping at the first or last row.

3 open issues
What changed in this PR

Adds macOS Ctrl+P/Ctrl+N navigation to GitHub Desktop’s shared list components, addressing #7266 and continuing the work from #8412.

Changes:

  • Introduces shared predicates for arrow keys and macOS Ctrl+P/N.
  • Uses these predicates in standard and sectioned list navigation.
  • Extends filtered lists’ keyboard handling and filter-focus transitions.
File Description
app/​src/​ui/​lib/​section-filter-list.tsx Adds shortcut handling to sectioned filters and boundary focus transitions.
app/​src/​ui/​lib/​list/​selection.ts Defines shared up/down keyboard predicates.
app/​src/​ui/​lib/​list/​section-list.tsx Recognizes the shortcuts in sectioned list selection.
app/​src/​ui/​lib/​list/​list.tsx Recognizes the shortcuts in standard list selection.
app/​src/​ui/​lib/​filter-list.tsx Updates filter navigation and boundary focus handling.
app/​src/​ui/​lib/​augmented-filter-list.tsx Extends augmented sectioned filters with shortcut handling.

Review effort: Balanced

Comment thread app/src/ui/lib/filter-list.tsx Resolved
Comment thread app/src/ui/lib/list/list.tsx Resolved
Comment thread app/src/ui/lib/list/selection.ts Resolved
@tidy-dev
tidy-dev merged commit 638896e into desktop:development Nov 24, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external Pull request originating outside of the Desktop core team triage For incoming issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for ⌃P (select up) and ⌃N (select down) in lists

4 participants