Skip to content

Feat/792: Add vim-style gg/G navigation to the main panel#816

Open
Suhird wants to merge 6 commits into
jesseduffield:masterfrom
Suhird:feat/792-add-vim-goto-last-nav-config-screen
Open

Feat/792: Add vim-style gg/G navigation to the main panel#816
Suhird wants to merge 6 commits into
jesseduffield:masterfrom
Suhird:feat/792-add-vim-goto-last-nav-config-screen

Conversation

@Suhird

@Suhird Suhird commented Jun 24, 2026

Copy link
Copy Markdown

Closes #792

What

Adds vim-style scroll navigation to the main panel (where the Container Config
screen, and the other tabs, render):

  • gg — scroll to the top
  • G (Shift+g) — scroll to the bottom

The shortcuts are also surfaced in the options bar at the bottom whenever the
main panel is focused.

Notes

  • The bindings are scoped to the main view, so they work across all of its
    tabs (Config, Logs, Env, Stats, Top), consistent with how the existing k/j
    scrolling works.
  • gocui has no native key-sequence support, so gg is implemented as a
    double-press of g within a short time window (tracked via a timestamp in the
    gui state). G is a normal single binding.
  • G honours the existing gui.scrollPastBottom config when computing the
    bottom origin.

Tests

  • Added unit tests for the two pure helpers (gotoBottomOriginY origin math and
    the isDoublePress timing) in pkg/gui/main_panel_test.go, matching the
    repo's existing test style.
  • Regenerated the keybinding cheatsheets (go run scripts/cheatsheet/main.go generate).
  • gofmt -s, go vet, go test -race ./..., and the cheatsheet/vendor checks all pass locally.

Suhird added 6 commits June 24, 2026 13:38
Add GotoTop and GotoBottom translation entries used by the upcoming
vim-style gg/G navigation bindings in the main panel.
Add handlers that scroll the main panel to the top and bottom. gotoTopMain
implements the vim-style "gg" double press (gocui has no native key-sequence
support) by tracking the last 'g' press timestamp in the gui state, while
gotoBottomMain jumps to the final line, honouring the ScrollPastBottom config.

The origin math and double-press timing are factored into pure helpers so they
can be unit tested.
Pressing 'gg' jumps to the top and 'G' jumps to the bottom of the main panel,
matching vim navigation. The bindings are scoped to the main view so they apply
across all of its tabs (Config, Logs, Env, Stats, Top).
When the main panel is focused (e.g. the Container Config screen) the options
bar now lists the gg/G scroll-to-top/bottom shortcuts alongside the existing
scroll and navigation hints.
Cover the gotoBottomOriginY origin math (scroll-past-bottom on/off, content
shorter than the view, empty content) and the isDoublePress timing used to
detect the vim-style "gg" double press.
Auto-generated from the new main-panel scroll-to-top/bottom bindings.
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.

Navigation using VIM "gg" and "G" in Container Config tab

1 participant