toolkit: a chart's usage can stay honest about pace - #455
Merged
Conversation
…cal gridlines TimeSeriesChart gains Threshold ([]TimePoint, a second reference series drawn as a dashed line) and OverInk (the color a Points segment switches to for any stretch ending above the Threshold in effect at that time) — for a caller charting quota usage against the pace that would exhaust it exactly at reset, materializing whether it's on track rather than requiring a visual comparison. Also adds vertical gridlines at an auto-picked "nice" time interval (hourly for a short span, daily for a long one, via verticalGridInterval/verticalGridTicks) alongside the existing three horizontal value gridlines, so the time axis reads at a glance without depending only on the two start/end labels. Rebased onto #453 (bindable Series) and #454 (FollowPeak/NiceCeiling) — both land in Draw's own body, so this reapplies cleanly against c.points() rather than the old direct c.Points access. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
tannevaled
added a commit
to go-aiquota/tray
that referenced
this pull request
Sep 6, 2026
Materializes whether usage is running ahead of the pace that would exhaust a window's quota exactly at its reset, per live user feedback: each panel's curve now turns red for any stretch above the diagonal from window-start to reset (toolkit.TimeSeriesChart's new Threshold/OverInk, go-widgets/toolkit#455 / v0.310.0), computed from ResetsAtUnix + menubar.SeriesWindowDuration. Also picks up that release's auto-scaled vertical gridlines (hourly/daily) on the time axis, another live request. Live-verified against the real, already-running app's own history data (184 real polled points): the reference line and red/green recoloring render correctly, including across a real session reset. Older points recorded before ResetsAtUnix was captured (#11) have no threshold to compare against and simply carry no Threshold sample near them — an expected, self-resolving gap as that history ages out. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TimeSeriesChartgainsThreshold ([]TimePoint)— a second reference series drawn as a dashed line, andOverInk (RGBA)— the color aPointssegment switches to for any stretch ending above theThresholdin effect at that time. Motivating case: a quota-usage chart charting a "sustainable pace" line (the diagonal from window-start to window-reset), so a viewer sees at a glance whether current usage is on track to exhaust the quota before it resets, rather than having to eyeball two separate lines.verticalGridInterval/verticalGridTicks) at a "nice" time interval — hourly for a short span, daily for a long one — alongside the existing three horizontal value gridlines, so the time axis reads at a glance.Series) and toolkit: a chart can follow its own peak #454 (FollowPeak/NiceCeiling), both of which restructuredDrawaroundc.points()— this reapplies cleanly against that shape.Test plan
go build ./...,go vet ./...,gofmt -l .cleango test ./...green across the whole repo (no regressions from toolkit: a chart's series can be bound #453/toolkit: a chart can follow its own peak #454's own features)timeserieschart.goat 100% coverage (go tool cover -func)🤖 Generated with Claude Code