Skip to content

FEAT: add Zone and Pace quota graphs across terminal and web - #79

Merged
merefield merged 13 commits into
mainfrom
feat/consumption-zone-trends
Oct 9, 2026
Merged

merefield merged 13 commits into
mainfrom
feat/consumption-zone-trends

Conversation

@merefield

@merefield merefield commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Why

Terminal and browser now have separate Zone and Pace quota views, with observed history and a projected trend. Zone shows accumulated consumption; Pace replaces the old horizontal gauge with distance from safe pace. For example, 80% of quota used after 57% of the window appears 23 percentage points above safety in Pace; a recent slowdown can slope back towards zero, but stays dark red if projected usage still exceeds 100% at reset.

Changes

  • Presentations: rename Consumption Zone to Zone and replace Consumption Pace with the Pace graph. Both interfaces have separate quota subtabs without a radio switch. Zone has a diagonal safety line; Pace keeps the elapsed-period X axis and shows consumption minus elapsed time on Y (−100 to +100 percentage points), with a horizontal zero safety line. The dot, path and projection transform together. Each interface reuses its graph renderer for both variants.
  • Projections: From Window Start is the default and draws from the origin through the current dot without requiring history. Off, Last 30 Minutes, Last Hour and Last 24 Hours are alternatives; recent periods require continuous coverage and at least two observations. Non-negative regression gives recent consumption velocity; projections start at the selected period's beginning, pass through the dot and continue to graph bounds. Browser projections include directional arrows; terminal trends, traces and safety references use dense, continuous Braille strokes without arrows or box-drawing zigzags. Both use green for projected usage at most 100% at reset and dark red otherwise.
  • Browser trace and layout: Trace Path defaults on, with a near-black line and light casing. It can be unchecked independently of the collapsed Observation Data disclosure. Controls use the lower-right space on wide cards and stack on narrower cards; SVG graphs scale horizontally and vertically with compact dashboard spacing.
  • Terminal graphs: simplified dark red/amber/green cell backgrounds, high-contrast current dot and pale observed trace. Responsive cards share rows when readable, add rows for additional windows and fall back to numeric readouts on small layouts. Clickable, hoverable and flashing Trend (g) and Trace (h) controls are scoped to Pace/Zone. Recent trend intervals are skipped until available for at least one window; other windows report unavailable rather than substitute an interval. Preserve the previous saved Consumption Pace view after renaming.
  • Shared observations: interface-independent bounded history (1,500 points per quota window), account/cycle isolation, stable primary/secondary identities, refresh-gap markers and immutable previous snapshots. Terminal observations continue while viewing other tabs. No history persistence or additional API requests.
  • Documentation/build: update README and intro post, translate terminal labels into all supported languages and regenerate embedded web assets.
  • Security: require Go 1.27.2, fixing the ten standard-library vulnerabilities reported by CI (HTTP/HTTP2, TLS and textproto). CI and release workflows already select Go from go.mod, so they also build with the security patch. Update source-build requirements without weakening the vulnerability scanner or adding exclusions.

The trend remains an explicitly documented extrapolation of coarse whole-percentage observations, not an OpenAI forecast. Trails remain in-memory only and gaps are never interpolated.

Validation

  • Svelte/TypeScript checks and Prettier
  • production frontend build
  • complete Playwright suite: 57/57 passing, covering navigation between Zone and Pace, coordinate transformation, retained trend selection, recovery towards safety, endpoint-based colours, exact 100% boundary, zero/single/continuous history transitions, zero consumption and zero elapsed time
  • go test ./...
  • CI-equivalent govulncheck@v1.8.0 and the complete regression suite with Go 1.27.2
  • complete Go race-enabled suite and targeted final graph/history race tests
  • terminal rectangle, axes, projection, arrow absence, controls/hit surfaces, preference compatibility and multi-window regressions; unavailable trends stay muted in both views across all themes, while valid projections retain endpoint colours; history identity, gaps, resets, clipping, bounds and snapshot immutability
  • local binary rebuilt from the final commit

