Skip to content

fix(ui): keep tab off the resource list while zoomed - #52

Open
Devehab wants to merge 1 commit into
p10node:mainfrom
Devehab:fix/zoomed-tab-skips-list
Open

Devehab wants to merge 1 commit into
p10node:mainfrom
Devehab:fix/zoomed-tab-skips-list

Conversation

@Devehab

@Devehab Devehab commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

From @pierreneter's note on #47: while zoomed, tab and shift+tab still stop on the resource list, which is off screen, so a left or space typed next folds a group nobody can see. The same happens if you zoom with ctrl+z while the list has focus.

  • focusNext steps over the list while zoomed, so the cycle is main → command box → main.
  • Zooming from the list moves focus to the main pane, the only one left on screen.

docs/ui.md says so next to the note about the Actions pane. Two tests in zoom_test.go cover tab, shift+tab and ctrl+z from the list; all three cases fail on main. gofmt, go vet ./internal/ui/ and go test ./internal/ui/ pass (with backends_test.go set aside locally, it doesn't fit on my disk). It merges cleanly with #47.

Zoomed, the resource list is off screen, but tab and shift+tab still
stopped on it, and ctrl+z from the list left the keyboard there. A left
or space typed next would then fold a group nobody can see.

focusNext steps over the list while zoomed, and zooming from the list
moves focus to the main pane.

Signed-off-by: Ehab Kahwati <[email protected]>

@junior junior left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked it on 3fb0276: both new tests fail on main with only the test file added (tab and shift+tab land on the hidden list, and ctrl+z from the list leaves the focus there), and each half of the change is needed: without the step in focusNext the tab test fails both ways, and without the move in setZoomed the ctrl+z test does. The branch passes gofmt, vet and go test -short ./... on Go 1.26.11 and 1.27.4, backends_test.go included, plus -race on ., internal/k8s and internal/ui and govulncheck on 1.27.4. It also merges cleanly with #47 as it is now (af00c10), and that merge passes the same, so either can go first.

Putting the move in setZoomed covers every way to zoom (z, ctrl+z, a click on [ zoom ]), all four tab handlers go through focusNext, and the only other way onto the list, left, already checks for the zoom. One thing for later, not for this PR: the Focus section of keybindings.md doesn't mention the zoomed tab yet; that can wait until #47 is in, as #47 edits the same section. Thanks, @Devehab.

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