Files
unkinben 8f48dd838b Add TUI kanban board, review workflow, and new task statuses
Replace task statuses (pending/running/succeeded/failed/cancelled) with
a kanban workflow: todo → in_progress → in_review → done/wontdo.

When a non-review agent task completes, the API auto-creates a child
review task and moves the parent to in_review. Only humans can move
tasks from in_review to done/wontdo via the TUI.

New components:
- cmd/tui: bubbletea kanban board with $EDITOR integration
- POST /api/v1/tasks/{id}/complete: agent completion callback
- Operator --api-url flag for completion callbacks
- ProviderQueue sets tasks to in_progress on pickup
- AgentTask reconciler calls /complete on job finish
2026-06-12 22:47:40 +10:00

93 lines
1.9 KiB
Go

package tui
import "github.com/charmbracelet/bubbles/key"
type keyMap struct {
Left key.Binding
Right key.Binding
Up key.Binding
Down key.Binding
Enter key.Binding
Edit key.Binding
New key.Binding
Done key.Binding
Wontdo key.Binding
Refresh key.Binding
Filter key.Binding
Help key.Binding
Quit key.Binding
Back key.Binding
}
var keys = keyMap{
Left: key.NewBinding(
key.WithKeys("h", "left"),
key.WithHelp("h/←", "prev column"),
),
Right: key.NewBinding(
key.WithKeys("l", "right"),
key.WithHelp("l/→", "next column"),
),
Up: key.NewBinding(
key.WithKeys("k", "up"),
key.WithHelp("k/↑", "up"),
),
Down: key.NewBinding(
key.WithKeys("j", "down"),
key.WithHelp("j/↓", "down"),
),
Enter: key.NewBinding(
key.WithKeys("enter"),
key.WithHelp("enter", "detail"),
),
Edit: key.NewBinding(
key.WithKeys("e"),
key.WithHelp("e", "edit"),
),
New: key.NewBinding(
key.WithKeys("n"),
key.WithHelp("n", "new task"),
),
Done: key.NewBinding(
key.WithKeys("d"),
key.WithHelp("d", "mark done"),
),
Wontdo: key.NewBinding(
key.WithKeys("w"),
key.WithHelp("w", "mark wontdo"),
),
Refresh: key.NewBinding(
key.WithKeys("r"),
key.WithHelp("r", "refresh"),
),
Filter: key.NewBinding(
key.WithKeys("/"),
key.WithHelp("/", "filter repo"),
),
Help: key.NewBinding(
key.WithKeys("?"),
key.WithHelp("?", "help"),
),
Quit: key.NewBinding(
key.WithKeys("q", "ctrl+c"),
key.WithHelp("q", "quit"),
),
Back: key.NewBinding(
key.WithKeys("esc"),
key.WithHelp("esc", "back"),
),
}
func (k keyMap) ShortHelp() []key.Binding {
return []key.Binding{k.Left, k.Right, k.Up, k.Down, k.Enter, k.Edit, k.New, k.Done, k.Quit, k.Help}
}
func (k keyMap) FullHelp() [][]key.Binding {
return [][]key.Binding{
{k.Left, k.Right, k.Up, k.Down},
{k.Enter, k.Edit, k.New, k.Refresh},
{k.Done, k.Wontdo, k.Filter},
{k.Quit, k.Back, k.Help},
}
}