Reapply "feat(tui): overhaul latency sparkline scaling, color, and layout"
CI / lint (pull_request) Has been cancelled
CI / vulncheck (pull_request) Has been cancelled
CI / test (pull_request) Has been cancelled

This reverts commit e53077fe70.
This commit is contained in:
2026-06-04 19:37:33 -04:00
parent e53077fe70
commit b361821d11
8 changed files with 349 additions and 35 deletions
+3 -1
View File
@@ -47,6 +47,8 @@ func computeHistoryStats(changes []models.StateChange) historyStats {
return s
}
var stateChangeChars = []rune{'▁', '▂', '▃', '▄', '▅', '▆', '▇', '█'}
func stateChangeSparkline(changes []models.StateChange, width int) string {
if len(changes) < 2 || width < 4 {
return ""
@@ -91,7 +93,7 @@ func stateChangeSparkline(changes []models.StateChange, width int) string {
if idx > 7 {
idx = 7
}
ch := string(sparkChars[idx])
ch := string(stateChangeChars[idx])
switch {
case v >= 3:
sb.WriteString(dangerStyle.Render(ch))