Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/tui/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ type app struct {
boardOrder []string
boardGroups []string
boardCursor int
boardTouched bool // the user moved the Flow selection
boardStop int64 // session awaiting Enter to confirm a stop
boardMachine bool
boardFilter int
Expand Down
15 changes: 13 additions & 2 deletions internal/tui/board.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,14 @@ func (m *app) syncBoard() {
})
m.boardPinned = previous
m.board = b
// Until the user moves the selection, it follows the oldest session that
// needs you rather than whichever row sorts first.
want := previous
if !m.boardTouched && len(b.Needs) > 0 {
want = b.Needs[0].Key
}
for i, r := range m.boardRows() {
if r.Key == previous {
if r.Key == want {
m.boardCursor = i
break
}
Expand Down Expand Up @@ -190,6 +196,7 @@ func (m *app) boardKey(k string) (tea.Cmd, bool) {
m.flowAskCursor = max(0, min(len(m.board.Needs)-1, m.flowAskCursor+d))
} else {
m.boardCursor = max(0, min(len(m.boardRows())-1, m.boardCursor+d))
m.boardTouched = true
}
m.armBoardPrompt()
return nil, true
Expand Down Expand Up @@ -311,7 +318,11 @@ func (m *app) boardLayout() (string, []flowHit) {
}
action := "Enter open · J Terminal"
if r.PromptID != "" {
action = "y Allow · n Deny · Enter open full command"
// y/n answer only a focused prompt, so say how to focus it first.
action = "Tab, then y Allow · n Deny · Enter open full command"
if m.flowAttention {
action = "y Allow · n Deny · Enter open full command"
}
}
add(" " + action)
hits = append(hits, flowHit{y: 4, width: w, height: max(1, len(lines)-3), index: -idx - 1})
Expand Down
11 changes: 11 additions & 0 deletions internal/tui/board_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ func TestBoardStopNeedsConfirmation(t *testing.T) {
t.Fatalf("%c confirmed a stop", key)
}
}
id = m.boardSelected().Node.ID
m.Update(tea.KeyPressMsg{Code: 'K'})
_, cmd := m.Update(tea.KeyPressMsg{Code: tea.KeyEnter})
execute(t, m, cmd)
Expand Down Expand Up @@ -305,3 +306,13 @@ func TestFlowFullPromptInspector(t *testing.T) {
t.Fatal("prompt command truncated")
}
}

func TestBoardOpensOnTheOldestNeed(t *testing.T) {
m := boardApp(t, "busy")
if len(m.board.Needs) == 0 {
t.Fatal("fixture has no needs")
}
if got, want := m.boardSelected().Key, m.board.Needs[0].Key; got != want {
t.Fatalf("first selection = %s, want the oldest need %s", got, want)
}
}
1 change: 1 addition & 0 deletions internal/tui/mouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func (m *app) mouseClick(msg tea.MouseClickMsg) tea.Cmd {
} else {
m.flowAttention = false
m.boardCursor = h.index
m.boardTouched = true
}
return nil
}
Expand Down
35 changes: 18 additions & 17 deletions internal/tui/testdata/board-busy-100.golden
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,23 @@ NEEDS YOU · 7 · oldest first
◆ Add board view · from Editor · relay · 14m
+4 more · Tab then j/k
────────────────────────────────────────────────────────────────────────────────────────────────────
atlas
├── › ○ Fix retry after reconnect codex ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░─ 1h 50m
├── ▶ Fix retry after reconnect codex ░░━━━━░░░━━━━━━░░░━━━━━━░░░━━━━━━░░░░━━━━━ 1h 26m
├── ○ Investigate cache invalidati… codex ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░─ 1h 14m
├── ✓ Fix retry after reconnect codex ░░░░░░░░░░░░░━━░░░━━━━━━░░░✓━━━━━ ━━━━━ 1h 2m
└── ○ Investigate cache invalidati… codex ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░─ 50m
└── ‖ Investigate cache invalid… codex ░░░░░░░░░░━━━━━░░░━━━━━━░░░━━━━━━░░░░━━━━░ 5m
canon
├── ▶ Add board view · from Editor claude ░░░░━━░░░━━━━━━░░░━━━━━━░░░━━━━━━░░░░━━━┿━ 1h 49m
├── ◆ 流れを整える 🌊 claude ░░░░░░░░░━━━━━━░░░━━━━━━░░░━━━━━◆◆◆◆◆◆◆◆◆◆ 13m
├── ▶ Add board view · from Editor claude ░━━━━━░░░━━━━━━░░░━━━━━━░░░━━━━━━░░░░━━━┿━ 1h 25m
├── ▶ 流れを整える 🌊 claude ░░░░░░░░░━━━━━━░░░━━━━━━░░░━━━━━━░░░░━━━┿━ 1h 13m
├── ▶ Add board view · from Editor claude ░░░░░░░░░░░░━━━░░░━━━━━━░░░━━━━━━░░░░━━━┿━ 1h 1m
└── ▶ 流れを整える 🌊 claude ━━ ░░━━━━━━░░░━━━━━━░░░━━━━━━░░░░━━━┿━ 49m
driga
├── ▶ 流れを整える 🌊 claude ░━━━━━░░░━━━━━━░░░━━━━━━░░░━━━━━━░░░░━━━┿━ 1h 45m
echo-pro
├── ▶ Investigate cache invalidati… codex ░░━━━━░░░━━━━━━░░░━━━━━━░░░━━━━━━░░░░━━━━━ 1h 46m
├── ✓ Investigate cache invalidati… codex ░░░░░░░░░░░░░━━░░░━━━━━━░░░━━━✓━━ ━━━━━ 1h 22m
├── ○ Fix retry after reconnect codex ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░─ 1h 10m
├── ‖ Investigate cache invalidati… codex ░░░░░░░░░━━━━━░░░━━━━━━░░░━━━━━━░░░░━━━━░ 1m
└── ▶ Fix retry after reconnect codex ━━━━ ━━━━━━░░░━━━━━━░░░━━━━━━░░░░━━━━━ 46m
└── ○ Fix retry after reconnect codex ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░─ 1h 34m
inloop
├── ‖ An intentionally long title … gemini ░░░━━━░░░━━━━━━░░░━━━━━━░░░━━━━━━░░░░━━━━░ 3m
├── ○ An intentionally long title … gemini ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░─ 1h 24m
├── ✓ Polish onboarding copy gemini ░░░░░░░░░━━━━━━░░░━━━━━━░░░━━━━━━░░░░✓━━━━ 1h 12m
├── ○ An intentionally long title … gemini ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░─ 1h 0m
└── ‖ Polish onboarding copy gemini ━━━ ░━━━━━━░░░━━━━━━░░░━━━━━━░░░░━━━━░ 3m
└── ▶ Polish onboarding copy gemini ░░░░░░░░░━━━━━━░░░━━━━━━░░░━━━━━━░░░░━━━━━ 1h 36m
monk
├── › ◆ Ship the release pipeline sa… copilot ░░━━━━░░░━━━━━━░░░━━━━━━░◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆ 23m
────────────────────────────────────────────────────────────────────────────────────────────────────
Fix retry after reconnect · codex · idle
Ship the release pipeline safely · copilot · waiting
cost $0.49 · retained window
Enter Open session · J Terminal · K Stop · c Ask Chat · Tab Needs you · / Find
44 changes: 22 additions & 22 deletions internal/tui/testdata/board-busy-140.golden
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
Flow [m Map] [t Timeline] [s Sessions] · Map · last 60m │ ╭ Selected family ───────────────────────────╮
◆ 7 needs you ▶ 35 ‖ 7 ○ 14 ✓ 7 │ Fix retry after reconnect · atlas · codex │
██ events/min · updated 0s ago │ · idle │
◆ 7 needs you ▶ 35 ‖ 7 ○ 14 ✓ 7 │ Ship the release pipeline safely · monk · │
██ events/min · updated 0s ago │ copilot · waiting │
NEEDS YOU · 7 · oldest first │ −60m now │
◆ Ship the release pipeline safely · monk · 23m │ └── ○ Fix retry after reconnect │
Permission · Bash · go test ./... │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░─ │
Enter open · J Terminal │ J Terminal · Enter Open · c Ask Chat · K │
◆ 流れを整える 🌊 · driga · 15m │ Stop │
◆ Add board view · from Editor · relay · 14m ╰────────────────────────────────────────────╯
+4 more · Tab then j/k
◆ Ship the release pipeline safely · monk · 23m │ └── ◆ Ship the release pipeline safely │
Permission · Bash · go test ./... │ ░░━━━░░░━━━━━░░░━━━━━░◆◆◆◆◆◆◆◆◆◆◆◆◆◆ │
Enter open · J Terminal │ cost $0.49 · retained window │
◆ 流れを整える 🌊 · driga · 15m │ J Terminal · Enter Open · c Ask Chat · K │
◆ Add board view · from Editor · relay · 14m │ Stop │
+4 more · Tab then j/k ╰────────────────────────────────────────────╯
───────────────────────────────────────────────────────────────────────────────────────────
atlas
├── › ○ Fix retry after reconnect codex ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░─ 1h 50m
├── ▶ Fix retry after reconnect codex ░━━━━░░░━━━━━░░░━━━━━░░━━━━━━░░━━━━━ 1h 26m
├── ○ Investigate cache invalid… codex ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░─ 1h 14m
├── ✓ Fix retry after reconnect codex ░░░░░░░░░░░━━░░░━━━━━░░✓━━━━━ ━━━━━ 1h 2m
└── ○ Investigate cache invalid… codex ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░─ 50m
└── ‖ Investigate cache inva… codex ░░░░░░░░━━━━━░░░━━━━━░░━━━━━━░░━━━━░ 5m
canon
├── ▶ Add board view · from Edi… claude ░░░━━░░░━━━━━░░░━━━━━░░━━━━━━░░━━━┿━ 1h 49m
├── ◆ 流れを整える 🌊 claude ░░░░░░░░━━━━━░░░━━━━━░░━━━━━◆◆◆◆◆◆◆◆ 13m
├── ▶ Add board view · from Edi… claude ░━━━━░░░━━━━━░░░━━━━━░░━━━━━━░░━━━┿━ 1h 25m
├── ▶ 流れを整える 🌊 claude ░░░░░░░░━━━━━░░░━━━━━░░━━━━━━░░━━━┿━ 1h 13m
├── ▶ Add board view · from Edi… claude ░░░░░░░░░░━━━░░░━━━━━░░━━━━━━░░━━━┿━ 1h 1m
└── ▶ 流れを整える 🌊 claude ━━ ░░━━━━━░░░━━━━━░░━━━━━━░░━━━┿━ 49m
driga
├── ▶ 流れを整える 🌊 claude ░━━━━░░░━━━━━░░░━━━━━░░━━━━━━░░━━━┿━ 1h 45m
├── ▶ 流れを整える 🌊 claude ░░░░░░░░░░━━━░░░━━━━━░░━━━━━━░░━━━┿━ 1h 21m
Expand All @@ -32,3 +18,17 @@ driga
└── ▶ Add board view · from … claude ░░░░░░░░━━━━━░░░━━━━━░░━━━━━━░░━━━┿━ 1h 33m
echo-pro
├── ▶ Investigate cache invalid… codex ░━━━━░░░━━━━━░░░━━━━━░░━━━━━━░░━━━━━ 1h 46m
├── ✓ Investigate cache invalid… codex ░░░░░░░░░░░━━░░░━━━━━░░━━━✓━━ ━━━━━ 1h 22m
├── ○ Fix retry after reconnect codex ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░─ 1h 10m
├── ‖ Investigate cache invalid… codex ░░░░░░░━━━━━░░░━━━━━░░━━━━━━░░━━━━░ 1m
└── ▶ Fix retry after reconnect codex ━━━━ ━━━━━░░░━━━━━░░━━━━━━░░━━━━━ 46m
└── ○ Fix retry after reconn… codex ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░─ 1h 34m
inloop
├── ‖ An intentionally long tit… gemini ░░━━━░░░━━━━━░░░━━━━━░░━━━━━━░░━━━━░ 3m
├── ○ An intentionally long tit… gemini ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░─ 1h 24m
├── ✓ Polish onboarding copy gemini ░░░░░░░░━━━━━░░░━━━━━░░━━━━━━░░━✓━━━ 1h 12m
├── ○ An intentionally long tit… gemini ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░─ 1h 0m
└── ‖ Polish onboarding copy gemini ━━━ ░━━━━━░░░━━━━━░░━━━━━━░░━━━━░ 3m
└── ▶ Polish onboarding copy gemini ░░░░░░░░━━━━━░░░━━━━━░░━━━━━━░░━━━━━ 1h 36m
monk
├── › ◆ Ship the release pipeline… copilot ░░━━━░░░━━━━━░░░━━━━━░◆◆◆◆◆◆◆◆◆◆◆◆◆◆ 23m
Loading
Loading