Repository navigation
Conversation
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
left a comment
There was a problem hiding this comment.
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.
From @pierreneter's note on #47: while zoomed,
tabandshift+tabstill stop on the resource list, which is off screen, so aleftorspacetyped next folds a group nobody can see. The same happens if you zoom withctrl+zwhile the list has focus.focusNextsteps over the list while zoomed, so the cycle is main → command box → main.docs/ui.mdsays so next to the note about the Actions pane. Two tests inzoom_test.gocover tab, shift+tab andctrl+zfrom the list; all three cases fail on main.gofmt,go vet ./internal/ui/andgo test ./internal/ui/pass (withbackends_test.goset aside locally, it doesn't fit on my disk). It merges cleanly with #47.