Skip to content

fix(input): ignore modified j/k/up/down in session navigator - #2377

Open
atomsbaza wants to merge 2 commits into
herdrdev:masterfrom
atomsbaza:fix/navigator-ignores-modified-jk
Open

fix(input): ignore modified j/k/up/down in session navigator#2377
atomsbaza wants to merge 2 commits into
herdrdev:masterfrom
atomsbaza:fix/navigator-ignores-modified-jk

Conversation

@atomsbaza

Copy link
Copy Markdown

Summary

handle_navigator_key's Char('j') | Down and Char('k') | Up match arms had no modifier guard, unlike every sibling arm in the same match block ('a', 'b', 'w', 'i', 'd', all guarded with key.modifiers.is_empty() or an explicit CONTROL check). This meant Ctrl+K, Alt+J, etc. also moved the Session Navigator's row selection.

This is a narrow fix for that specific bug (reported as part of #1981 — see the "Also observed: ctrl+k moves the selection up even when navigate_pane_up is unset" note there). It does not address the broader ask in #1981 of making navigate_pane_up/navigate_pane_down remap the Session Navigator's row movement — that's a different, spatial-pane-focus feature (Mode::Navigate) from the Session Navigator modal (Mode::Navigator, opened via goto/prefix+g), and extending config into the Navigator would be a behavior change rather than a bug fix, so I left that for a maintainer decision / discussion.

Test plan

  • Added navigator_ignores_modified_j_and_k in src/app/input/modal.rs, which fails on the pre-fix code (Ctrl+K/Ctrl+J move the selection) and passes with the fix.
  • cargo fmt --check clean.
  • cargo nextest run --locked: 3037/3037 passed (one unrelated pre-existing flaky integration test, live_handoff_keeps_unmanaged_agent_name_bound_to_saved_session, confirmed to fail identically on unmodified master).

refs #1981

The Char('j')/Char('k')/Down/Up match arms in handle_navigator_key
had no modifier guard, unlike every sibling arm in the same match
block, so Ctrl+K, Alt+J, etc. also moved the navigator selection.

refs herdrdev#1981
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 07868f0c-78d8-4f92-968a-da294b7b307e

📥 Commits

Reviewing files that changed from the base of the PR and between eb93ec8 and 911288c.

📒 Files selected for processing (1)
  • src/app/input/modal.rs

📝 Walkthrough

Walkthrough

The navigator now moves with unmodified j and k only. Modified j and k keys do not change the selection. A unit test covers Ctrl-j and Ctrl-k.

Changes

Navigator input handling

Layer / File(s) Summary
Filter modified navigation keys
src/app/input/modal.rs
handle_navigator_key ignores modified j and k input. Tests verify that Ctrl-j and Ctrl-k preserve the selection.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • herdrdev/herdr#2271: Both changes modify handle_navigator_key; this PR adds modifier filtering, while that PR adds configurable navigator bindings.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the modifier-handling fix in the Session Navigator.
Description check ✅ Passed The description explains the bug, the narrow scope, the test coverage, and the validation results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@kangal-bot kangal-bot added the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 5, 2026
@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Greptile Summary

This PR prevents modified j/k and arrow keys from moving the Session Navigator selection.

  • Adds empty-modifier guards to the navigator’s j/Down and k/Up movement arms.
  • Adds regression coverage confirming Ctrl+J and Ctrl+K leave the selection unchanged.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The modifier guards narrowly prevent modified movement keys from changing navigator selection while preserving the intended unmodified bindings.

Important Files Changed

Filename Overview
src/app/input/modal.rs Restricts navigator row movement to unmodified keys and adds focused regression coverage for Ctrl+J/K.

Reviews (1): Last reviewed commit: "Merge branch 'master' into fix/navigator..." | Re-trigger Greptile

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

Labels

ai-review Trigger automated AI reviews for pull requests admitted by the PR gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants