Cleanup list navigates; spend bars; office writes the missing scaffold; memory read-out per agent

This commit is contained in:
Sam
2026-11-11 15:05:43 +11:00
parent 3ec960e349
commit 36abdc1f84
13 changed files with 726 additions and 4 deletions

View File

@@ -383,11 +383,23 @@ func (m projectModel) costLines() []string {
}
total := 0
runs := 0
out := []string{"", dimStyle().Render(fmt.Sprintf("%-10s %-10s %8s %6s", "task", "state", "cents", "runs"))}
peak := 1
for _, c := range m.costs {
if c.Cents > peak {
peak = c.Cents
}
}
out := []string{"", dimStyle().Render(fmt.Sprintf("%-10s %-10s %6s %5s %s", "task", "state", "cents", "runs", "share of the largest"))}
for _, c := range m.costs {
total += c.Cents
runs += c.Runs
out = append(out, fmt.Sprintf("%-10s %-10s %8d %6d", c.Identifier, c.Status, c.Cents, c.Runs))
bars := int(float64(c.Cents) / float64(peak) * 24)
bar := strings.Repeat("█", bars)
if c.Cents > 0 && bars == 0 {
bar = "▏"
}
out = append(out, fmt.Sprintf("%-10s %-10s %6d %5d %s", c.Identifier, c.Status, c.Cents, c.Runs,
lipgloss.NewStyle().Foreground(lipgloss.Color(active.Accent)).Render(bar)))
}
out = append(out, "")
out = append(out, m.row("total, recent", fmt.Sprintf("%d cent(s) over %d run(s)", total, runs)))