Skip to content

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

Merged
ogulcancelik merged 5 commits into
herdrdev:masterfrom
atomsbaza:fix/navigator-ignores-modified-jk
Aug 10, 2026
Merged

fix(input): ignore modified j/k/up/down in session navigator#2377
ogulcancelik merged 5 commits into
herdrdev:masterfrom
atomsbaza:fix/navigator-ignores-modified-jk

Conversation

@atomsbaza

Copy link
Copy Markdown
Contributor

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: 79af22b4-2514-44c1-b68d-2555e1db419c

📥 Commits

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

📒 Files selected for processing (1)
  • src/app/input/modal.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/app/input/modal.rs

📝 Walkthrough

Walkthrough

The navigator moves with unmodified j and k keys. 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 identifies the Session Navigator fix for modified navigation keys, although its Up/Down wording is broader than the file summary.
Description check ✅ Passed The description directly explains the navigation bug, scope, test coverage, and 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, Up, and Down key events from moving the Session Navigator selection.

  • Adds empty-modifier guards to the Navigator’s row-movement match arms.
  • Adds a regression test confirming Ctrl+J and Ctrl+K leave the selection unchanged.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/app/input/modal.rs Adds modifier guards to Session Navigator movement keys and a focused regression test; no eligible follow-up defect was identified.

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

@ogulcancelik
ogulcancelik merged commit 4a8a8f9 into herdrdev:master Aug 10, 2026
7 checks passed
@kangal-bot kangal-bot removed the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 10, 2026
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.

3 participants