Cleanup list navigates; spend bars; office writes the missing scaffold; memory read-out per agent
This commit is contained in:
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user