Problem
Run history is a flat table of runs with timestamps, durations, and exit codes. No trends, no insights, no visual summary of how a loop is performing over time.
Solution
Add visual trend indicators to the run history panel.
Features
-
Sparkline of durations
- Unicode block characters: low blocks for fast, tall for slow
- Shows last N runs (up to 20, fits in panel width)
- Color: green if under average, red if over average
- Example: fast loop -> slow loop -> back to fast
▁▂▁▂▃█▆▄▂▁
-
Success/failure streak
- "Streak: 5 successes" or "Streak: 3 failures"
- Color-coded: green for success streak, red for failure streak
- Helps spot degrading loops
-
Average duration
- "Avg: 1.2s" next to the sparkline
- Computed from last N runs (same window as sparkline)
-
Last failure timestamp
- "Last failure: 2h ago" if any recent failure exists
- Helps answer "when did this last break?"
-
Trend arrow
- Up arrow if getting slower (recent avg > overall avg)
- Down arrow if getting faster
- Dash if stable
Layout
+----------------------------------------------+
| Run History |
| |
| Durations: ▁▂▁▂▃█▆▄▂▁ Avg: 1.2s Trend: ▲ |
| Streak: 5 successes Last failure: 2h ago |
| |
| 14:32:10 ✓ 1.2s 145B |
| 14:30:10 ✓ 1.1s 33B |
| 14:28:10 ✗ 0.1s 0B |
| ... |
+----------------------------------------------+
Implementation
- Pure computation from existing runHistory data (no new storage)
- Sparkline rendered with Unicode block characters (no external dependency)
- Recent N = Math.min(runHistory.length, panelWidth / 2)
- Colors from theme.ts
Acceptance criteria
Part of v2.0.0 epic #4
Problem
Run history is a flat table of runs with timestamps, durations, and exit codes. No trends, no insights, no visual summary of how a loop is performing over time.
Solution
Add visual trend indicators to the run history panel.
Features
Sparkline of durations
▁▂▁▂▃█▆▄▂▁
Success/failure streak
Average duration
Last failure timestamp
Trend arrow
Layout
+----------------------------------------------+
| Run History |
| |
| Durations: ▁▂▁▂▃█▆▄▂▁ Avg: 1.2s Trend: ▲ |
| Streak: 5 successes Last failure: 2h ago |
| |
| 14:32:10 ✓ 1.2s 145B |
| 14:30:10 ✓ 1.1s 33B |
| 14:28:10 ✗ 0.1s 0B |
| ... |
+----------------------------------------------+
Implementation
Acceptance criteria
Part of v2.0.0 epic #4