Short comma-separated key hints everywhere; write down what is left to build

This commit is contained in:
Sam
2026-11-11 13:39:52 +11:00
parent f94934569d
commit 0476afcb95
14 changed files with 362 additions and 54 deletions

View File

@@ -853,18 +853,18 @@ func (m agentsModel) View() string {
to := min(len(body), from+visible)
hints := []string{
keyHint("[ ]", "roster, runs, log, settings, skills, extensions"),
keyHint("enter", "open a run"),
keyHint("p P w", "pause, resume, wake"),
keyHint("r", "read again"),
keyHint("[ ]", "tab"),
keyHint("enter", "open"),
keyHint("p P w", "pause/resume/wake"),
keyHint("r", "refresh"),
keyHint("?", "keys"),
}
if m.tab == 4 || m.tab == 5 {
hints = []string{
keyHint("[ ]", "switch tab"),
keyHint("space", "turn this skill or extension on or off"),
keyHint("↑↓ j k", "move"),
keyHint("r", "read again"),
keyHint("[ ]", "tab"),
keyHint("space", "toggle"),
keyHint("↑↓", "move"),
keyHint("r", "refresh"),
}
}
footer := hintLine(hints, m.width)

View File

@@ -463,32 +463,32 @@ func (m boardModel) footerLine() string {
switch m.focus {
case focusTree:
return hintLine([]string{
keyHint("↑↓ or j k", "choose a task"),
keyHint("enter", "show it everywhere"),
keyHint("↑↓", "move"),
keyHint("enter", "open"),
keyHint("a", "assign"),
keyHint("u", "unblock"),
keyHint("t", "tools"),
keyHint("/", "filter"),
keyHint("?", "keys"),
keyHint("tab", "next panel"),
keyHint("r", "read again"),
keyHint("R", "rebuild every pane"),
keyHint("q", "leave"),
keyHint("tab", "panel"),
keyHint("r", "refresh"),
keyHint("R", "rebuild"),
keyHint("q", "quit"),
}, m.width)
case focusSummary:
return hintLine([]string{
keyHint("↑↓ or j k", "choose a task"),
keyHint("tab", "next panel"),
keyHint("r", "read again"),
keyHint("q", "leave"),
keyHint("↑↓", "move"),
keyHint("tab", "panel"),
keyHint("r", "refresh"),
keyHint("q", "quit"),
}, m.width)
default:
return hintLine([]string{
keyHint("tab", "next panel"),
keyHint("[ ]", "switch tab"),
keyHint("tab", "panel"),
keyHint("[ ]", "tab"),
keyHint("enter", "show this task everywhere"),
keyHint("r", "read again"),
keyHint("q", "leave"),
keyHint("r", "refresh"),
keyHint("q", "quit"),
}, m.width)
}
}

View File

@@ -214,9 +214,10 @@ func keyHint(keys, what string) string {
return k + " " + w
}
// hintLine joins key hints with a dot, dropping the ones that do not apply.
// hintLine joins key hints with a comma, because a footer is a list of keys and
// not a sentence.
func hintLine(hints []string, width int) string {
joined := strings.Join(hints, dimStyle().Render(" · "))
joined := strings.Join(hints, dimStyle().Render(", "))
if lipgloss.Width(joined) > width {
return truncateVisible(joined, width)
}

View File

@@ -288,9 +288,9 @@ func (m newTaskModel) View() string {
formLines := m.formLines(m.width - 4)
footer := hintLine([]string{
keyHint("tab", "next field"),
keyHint("enter", "next, and create on the last"),
keyHint("ctrl+n", "form, guidance, preview"),
keyHint("tab", "field"),
keyHint("enter", "next/create"),
keyHint("ctrl+n", "tab"),
keyHint("esc", "cancel"),
}, m.width)

View File

@@ -254,11 +254,11 @@ func (m projectModel) View() string {
to := min(len(body), from+visible)
footer := hintLine([]string{
keyHint("[ ]", "switch tab"),
keyHint("↑↓ or j k", "scroll"),
keyHint("r", "read again"),
keyHint("R", "rebuild every pane"),
keyHint("q", "leave"),
keyHint("[ ]", "tab"),
keyHint("↑↓", "scroll"),
keyHint("r", "refresh"),
keyHint("R", "rebuild"),
keyHint("q", "quit"),
}, m.width)
gap := max(2, m.width-lipgloss.Width(head)-lipgloss.Width(state)-1)

View File

@@ -302,11 +302,11 @@ func (m repairModel) View() string {
to := min(len(body), from+visible)
footer := hintLine([]string{
keyHint("[ ]", "switch tab"),
keyHint("R", "rebuild every pane"),
keyHint("↑↓ or j k", "scroll"),
keyHint("r", "check again"),
keyHint("q", "leave"),
keyHint("[ ]", "tab"),
keyHint("R", "rebuild"),
keyHint("↑↓", "scroll"),
keyHint("r", "recheck"),
keyHint("q", "quit"),
}, m.width)
gap := max(2, m.width-lipgloss.Width(head)-lipgloss.Width(state)-1)

View File

@@ -291,18 +291,18 @@ func (m replyModel) View() string {
boxLines := m.composerLines(m.width-4, composer.bodyHeight())
footer := hintLine([]string{
keyHint("enter or tab", "write a reply"),
keyHint("s", "choose a status to send"),
keyHint("↑↓ or j k", "read the thread"),
keyHint("r", "read again"),
keyHint("R", "rebuild every pane"),
keyHint("q", "leave"),
keyHint("enter", "reply"),
keyHint("s", "status"),
keyHint("↑↓", "scroll"),
keyHint("r", "refresh"),
keyHint("R", "rebuild"),
keyHint("q", "quit"),
}, m.width)
if m.inBox {
footer = hintLine([]string{
keyHint("enter", "send"),
keyHint("alt+enter", "new line"),
keyHint("esc", "close the box"),
keyHint("alt+enter", "newline"),
keyHint("esc", "close"),
}, m.width)
}
if m.err != nil {

View File

@@ -518,15 +518,15 @@ func (m workModel) View() string {
to := min(len(body), from+visible)
footer := hintLine([]string{
keyHint("[ ]", "switch tab"),
keyHint("↑↓ or j k", "scroll"),
keyHint("t", "open a tool pane"),
keyHint("o", "choose a task"),
keyHint("m", "merge this task (asks first)"),
keyHint("]", "tabs"),
keyHint("r", "read again"),
keyHint("R", "rebuild every pane"),
keyHint("q", "leave"),
keyHint("n p", "task"),
keyHint("[ ]", "tab"),
keyHint("↑↓", "scroll"),
keyHint("enter", "log"),
keyHint("o", "pick"),
keyHint("m", "merge"),
keyHint("t", "tools"),
keyHint("r", "refresh"),
keyHint("R", "rebuild"),
}, m.width)
return strings.Join([]string{