diff --git a/README.md b/README.md index d01adc4..3d5574d 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,8 @@ use most: | Key | Action | |---|---| -| `j`/`k`, `h`/`l`, `enter`, `esc` | move, switch panes, drill in, back | +| `j`/`k`, `enter`, `esc` | move, drill in, back | +| `l` / `h` | the details of what's selected / back | | `/` | filter the list you're in | | `space` | reveal / hide the value | | `y` | copy the value (cleared from the clipboard after 30s) | diff --git a/docs/keys.md b/docs/keys.md index 893d179..d087f15 100644 --- a/docs/keys.md +++ b/docs/keys.md @@ -13,7 +13,8 @@ The rule: a letter in the lists, ctrl+ that letter where you type a filter |---|---| | `j`/`k`, `↑`/`↓` | move | | `g`/`G` | top / bottom | -| `tab`/`l`, `shift+tab`/`h` | next / previous pane | +| `tab`, `shift+tab`/`h` | next / previous pane | +| `l` | the details of what's selected, on the right (`h` goes back) | | `1`–`4` | jump to pane | | `enter` / `esc`, `⌫` | drill in / back (also clears a filter or leaves the versions view) | | `[` / `]` | previous / next tab of the focused pane: Sources and Favourites in Sources; Secrets, Keys, Certs in Secrets | @@ -107,9 +108,8 @@ anything loads. The pane on the right describes what's selected in the pane you're in: the account or subscription in Sources, the vault in Vaults, the secret in -Secrets. Going into it (`4`, or `tab` from an account's row) keeps it on -that; there `j`/`k`, `/` and `y` work on its rows, and `shift+tab` goes -back. A value you reveal stays in view whichever pane you're in, until +Secrets. Going into it (`l`, or `4`) keeps it on that; there `j`/`k`, +`/` and `y` work on its rows, and `h` goes back. A value you reveal stays in view whichever pane you're in, until it's hidden. On top, the status pane (`0`) shows the version, a newer release and how diff --git a/internal/ui/app/app.go b/internal/ui/app/app.go index 7b0880c..362f185 100644 --- a/internal/ui/app/app.go +++ b/internal/ui/app/app.go @@ -821,6 +821,8 @@ func (m *Model) handleKey(msg tea.KeyPressMsg) (cmd tea.Cmd, quit bool) { if r, ok := m.sources.Selected(); ok && m.focus == paneContainers && r.kind == rowGroup { m.focus = paneDetail // an account's row: nothing between } + case key.Matches(msg, k.Details): + m.focus = paneDetail // what's selected, on the right case key.Matches(msg, k.PrevPane): if m.focus == paneDetail { m.focus = m.lastLeft // back to what it describes diff --git a/internal/ui/app/app_test.go b/internal/ui/app/app_test.go index e526a91..3f1236d 100644 --- a/internal/ui/app/app_test.go +++ b/internal/ui/app/app_test.go @@ -758,7 +758,9 @@ func TestFocusKeys(t *testing.T) { }{ {"tab", paneContainers}, {"enter", paneSecrets}, {"enter", paneDetail}, {"enter", paneDetail}, {"esc", paneSecrets}, {"shift+tab", paneContainers}, - {"4", paneDetail}, {"l", paneSources}, {"h", paneDetail}, + {"4", paneDetail}, {"tab", paneSources}, {"shift+tab", paneDetail}, + // l: what's selected, on the right; h: back to it. + {"2", paneContainers}, {"l", paneDetail}, {"h", paneContainers}, {"h", paneSources}, {"l", paneDetail}, } { d.keys(tc.key) if d.m.focus != tc.want { diff --git a/internal/ui/keys/keys.go b/internal/ui/keys/keys.go index 1e81dc3..e3d7d6d 100644 --- a/internal/ui/keys/keys.go +++ b/internal/ui/keys/keys.go @@ -36,7 +36,7 @@ const ( type Map struct { // lists Up, Down, Top, Bottom key.Binding - NextPane, PrevPane key.Binding + NextPane, PrevPane, Details key.Binding Pane0, Pane1, Pane2, Pane3, Pane4 key.Binding NextTab, PrevTab key.Binding Enter, Back, Filter key.Binding @@ -87,7 +87,8 @@ func (m *Map) Actions() []Action { a(Lists, "top", &m.Top, "top", "move", "Jump to the top of the focused list."), a(Lists, "bottom", &m.Bottom, "bottom", "move", "Jump to the bottom of the focused list."), a(Lists, "nextPane", &m.NextPane, "next pane", "move", "Focus the next pane: Sources, Vaults, Secrets, detail."), - a(Lists, "prevPane", &m.PrevPane, "prev pane", "move", "Focus the previous pane."), + a(Lists, "prevPane", &m.PrevPane, "prev pane", "move", "Focus the previous pane; from the detail pane, the one it describes."), + a(Lists, "details", &m.Details, "details", "move", "Focus the detail pane on the right, on what's selected: a source, vault, file or secret."), a(Lists, "pane1", &m.Pane1, "Sources pane", "move", "Focus the Sources pane."), a(Lists, "pane2", &m.Pane2, "Vaults pane", "move", "Focus the Vaults (or Scopes) pane."), a(Lists, "pane3", &m.Pane3, "Secrets pane", "move", "Focus the Secrets pane."), @@ -178,7 +179,7 @@ func (m *Map) Actions() []Action { var defaults = map[string][]string{ "lists.up": {"k", "up", "ctrl+k", "ctrl+p"}, "lists.down": {"j", "down", "ctrl+j", "ctrl+n"}, "lists.top": {"g", "home"}, "lists.bottom": {"G", "end"}, - "lists.nextPane": {"tab", "l", "right"}, "lists.prevPane": {"shift+tab", "h", "left"}, + "lists.nextPane": {"tab"}, "lists.prevPane": {"shift+tab", "h", "left"}, "lists.details": {"l", "right"}, "lists.pane1": {"1"}, "lists.pane2": {"2"}, "lists.pane3": {"3"}, "lists.pane4": {"4"}, "lists.pane0": {"0"}, "lists.enter": {"enter"}, "lists.back": {"esc", "backspace"}, "lists.filter": {"/"}, "lists.prevTab": {"["}, "lists.nextTab": {"]"}, "lists.sourcesView": {"`"},