feat: add hjkl navigation alongside the arrow keys (#29)

Layer vim-style h/j/k/l onto the existing arrow navigation across the sidebar, results, downloads, and seeding. Arrows unchanged.
This commit is contained in:
Avinash Gundimeda
2026-07-01 02:36:45 -04:00
committed by GitHub
parent 1b53ef3094
commit 6ba3e4292b
8 changed files with 30 additions and 26 deletions
+2 -2
View File
@@ -177,13 +177,13 @@ export function Results() {
setMode("search");
return;
}
if (key.upArrow) {
if (key.upArrow || input === "k") {
if (results.length > 0 && clamped > 0) setCursor(clamped - 1);
else setMode("search");
return;
}
if (results.length === 0) return;
if (key.downArrow) setCursor(wrapStep(clamped, 1, results.length));
if (key.downArrow || input === "j") setCursor(wrapStep(clamped, 1, results.length));
else if (key.pageUp) setCursor(Math.max(0, clamped - pageJump));
else if (key.pageDown) setCursor(Math.min(results.length - 1, clamped + pageJump));
else if (key.return) {