Skip to content

fix(ui): add ctrl+n/ctrl+p emacs navigation across all list views#885

Open
MauriceDHanisch wants to merge 1 commit intoasheshgoplani:mainfrom
MauriceDHanisch:fix/emacs-nav-ctrl-n-ctrl-p
Open

fix(ui): add ctrl+n/ctrl+p emacs navigation across all list views#885
MauriceDHanisch wants to merge 1 commit intoasheshgoplani:mainfrom
MauriceDHanisch:fix/emacs-nav-ctrl-n-ctrl-p

Conversation

@MauriceDHanisch
Copy link
Copy Markdown

Problem

ctrl+n (next line) and ctrl+p (previous line) are the most fundamental emacs cursor movement keys, but they only worked in some parts of the TUI. Navigation was inconsistent:

Surface j/k ctrl+n/ctrl+p
Main session list
New session dialog — path suggestions dropdown
New session dialog — recent sessions picker ✓ (but not j/k)
New session dialog — field-to-field navigation ✗ (only worked on path field)
Skill dialog
Watcher panel
Zoxide picker ✓ (already correct)
Branch picker ✓ (already correct)

Changes

internal/ui/home.go — add ctrl+p/ctrl+n as aliases for k/j in the main session list.

internal/ui/newdialog.go:

  • Path-suggestions dropdown: add ctrl+n/ctrl+p alongside j/k.
  • Recent-sessions picker: add j/k alongside the existing ctrl+n/ctrl+p.
  • ctrl+n/ctrl+p outside a path field with active suggestions: fall through to form field navigation (mirrors down/shift+tab+up), including the conductor and multi-repo sub-list handling.

internal/ui/skill_dialog.go — add ctrl+n/ctrl+p as aliases for j/k.

internal/ui/watcher_panel.go — add ctrl+n/ctrl+p as aliases for j/k.

Tests

Every changed surface has new tests:

  • TestHome_TerminalNavigationKeys extended with ctrl+n/ctrl+p cases.
  • TestNewDialog_CtrlN_CtrlP_FieldNavigation — field navigation in the new-session form.
  • TestNewDialog_CtrlP_WrapsToLastField — wrap-around on first field.
  • TestNewDialog_SuggestionsDropdown_CtrlN_CtrlP — dropdown navigation.
  • TestNewDialog_RecentPicker_JKj/k in recent-sessions picker.
  • TestSkillDialog_CtrlN_CtrlP_Navigation — skill dialog navigation.
  • TestWatcherPanel_CtrlN_CtrlP_Navigation — watcher panel navigation.

Notes

  • No new dependencies, no config changes.
  • All changes are purely additive aliases to existing switch cases — existing j/k and arrow-key bindings are untouched.
  • ctrl+f/ctrl+b (page forward/back) and ctrl+u/ctrl+d (half-page) already work in home.go — this PR does not touch those.

ctrl+n (next line) and ctrl+p (previous line) are standard emacs cursor
movement keys. They were partially present — sub-dialogs like the zoxide
picker and branch picker already used them — but inconsistently missing
from the main session list and several other surfaces.

This makes navigation consistent everywhere:

- Main session list (home.go): ctrl+n/ctrl+p as aliases for j/down and
  k/up respectively.
- New session dialog: ctrl+n/ctrl+p in the path-suggestions dropdown and
  the recent-sessions picker; ctrl+n/ctrl+p fall through to field-level
  navigation (next/prev field) when not on a path field with suggestions.
  Also adds j/k as aliases in the recent-sessions picker, which previously
  only accepted ctrl+n/down and ctrl+p/up.
- Skill dialog: ctrl+n/ctrl+p as aliases for j/down and k/up.
- Watcher panel: ctrl+n/ctrl+p as aliases for j/down and k/up.

All changes include corresponding tests.
Copilot AI review requested due to automatic review settings May 6, 2026 18:17
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.

1 participant