Skip to content

Add quota navigation and health status - #10

Merged
merefield merged 4 commits into
mainfrom
agent/quota-subtabs
Aug 12, 2026
Merged

merefield merged 4 commits into
mainfrom
agent/quota-subtabs

Conversation

@merefield

@merefield merefield commented Aug 12, 2026 •

Copy link
Copy Markdown
Owner

What changed

  • replace the single six-style tab rail with top-level Quota, Monitor, and Benchmark tabs
  • add a Quota-only second rail for Bars, Pie, Consumption Pace, and Fuel Tank
  • keep Tab and Shift+Tab for top-level navigation, restore contextual s style cycling in Quota, and retain s as Start in Monitor
  • remember the selected Quota presentation when navigating away and back
  • show a clickable [ (S)TYLE ] footer control only while Quota is active
  • add a top-right quota-health signal based on the worst active quota window
  • color the health dot and label green for Clear, blue for Watch, amber for Limit Near, and red for Exhausted while keeping ONLINE in the selected theme color
  • make the status responsive with full, compact, and minimal labels for narrow terminals
  • harden every Quota presentation for restored or additional windows: height-aware row gaps keep horizontal cards inside their allocation, narrow stats cannot wrap, and Pie only adds columns when cards retain a useful width
  • replace Consumption Pace's small diamond with an illuminated sliding [▲] carriage and directional trail from zero, retaining the signed scale and degrading cleanly in narrow terminals
  • document the navigation hierarchy, controls, status meanings, pace calculation, and missing-timing fallback
  • expand installation guidance for GOBIN/GOPATH/bin, persistent PATH setup on macOS, Linux, and Windows, command verification, and placing locally compiled standalone binaries on PATH

Quota health

Quota health compares each window's consumed percentage with exact reset-cycle progress. Clear means burn is at or below elapsed time. Watch means the current average pace projects exhaustion before reset. Limit Near means projected exhaustion falls within the first quarter of the time still remaining, or no more than 5% remains while over pace. Exhausted is selected at 100% or when Codex explicitly reports a reached rate limit. The worst returned window wins.

When duration or reset timing is unavailable, the signal falls back conservatively to remaining capacity: Watch at 20% and Limit Near at 5%. Scanning and stale-signal states take precedence over quota classification.

Why

The four quota visualizations are presentations of the same data, while Monitor and Benchmark are distinct tools. Two-level navigation makes that hierarchy explicit, reduces the primary rail to three stable destinations, and still keeps every presentation one click or one s press away. The health signal adds an at-a-glance warning that accounts for whether quota is being consumed faster than the window is elapsing rather than treating a low percentage near reset as inherently dangerous.

Quota rendering continues to flatten every primary and secondary window from every returned limit bucket; it does not hardcode the currently visible set. A restored 300-minute primary window is labelled 5 HOURS and participates in the same responsive layout and worst-window health calculation as every other measure.

Interaction integrity

Render and hit-test geometry share the same responsive layouts. Regression coverage checks every rendered cell of both tab rails across terminal widths, every visible footer button across compact, standard, error, empty, Monitor, and Benchmark layouts, and verifies that hidden Quota style controls expose no click surface outside Quota. Existing Monitor and Benchmark button suites remain green.

An end-to-end four-window regression covers a restored 5-hour window, the weekly window, and two additional limit-bucket windows in Bars, Pie, Consumption Pace, and Fuel Tank at 40×24, 80×24, and 120×40. It verifies that the interface stays within its terminal rectangle and that every title remains identifiable whenever width permits.

Validation

  • go test ./...
  • go test -race -cover ./...
  • go vet ./...
  • focused hover, click, pulse, and hit-surface tests for main tabs, Quota sub-tabs, global footer controls, Monitor controls, and Benchmark controls
  • rebuilt the local binary and confirmed codexometer v0.5.0

@merefield
merefield requested a lite review from Copilot August 12, 2026 13:10
@merefield
merefield marked this pull request as ready for review August 12, 2026 13:10

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.

Pull request overview

This PR refactors the UI navigation into top-level Quota / Monitor / Benchmark tabs with a Quota-only sub-rail for quota visualizations, and adds a new quota-health signal that summarizes the “worst” active quota window (including an explicit rate-limit-reached override). It also expands README documentation to match the new navigation model and to provide clearer installation/PATH guidance across platforms.

Changes:

  • Replaces the single style tab rail with a main tab rail (Quota/Monitor/Benchmark) plus a Quota-only sub-tab rail (Bars/Pie/Consumption Pace/Fuel Tank), including remembering the last Quota presentation.
  • Adds a responsive, semantic-colored quota-health status indicator and supporting classification logic + tests.
  • Updates footer controls so [ (S)TYLE ] only appears (and hit-tests) in Quota, and updates documentation/tests accordingly.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
README.md Documents new navigation hierarchy, quota health semantics, and improved install/PATH setup guidance.
internal/ui/view.go Renders the new main tab rail + Quota sub-rail and introduces the responsive quota-health signal rendering.
internal/ui/view_test.go Updates header/status expectations to include the new quota-health signal rendering.
internal/ui/theme.go Defines Quota style order and adds quota-style helpers (isQuota, nextQuota).
internal/ui/tabs.go Implements main-tab + quota-sub-tab layout/rendering and hit testing.
internal/ui/tabs_test.go Adds/updates interaction and geometry tests for both tab rails and contextual s behavior.
internal/ui/quota_status.go Introduces quota health classification and limit-reached detection.
internal/ui/quota_status_test.go Adds unit coverage for quota health classification and signal label responsiveness.
internal/ui/model.go Wires keyboard/mouse navigation to main tabs, remembers Quota style, and conditionally exposes the Style footer button.
internal/ui/model_test.go Expands footer layout/hit-test coverage to include the new contextual Style button and Benchmark layouts.

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

@merefield
merefield merged commit debd59f into main Aug 12, 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