summaryrefslogtreecommitdiff
path: root/internal/ui/table.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-22 16:19:38 +0300
committerPaul Buetow <paul@buetow.org>2026-04-22 16:19:38 +0300
commit29cca706b843fa1675b8d16956fd1cc1dbbbd3da (patch)
tree073101d964ff199a9e35edcd341d2443341bf739 /internal/ui/table.go
parent0ae497b3ab3bff2693c319c10057c0f8648928bf (diff)
h7: add configurable agent filter hotkey
Diffstat (limited to 'internal/ui/table.go')
-rw-r--r--internal/ui/table.go27
1 files changed, 22 insertions, 5 deletions
diff --git a/internal/ui/table.go b/internal/ui/table.go
index f41472b..1fedd19 100644
--- a/internal/ui/table.go
+++ b/internal/ui/table.go
@@ -189,10 +189,11 @@ type Model struct {
inProgress int
due int
- filters []string
- tasks []task.Task
- undoStack []string
- browserCmd string
+ filters []string
+ tasks []task.Task
+ undoStack []string
+ browserCmd string
+ agentFilterHotkey string
theme Theme
defaultTheme Theme
@@ -370,7 +371,7 @@ func (m *Model) startBlink(id int, markDone bool) tea.Cmd {
// New creates a new UI model with the provided rows.
func New(filters []string, browserCmd string) (Model, error) {
- m := Model{filters: filters, browserCmd: browserCmd, blinkState: blinkState{blinkEnabled: true}}
+ m := Model{filters: filters, browserCmd: browserCmd, agentFilterHotkey: "3", blinkState: blinkState{blinkEnabled: true}}
m.annotateInput = textinput.New()
m.annotateInput.Prompt = "annotation: "
m.descInput = textinput.New()
@@ -928,6 +929,7 @@ func (m Model) helpSections() []helpSection {
{
title: "View & Search",
items: []helpItem{
+ {key: m.agentFilterHotkeyLabel(), desc: "toggle +agent/-agent filter"},
{key: "f", desc: "change filter"},
{key: "/, ?", desc: "search"},
{key: "n, N", desc: "next/previous match"},
@@ -1358,3 +1360,18 @@ func (m *Model) SetUltra(u bool) {
m.showUltra = u
m.ultraStartup = u
}
+
+// SetAgentFilterHotkey configures the key that toggles the agent filter.
+func (m *Model) SetAgentFilterHotkey(key string) {
+ if strings.TrimSpace(key) == "" {
+ return
+ }
+ m.agentFilterHotkey = key
+}
+
+func (m Model) agentFilterHotkeyLabel() string {
+ if strings.TrimSpace(m.agentFilterHotkey) == "" {
+ return "3"
+ }
+ return m.agentFilterHotkey
+}