Skip to content

feat(tui): add g/G keybindings to scroll messages view#2528

Merged
dgageot merged 2 commits intodocker:mainfrom
dgageot:board/add-g-g-keybindings-to-scroll-messages-v-74a422e0
Apr 27, 2026
Merged

feat(tui): add g/G keybindings to scroll messages view#2528
dgageot merged 2 commits intodocker:mainfrom
dgageot:board/add-g-g-keybindings-to-scroll-messages-v-74a422e0

Conversation

@dgageot
Copy link
Copy Markdown
Member

@dgageot dgageot commented Apr 27, 2026

Adds Vim-style scroll keybindings to the messages view in the TUI:

  • g jumps to the very top of the messages view
  • G jumps to the very bottom

Both keys are wired into the existing case "home" / case "end" cases in handleKeyPress, reusing the existing scrollToTop / scrollToBottom paths — no new code paths are introduced. The keys only act when the messages view is the focused panel; otherwise they are forwarded to the editor (so g/G typed during inline edit mode go into the textarea as expected).

Tests

  • TestKeyGAndShiftGScrollMessagesView — verifies g jumps to the top and G jumps to the bottom when the messages view is focused.
  • TestKeyGAndGWithEmptyMessages — verifies g/G are safe (no panic) with an empty message list.
  • TestKeyGAndGDuringInlineEdit — verifies g/G are typed into the textarea during inline edit instead of triggering scroll.

All tests, lint (golangci-lint run ./...), and go vet pass cleanly.

dgageot added 2 commits April 27, 2026 13:56
Pressing 'g' on the focused messages view jumps to the very top, and
'G' jumps to the very bottom, mirroring the existing home/end
behavior. Both keys are wired into the existing scrollToTop /
scrollToBottom cases, so no new code paths are introduced.

Assisted-By: docker-agent
- Test g/G with empty messages (should not panic)
- Test g/G during inline edit mode (should type into textarea, not scroll)

These tests ensure the keybindings work correctly in all scenarios.

Assisted-By: docker-agent
@dgageot dgageot requested a review from a team as a code owner April 27, 2026 12:10
@dgageot dgageot merged commit 14dd207 into docker:main Apr 27, 2026
9 checks passed
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.

2 participants