diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-07 19:58:59 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-07 19:58:59 +0300 |
| commit | a08c45e934bed5fded2708df535e1c8f8776fa23 (patch) | |
| tree | 4f278c561f60df54e5cb2a2659b0c1788dae234b | |
| parent | 51c66f392937aab1cb0909985217ced177c01b7a (diff) | |
ui: add r, o, space hotkeys to ultra mode
- r: set random due date
- o: open URL from task description/annotations
- space: refresh tasks (was previously page-down; pgdn/pgdown still work)
Update ultra help screen and tests accordingly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rw-r--r-- | internal/ui/table_test.go | 10 | ||||
| -rw-r--r-- | internal/ui/ultra.go | 11 |
2 files changed, 16 insertions, 5 deletions
diff --git a/internal/ui/table_test.go b/internal/ui/table_test.go index f3f2da3..74c7e70 100644 --- a/internal/ui/table_test.go +++ b/internal/ui/table_test.go @@ -803,8 +803,9 @@ func TestUltraHelpUsesUltraBindingsAndClosesBeforeLeavingUltra(t *testing.T) { if !strings.Contains(view, "exit ultra mode") { t.Fatalf("ultra help content missing ultra exit binding: %q", view) } - if strings.Contains(view, "open URL from description") { - t.Fatalf("ultra help rendered normal-mode binding: %q", view) + // "open URL from description" is now available in ultra mode (o key). + if !strings.Contains(view, "open URL from description") { + t.Fatalf("ultra help missing o/open-URL binding: %q", view) } if strings.Contains(view, "edit current field") { t.Fatalf("ultra help rendered normal-only inline edit binding: %q", view) @@ -856,8 +857,9 @@ func TestUltraHelpSearchUsesUltraHelpLines(t *testing.T) { step(tea.KeyPressMsg{Code: r, Text: string(r)}) } step(tea.KeyPressMsg{Code: tea.KeyEnter}) - if got := len(m.helpSearchMatches); got != 0 { - t.Fatalf("ultra help search matched normal help content, got %d matches", got) + // "URL" now appears in ultra help since the o key (open URL) is available. + if got := len(m.helpSearchMatches); got == 0 { + t.Fatalf("ultra help search for 'URL' should match (o key added), got 0 matches") } step(tea.KeyPressMsg{Code: '/', Text: "/"}) diff --git a/internal/ui/ultra.go b/internal/ui/ultra.go index de9a301..78866be 100644 --- a/internal/ui/ultra.go +++ b/internal/ui/ultra.go @@ -84,6 +84,7 @@ func (m Model) ultraHelpSections() []helpSection { {key: "j, k", desc: "move down/up"}, {key: "pgup, pgdn", desc: "page up/down"}, {key: "g, G", desc: "go to start/end"}, + {key: "space", desc: "refresh tasks"}, }, }, { @@ -94,6 +95,7 @@ func (m Model) ultraHelpSections() []helpSection { {key: "d", desc: "mark task done"}, {key: "U", desc: "undo last done"}, {key: "+", desc: "add new task"}, + {key: "o", desc: "open URL from description"}, }, }, { @@ -102,6 +104,7 @@ func (m Model) ultraHelpSections() []helpSection { {key: "p", desc: "set priority"}, {key: "w", desc: "set due date"}, {key: "W", desc: "remove due date"}, + {key: "r", desc: "set random due date"}, {key: "t", desc: "edit tags"}, {key: "a, A", desc: "add/replace annotations"}, {key: "J", desc: "edit project"}, @@ -1038,10 +1041,12 @@ func (m *Model) handleUltraMode(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) { m.ultraMoveSearchMatch(1) case "N": m.ultraMoveSearchMatch(-1) - case "pgdn", "pgdown", "space": + case "pgdn", "pgdown": m.ultraMoveCursor(m.ultraVisibleCount()) case "pgup", "b": m.ultraMoveCursor(-m.ultraVisibleCount()) + case "space": + return m.handleRefresh() case "g", "home": m.ultraGoHome() case "G", "end": @@ -1058,6 +1063,10 @@ func (m *Model) handleUltraMode(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) { return m.handleUltraSetDueDate() case "W": return m.handleUltraRemoveDueDate() + case "r": + return m.handleRandomDueDate() + case "o": + return m.handleOpenURL() case "t": return m.handleUltraEditTags() case "a": |
