From a9732cd49518fdccc508d76c63507b806a7d8216 Mon Sep 17 00:00:00 2001 From: Adao Oliveira Jr Date: Tue, 17 Nov 2026 20:04:46 -0600 Subject: [PATCH 1/2] fix(ui): let left move focus from the main pane to the resource list The keybindings doc has listed left (and h) for this since the first commit, but the main pane stopped handling them in 4f2d400, so from the keyboard the resource list could only be reached with tab or shift+tab, as #45 found. Left in the main pane now focuses the list again, the mirror of right there, and leaves the open view as it is. While the main pane is zoomed the list is off screen, so left stays put. h is not bound with it: docs/plan.md gives h to the history action of the Helm view. The docs drop h, and the tab row of the Global table now says command box, as the Focus section and the code do. The in-app help names left next to tab for reaching the list. Signed-off-by: Adao Oliveira Jr --- README.md | 1 + docs/keybindings.md | 15 ++++++++---- docs/ui.md | 4 ++- internal/ui/commands.go | 2 +- internal/ui/interaction_test.go | 43 +++++++++++++++++++++++++++++++++ internal/ui/model.go | 7 ++++++ 6 files changed, 65 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b5de8cc..e3428c8 100644 --- a/README.md +++ b/README.md @@ -277,6 +277,7 @@ The short version - the [full reference is here](docs/keybindings.md). | Key | Action | |----------------------------------------|------------------------------------------------------| | `tab` / `shift+tab` | cycle panes | +| `left` / `right` | resource list / main pane | | `↑↓` (`j`/`k`) · `pgup/pgdn` · `g`/`G` | move · page · first/last | | type (Resources focused) | instant kind filter · `esc` clears | | `f` | find: search every column of the open table | diff --git a/docs/keybindings.md b/docs/keybindings.md index 79119e0..b4398a1 100644 --- a/docs/keybindings.md +++ b/docs/keybindings.md @@ -6,8 +6,8 @@ |------------------------|-------------------------------------------------------------------------------------------------------------------------------| | `ctrl+c` | quit (always) | | `q` | quit (when not typing in a search box or prompt) | -| `tab` / `shift+tab` | cycle panes Resources → Main → Actions | -| `←` `h` / `→` | focus resource list / main pane | +| `tab` / `shift+tab` | cycle panes Resources → Main → command box | +| `←` / `→` | focus resource list (from the main pane) / main pane (from the list) | | `enter` / double-click | open the selected item — logs if it has them, else describe. On the Namespaces table it switches namespace and shows its pods | | `z` | zoom / restore main pane | | `esc` | close text view → restore zoom (in that order) | @@ -62,6 +62,10 @@ Ctrl, Alt and Shift. In iTerm2, WezTerm or Ghostty you can map Cmd+K to other way. The **Actions pane is not in the cycle**: every action already has a hotkey and a clickable row, so a tab stop there would lead nowhere. +`left` in the main pane goes straight to the resource list, and `right` or +`enter` there comes back. While the main pane is zoomed, `left` stays put: +the list is off screen. + Clicking a resource row or an action acts on it without moving focus. The Resources pane scrolls with the wheel **without changing what is selected** — scrolling is looking, not picking, so the main panel stays where you left @@ -69,9 +73,10 @@ it. The Actions pane does not scroll; it is never taller than its list. ## Resource list (left pane) -`tab` to focus it. Any printable key then filters the list; `↑↓` moves, -`enter` or `→` returns to the table, `esc` clears. The active filter appears -in the panel title, with the match counter in its top-right tag. +`left` from the main pane, or `tab`, focuses it. Any printable key then +filters the list; `↑↓` moves, `enter` or `→` returns to the table, `esc` +clears. The active filter appears in the panel title, with the match counter +in its top-right tag. `space` folds or unfolds the group under the cursor and `left` folds it; clicking a `▾`/`▸` header does either. Config, Storage and RBAC start folded. diff --git a/docs/ui.md b/docs/ui.md index 7155a0c..11cf98c 100644 --- a/docs/ui.md +++ b/docs/ui.md @@ -351,7 +351,9 @@ The pickers share a **Save** button reachable with `tab`. `tab` cycles **Resources → Main → command box** in layout order, and `shift+tab` walks it backwards. The prompt can also be entered with `/`, `:` -or a click, and left with esc. +or a click, and left with esc. `left` in the main pane goes straight to the +resource list and `right` or `enter` there comes back (not while zoomed: the +list is off screen). The **Actions pane is not in the cycle** — every action already has a hotkey and a clickable row, so a tab stop there would be a keystroke that leads diff --git a/internal/ui/commands.go b/internal/ui/commands.go index 7eaa755..21fe670 100644 --- a/internal/ui/commands.go +++ b/internal/ui/commands.go @@ -254,7 +254,7 @@ func Help() string { is open it scrolls the popup, never what is behind it RESOURCE LIST (left pane) - tab focus it + left / tab focus it (left from the main pane, unless zoomed) type to search any letters filter the list instantly; the active filter shows in the panel title. A search looks inside folded groups too. diff --git a/internal/ui/interaction_test.go b/internal/ui/interaction_test.go index 89e5d54..42a161f 100644 --- a/internal/ui/interaction_test.go +++ b/internal/ui/interaction_test.go @@ -121,6 +121,49 @@ func TestTabCycleReturnsToStart(t *testing.T) { } } +// Left takes the keyboard from the main pane to the resource list without a +// lap of tab, and right comes back. +func TestLeftFocusesTheResourceListAndRightComesBack(t *testing.T) { + m := newTestModel(t, mock.New("")) + dismissOnboarding(m) + m.focus = focusMain + + m.handleKey(tea.KeyMsg{Type: tea.KeyLeft}) + if m.focus != focusList { + t.Fatalf("left from the main pane landed on %v, want focusList", m.focus) + } + m.handleKey(tea.KeyMsg{Type: tea.KeyRight}) + if m.focus != focusMain { + t.Fatalf("right from the resource list landed on %v, want focusMain", m.focus) + } +} + +// Moving focus is not picking: the view open in the main pane stays open. +func TestLeftKeepsTheOpenView(t *testing.T) { + m := newTestModel(t, mock.New("")) + dismissOnboarding(m) + openLogs(t, m) + m.focus = focusMain + + m.handleKey(tea.KeyMsg{Type: tea.KeyLeft}) + if m.focus != focusList || m.mode != modeLogs { + t.Errorf("after left: focus %v, mode %v; want focusList with the log view still open", m.focus, m.mode) + } +} + +// Zoomed, the resource list is off screen, so left has nowhere to go. +func TestLeftWhileZoomedStaysInTheMainPane(t *testing.T) { + m := newTestModel(t, mock.New("")) + dismissOnboarding(m) + m.focus = focusMain + m.setZoomed(true) + + m.handleKey(tea.KeyMsg{Type: tea.KeyLeft}) + if m.focus != focusMain { + t.Errorf("left while zoomed landed on %v, want focusMain", m.focus) + } +} + // The resource pane is focusable again, and typing there filters the list. func TestResourcePaneIsFocusableAndFilters(t *testing.T) { m := newTestModel(t, mock.New("")) diff --git a/internal/ui/model.go b/internal/ui/model.go index 0774228..2e3ffa3 100644 --- a/internal/ui/model.go +++ b/internal/ui/model.go @@ -1588,6 +1588,13 @@ func (m *Model) handleKey(msg tea.KeyMsg) tea.Cmd { return m.focusNext(1) case "shift+tab": return m.focusNext(-1) + case "left": + // The arrow's way to the resource list, the mirror of "right" there. + // Zoomed, the list is off screen, so there is nowhere to go. "h" is + // not bound with it: docs/plan.md gives "h" to Helm's history. + if !m.zoomed { + m.focus = focusList + } case "T": m.themeIdx = (m.themeIdx + 1) % len(m.themes) m.toast = "theme → " + m.th().Name From d64435d4718f1f48dd08415b045c0ca7d010d711 Mon Sep 17 00:00:00 2001 From: Adao Oliveira Jr Date: Tue, 17 Nov 2026 21:41:19 -0600 Subject: [PATCH 2/2] docs: drop j/k from the README's key table j and k have not moved the selection since 4f2d400: k opens the command box with "k" already typed, as k is a command name, and j is not bound. The in-app help says so and docs/keybindings.md does not list them, but the README's short table still did. Signed-off-by: Adao Oliveira Jr --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e3428c8..c5030cc 100644 --- a/README.md +++ b/README.md @@ -278,7 +278,7 @@ The short version - the [full reference is here](docs/keybindings.md). |----------------------------------------|------------------------------------------------------| | `tab` / `shift+tab` | cycle panes | | `left` / `right` | resource list / main pane | -| `↑↓` (`j`/`k`) · `pgup/pgdn` · `g`/`G` | move · page · first/last | +| `↑↓` · `pgup/pgdn` · `g`/`G` | move · page · first/last | | type (Resources focused) | instant kind filter · `esc` clears | | `f` | find: search every column of the open table | | `ctrl+p` | **search everything** - kinds and objects in one box |