feat(dashboard): Add dynamic work status column for convoys

The status column now shows computed work status based on progress and activity:
- "complete" (green) - all tracked items are done
- "active" (green) - recent polecat activity (within 1 min)
- "stale" (yellow) - older activity (1-5 min)
- "stuck" (red) - stale activity (5+ min)
- "waiting" (gray) - no assignee/activity

Previously the status column always showed "open" since we only fetch
open convoys, making it static and uninformative.

Changes:
- templates.go: Add WorkStatus field to ConvoyRow, add workStatusClass func
- fetcher.go: Add calculateWorkStatus() to compute status from progress/activity
- convoy.html: Add work status badge styling, use WorkStatus in table

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Mike Lady
2026-01-03 18:03:51 -08:00
parent 6e8c43fc0f
commit fe72bd4ddc
3 changed files with 116 additions and 9 deletions

View File

@@ -43,7 +43,8 @@ type MergeQueueRow struct {
type ConvoyRow struct {
ID string
Title string
Status string // "open" or "closed"
Status string // "open" or "closed" (raw beads status)
WorkStatus string // Computed: "complete", "active", "stale", "stuck", "waiting"
Progress string // e.g., "2/5"
Completed int
Total int
@@ -65,6 +66,7 @@ func LoadTemplates() (*template.Template, error) {
funcMap := template.FuncMap{
"activityClass": activityClass,
"statusClass": statusClass,
"workStatusClass": workStatusClass,
"progressPercent": progressPercent,
}
@@ -109,6 +111,24 @@ func statusClass(status string) string {
}
}
// workStatusClass returns the CSS class for a computed work status.
func workStatusClass(workStatus string) string {
switch workStatus {
case "complete":
return "work-complete"
case "active":
return "work-active"
case "stale":
return "work-stale"
case "stuck":
return "work-stuck"
case "waiting":
return "work-waiting"
default:
return "work-unknown"
}
}
// progressPercent calculates percentage as an integer for progress bars.
func progressPercent(completed, total int) int {
if total == 0 {