feat(tui): overhaul latency sparkline scaling, color, and layout
Replace misleading relative-only sparkline with dual-channel design: bar height uses relative scaling (shows stability and anomalies), color+brightness uses absolute thresholds (shows fast vs slow). - Add brightness gradient within color bands (dim→bright as latency increases toward the next threshold) - Pass row background through sparkline rendering so zebra stripes and selection highlights carry through ANSI sequences - Cap sparkline width to 60 (matches maxHistoryLen) and column width to 62 to eliminate trailing dead space - Quiet group sparkline: subtle dots for healthy, bold red for down - Add braille subpixel canvas (ported from meridian) for future multi-row graph use
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user