Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ The short version - the [full reference is here](docs/keybindings.md).
| Key | Action |
|----------------------------------------|------------------------------------------------------|
| `tab` / `shift+tab` | cycle panes |
| `↑↓` (`j`/`k`) · `pgup/pgdn` · `g`/`G` | move · page · first/last |
| `left` / `right` | resource list / main pane |
| `↑↓` · `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 |
Expand Down
15 changes: 10 additions & 5 deletions docs/keybindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down Expand Up @@ -62,16 +62,21 @@ 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
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.
Expand Down
4 changes: 3 additions & 1 deletion docs/ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/ui/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
43 changes: 43 additions & 0 deletions internal/ui/interaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(""))
Expand Down
7 changes: 7 additions & 0 deletions internal/ui/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading