feat(tui): task-board preview frames (tasks / task-detail)
Add "tasks" and "task-detail" kinds to PreviewFrame, backed by a sampleTaskBoard work graph that exercises every readiness glyph and status color (epic blocked on children, a ready child, in-flight, done). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -255,10 +255,56 @@ func PreviewFrame(kind string, w, h int) string {
|
|||||||
}
|
}
|
||||||
m.grantIndex = 1
|
m.grantIndex = 1
|
||||||
m.overlay = OverlayGrants
|
m.overlay = OverlayGrants
|
||||||
|
|
||||||
|
case "tasks", "task-detail":
|
||||||
|
m.connected = true
|
||||||
|
m.currentModel = "llama-cpp:default"
|
||||||
|
m.sessions = sampleSessions()
|
||||||
|
m.selectedID = "04a546aa"
|
||||||
|
m.overlay = OverlayTasks
|
||||||
|
m.taskList = sampleTaskBoard()
|
||||||
|
if kind == "task-detail" {
|
||||||
|
m.taskDetail = true
|
||||||
|
m.taskListIndex = 2 // a blocked child, to show the "waiting on" line
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return m.render()
|
return m.render()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sampleTaskBoard is a decomposed work graph: an epic waiting on its three
|
||||||
|
// children, one of which (webui-2) is ready now, plus an in-flight and a done
|
||||||
|
// task — exercising every readiness glyph and status color.
|
||||||
|
func sampleTaskBoard() []TaskSummary {
|
||||||
|
return []TaskSummary{
|
||||||
|
{
|
||||||
|
ID: "webui-1", Key: "webui-1", Status: "TODO", Title: "Frontend web UI for correx",
|
||||||
|
Goal: "operator can drive sessions from a browser",
|
||||||
|
BlockedBy: []string{"webui-2", "webui-3", "webui-4"},
|
||||||
|
Links: []TaskLinkWire{{TargetID: "webui-2", Type: "DEPENDS_ON", TargetKind: "TASK"}},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ID: "webui-2", Key: "webui-2", Status: "TODO", Title: "Scaffold the Vite + React app",
|
||||||
|
Goal: "buildable shell with routing", Ready: true,
|
||||||
|
AcceptanceCriteria: []string{"npm run build passes", "lands under apps/web"},
|
||||||
|
AffectedPaths: []string{"apps/web/"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ID: "webui-3", Key: "webui-3", Status: "TODO", Title: "Auth / token entry view",
|
||||||
|
Goal: "operator pastes a token and connects", BlockedBy: []string{"webui-2"},
|
||||||
|
Links: []TaskLinkWire{{TargetID: "webui-1", Type: "IMPLEMENTS", TargetKind: "TASK"}},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ID: "webui-4", Key: "webui-4", Status: "TODO", Title: "Session board view",
|
||||||
|
Goal: "live roster mirroring the TUI", BlockedBy: []string{"webui-2"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ID: "api-7", Key: "api-7", Status: "IN_PROGRESS", Title: "CORS + token endpoint",
|
||||||
|
Goal: "server accepts browser origins", Claimant: "04a546aa8b2c",
|
||||||
|
},
|
||||||
|
{ID: "api-3", Key: "api-3", Status: "DONE", Title: "Stable /sessions JSON shape"},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func sampleStats() *protocol.StatsDto {
|
func sampleStats() *protocol.StatsDto {
|
||||||
return &protocol.StatsDto{
|
return &protocol.StatsDto{
|
||||||
SessionID: "04a546aa",
|
SessionID: "04a546aa",
|
||||||
|
|||||||
Reference in New Issue
Block a user