diff --git a/internal/tui/help.go b/internal/tui/help.go index da55262..84176fb 100644 --- a/internal/tui/help.go +++ b/internal/tui/help.go @@ -8,9 +8,11 @@ func renderHelp(width, height int) string { binds [][2]string }{ {"Focus", [][2]string{ - {"tab", "cycle focus: capture → tags → list → detail"}, + {"tab", "toggle capture ↔ list"}, {"esc", "back / clear filter / to capture"}, {"a", "focus capture bar"}, + {"h", "focus tag rail (from list)"}, + {"l", "focus detail (split view)"}, {"ctrl+b", "toggle tag rail"}, }}, {"Capture Bar", [][2]string{ diff --git a/internal/tui/model.go b/internal/tui/model.go index d0fbf8e..3b95780 100644 --- a/internal/tui/model.go +++ b/internal/tui/model.go @@ -333,13 +333,6 @@ func (m model) updateKeys(msg tea.KeyMsg) (tea.Model, tea.Cmd) { return m.updateBrowse(msg) } -func (m model) nextFocusFromCapture() focusPane { - if m.railVisible() { - return focusTagRail - } - return focusList -} - func (m model) updateCapture(msg tea.KeyMsg) (tea.Model, tea.Cmd) { switch msg.String() { case "enter": @@ -364,12 +357,9 @@ func (m model) updateCapture(msg tea.KeyMsg) (tea.Model, tea.Cmd) { return m, createEntity(m.store, result.entity) } return m, nil - case "esc": + case "esc", "tab": cmd := m.setFocus(focusList) return m, cmd - case "tab": - cmd := m.setFocus(m.nextFocusFromCapture()) - return m, cmd } m.input = m.input.updateKey(msg) return m, nil @@ -396,10 +386,7 @@ func (m model) updateBrowse(msg tea.KeyMsg) (tea.Model, tea.Cmd) { return m, loadEntities(m.store, m.listParams()) } return m, nil - case "tab": - m.focus = focusList - return m, nil - case "esc": + case "l", "tab", "esc": m.focus = focusList return m, nil case "ctrl+b": @@ -423,10 +410,6 @@ func (m model) updateBrowse(msg tea.KeyMsg) (tea.Model, tea.Cmd) { if m.splitDetail && m.state == stateList { switch msg.String() { case "tab": - if m.focus == focusList { - m.focus = focusDetail - return m, nil - } cmd := m.setFocus(focusCapture) return m, cmd case "l": @@ -439,6 +422,10 @@ func (m model) updateBrowse(msg tea.KeyMsg) (tea.Model, tea.Cmd) { m.focus = focusList return m, nil } + if m.focus == focusList && m.railVisible() { + m.focus = focusTagRail + return m, nil + } case "esc": if m.focus == focusDetail { m.focus = focusList @@ -559,6 +546,13 @@ func (m model) updateBrowse(msg tea.KeyMsg) (tea.Model, tea.Cmd) { cmd := m.setFocus(focusCapture) return m, cmd + case "h": + if m.state == stateList && m.railVisible() && m.focus == focusList { + m.focus = focusTagRail + return m, nil + } + return m, nil + case "a": if m.state == stateList { cmd := m.setFocus(focusCapture) diff --git a/internal/tui/statusbar.go b/internal/tui/statusbar.go index d9c7722..482ec06 100644 --- a/internal/tui/statusbar.go +++ b/internal/tui/statusbar.go @@ -88,7 +88,7 @@ func contextHints(m model) []hint { case focusCapture: return []hint{{"enter", "submit"}, {"esc", "browse"}, {"?…", "search"}, {"-", "todo"}, {"@", "event"}} case focusTagRail: - return []hint{{"j/k", "nav"}, {"enter", "filter"}, {"ctrl+b", "hide"}, {"tab", "list"}, {"esc", "list"}} + return []hint{{"j/k", "nav"}, {"enter", "filter"}, {"l", "list"}, {"ctrl+b", "hide"}} case focusDetail: if m.splitDetail { return []hint{{"h", "list"}, {"c", "copy"}, {"e", "edit"}, {"p", "promote"}, {"!", "pin"}, {"tab", "capture"}}