@merefield
merefield force-pushed the feat/consumption-zone-trends branch from 20c73ae to 22132ef Compare October 9, 2026 08:08
@merefield merefield changed the title FEAT: add Consumption Zone trends and trace control FEAT: add Consumption Zone pace and trend projections Oct 9, 2026
@merefield merefield changed the title FEAT: add Consumption Zone pace and trend projections FEAT: add Zone and Pace quota graphs with trend projections Oct 9, 2026
@merefield merefield changed the title FEAT: add Zone and Pace quota graphs with trend projections FEAT: add Zone and Pace quota graphs across terminal and web Oct 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Several graph statuses are inaccurate for absent history, unavailable projections, and the exact 100% safety boundary.

3 open findings
What changed in this PR

Adds shared Zone and Pace quota graphs across terminal and web, including observation history, trend projections, controls, responsive layouts, localization, and documentation.

Changes:

  • Introduces shared bounded quota history and projection geometry.
  • Replaces the Pace gauge with reusable terminal and web graphs.
  • Adds comprehensive tests, translations, documentation, and rebuilt web assets.
File Description
web/​tests/​browser.spec.ts Expands browser graph coverage.
web/​src/​style.css Updates responsive quota styling.
web/​src/​Quota.svelte Integrates Pace and Zone graphs.
web/​src/​ConsumptionZone.svelte Implements shared SVG graph and controls.
README.md Documents graph behavior and shortcuts.
intro-post.md Updates feature overview.
internal/​web/​state.go Uses shared observation history.
internal/​web/​dist/​index.html References rebuilt assets.
internal/​web/​dist/​assets/​index-f6yvkeCn.css Removes previous generated CSS.
internal/​web/​dist/​assets/​index-4j3sNB-h.css Adds rebuilt generated CSS.
internal/​ui/​view.go Renders terminal graph controls.
internal/​ui/​view_test.go Updates view layout tests.
internal/​ui/​theme.go Adds Pace and Zone view IDs.
internal/​ui/​tabs.go Adds renamed graph tabs.
internal/​ui/​tabs_test.go Updates tab behavior tests.
internal/​ui/​quota_graph.go Implements terminal graphs and controls.
internal/​ui/​quota_graph_test.go Tests terminal graph behavior.
internal/​ui/​preferences.go Preserves legacy Pace preferences.
internal/​ui/​model.go Collects history and handles controls.
internal/​ui/​model_test.go Updates view-selection expectations.
internal/​ui/​meters.go Integrates graphs into meter rendering.
internal/​ui/​meters_test.go Updates meter tests.
internal/​ui/​english_snapshot_test.go Refreshes presentation snapshot.
internal/​quotagraph/​graph.go Adds shared history and trend calculations.
internal/​quotagraph/​graph_test.go Tests shared graph calculations.
internal/​i18n/​locales/​zh-Hans.json Adds graph translations.
internal/​i18n/​locales/​tr.json Adds graph translations.
internal/​i18n/​locales/​sv.json Adds graph translations.
internal/​i18n/​locales/​ru.json Adds graph translations.
internal/​i18n/​locales/​pt-PT.json Adds graph translations.
internal/​i18n/​locales/​pt-BR.json Adds graph translations.
internal/​i18n/​locales/​nl.json Adds graph translations.
internal/​i18n/​locales/​nb.json Adds graph translations.
internal/​i18n/​locales/​ja.json Adds graph translations.
internal/​i18n/​locales/​it.json Adds graph translations.
internal/​i18n/​locales/​fr.json Adds graph translations.
internal/​i18n/​locales/​fi.json Adds graph translations.
internal/​i18n/​locales/​et.json Adds graph translations.
internal/​i18n/​locales/​es.json Adds graph translations.
internal/​i18n/​locales/​en-GB.json Adds canonical graph labels.
internal/​i18n/​locales/​de.json Adds graph translations.
internal/​i18n/​locales/​da.json Adds graph translations.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/ui/quota_graph.go
Comment thread web/src/ConsumptionZone.svelte Outdated
Comment thread internal/ui/meters_test.go Outdated
@merefield
merefield merged commit 80caeeb into main Oct 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants