Skip to content

feat(metrics): colour every sparkline point and fix the serve view's shifting bar - #270

Merged
outofcoffee merged 6 commits into
mainfrom
feat-sparkline-history-colours
Oct 18, 2026
Merged

outofcoffee merged 6 commits into
mainfrom
feat-sparkline-history-colours

Conversation

@outofcoffee

@outofcoffee outofcoffee commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Colours every point of the bar-format sparkline by its own value, so a threshold spike earlier in the 10-minute window keeps its colour where it happened (issue #265), and keeps the serve view's bar half in its column as a reading crosses a digit boundary.

Summary

Per-point sparkline colouring

  • Each sparkline point takes the colour of its own value on the gauge's 80/90 thresholds: red above 90%, yellow from 80%, the terminal's default colour below 80%
  • The latest point is no longer special — it is coloured like any other point
  • Green is dropped from the sparkline; the gauge and the no-history fallback keep their green/yellow/red scheme

Serve view alignment

  • The serve view's combined line drew its figure with %.0f%%, so a one-digit reading shifted the sparkline a column left and 100% a column right; a live view jittered its bar whenever a reading crossed a digit boundary
  • The figure now draws in a fixed-width field — three digits, right-aligned, plus the percent sign — so the line keeps its width and the bar half starts in the same column whatever the digit count

Implementation details

  • sparklineBlock is the single colouring point shared by cloud metrics --format=bar, fleet metrics --format=bar, the dashboard's bar tiles, and the serve view's bar half, so one change covers every surface
  • Colouring applies to the pooled columns: each pool keeps its peak, so a red spike inside a downsampled column keeps its red
  • renderStatCombined is the single point of the serve view's combined gauge/figure/bar line; the dashboard's tiles and the bar format draw the figure after a fixed-width block, and stay untouched
  • The OpenSpec changes 2026-10-15-sparkline-history-colours and 2026-10-17-serve-view-figure-alignment ship in this branch un-archived; archive both before merging so the main specs pick up the deltas

spinloop-agent added 5 commits October 15, 2026 15:17
Issue #265: the bar sparkline colours only the latest point, so a
threshold spike earlier in the window reads as an unremarkable
default-colour glyph. Colour every point by its own value on the
gauge's 80/90 thresholds instead, with green dropped from the
sparkline.
Issue #265: the bar sparkline coloured only the latest point, so a
threshold spike earlier in the window read as an unremarkable
default-colour glyph. Colour each pooled column by its own value on
the gauge's 80/90 thresholds instead — red above 90, yellow from 80,
the terminal's default colour below — the latest point like any other
and green dropped from the sparkline, which the gauge keeps.
openspec validate refuses a MODIFIED block that drops a scenario the
current spec still has, and "Green bar for low utilization" cannot hold
once the sparkline stops drawing green. Remove the "Colour thresholds"
requirement and re-add it as "Per-point colour thresholds" — the same
remove-and-re-add the archived client-driven-daemon change used — and
align the proposal and tasks wording.
The serve view's combined line draws the figure between its two
halves, and %.0f%% lets its width ride the reading's digit count, so
the bar half shifts a column when a reading crosses a boundary. Add
the 2026-10-17-serve-view-figure-alignment change: the figure draws
in a fixed-width field — three digits, right-aligned, plus the
percent sign — and the bar half keeps its column whatever the digit
count.
The combined line's figure drew with %.0f%%, so a one-digit reading
shifted the sparkline a column left and 100% a column right; a live
view jitters its bar whenever a reading crosses a digit boundary.
Draw the figure in a fixed-width field — three digits, right-aligned,
plus the percent sign — so the line keeps its width and the bar half
starts in the same column whatever the digit count.
@outofcoffee outofcoffee changed the title feat(metrics): colour every sparkline point by its own value feat(metrics): colour every sparkline point and fix the serve view's shifting bar Oct 17, 2026
@outofcoffee
outofcoffee marked this pull request as ready for review October 18, 2026 09:27
@outofcoffee outofcoffee added bug Something isn't working enhancement New feature or request labels Oct 18, 2026
@outofcoffee
outofcoffee merged commit 804b13b into main Oct 18, 2026
5 checks passed
@outofcoffee
outofcoffee deleted the feat-sparkline-history-colours branch October 18, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant