Skip to content

BACK-466 - Add Vim jump and half-page motions to TUI board columns#661

Open
alessandro-rizzo wants to merge 1 commit into
MrLesk:mainfrom
alessandro-rizzo:tasks/back-466-vim-board-motions
Open

BACK-466 - Add Vim jump and half-page motions to TUI board columns#661
alessandro-rizzo wants to merge 1 commit into
MrLesk:mainfrom
alessandro-rizzo:tasks/back-466-vim-board-motions

Conversation

@alessandro-rizzo
Copy link
Copy Markdown

Summary

Adds familiar Vim vertical-navigation motions to the focused column of the terminal Kanban board (backlog board), extending the existing h/j/k/l bindings:

Key Action
gg Jump to the first task in the column (two g presses within 400ms; a lone g is a no-op)
G Jump to the last task
Ctrl+d Move selection down half the column's visible height
Ctrl+u Move selection up half the column's visible height

All four motions clamp inside the column and never hand focus to the search box, so the existing j/k boundary→search behavior is unchanged. They also work in move mode, repositioning the move target (top/bottom/half-page) within the valid range.

Full-page Ctrl+f/Ctrl+b is intentionally out of scope to avoid clashing with the existing Ctrl+f search shortcut.

Implementation

  • src/ui/task-viewer-with-search.ts — new pure, exported resolveVimMotionIndex(motion, currentIndex, totalItems, visibleHeight) (+ VimVerticalMotion type) that does all clamped index math, mirroring the existing shouldMoveFromListBoundaryToSearch / resolveSearchExitTargetIndex helpers.
  • src/ui/board.ts — four thin screen.key handlers + a shared applyVimMotion closure that reads the list's rendered height (falling back to task count) and routes through selectColumnRow (navigation) or moveOp.targetIndex (move mode).
  • src/ui/components/help-popup.ts — added gg/G and C-d/u rows to the board shortcuts.
  • src/test/board-vim-motion.test.ts — unit tests for the helper (top/bottom, half-page clamping both ends, empty list, odd-height rounding, tiny-height minimum step).

Testing

  • bunx tsc --noEmit — passes
  • bun run check . (changed files) — passes
  • bun test — 1250 pass / 0 fail

🤖 Generated with Claude Code

Add gg/G to jump to the top/bottom of the focused board column and
Ctrl+d/Ctrl+u to move the selection by half a page. Motions clamp inside
the column (no fall-through to search) and also drive move mode.

Index math lives in a pure resolveVimMotionIndex helper; board key
handlers are thin wrappers. Help popup and tests updated.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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