Repository navigation
Add quota navigation and health status - #10
Merged
Merged
Conversation
There was a problem hiding this comment.
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.
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.
What changed
TabandShift+Tabfor top-level navigation, restore contextualsstyle cycling in Quota, and retainsas Start in Monitor[ (S)TYLE ]footer control only while Quota is activeONLINEin the selected theme color[▲]carriage and directional trail from zero, retaining the signed scale and degrading cleanly in narrow terminalsGOBIN/GOPATH/bin, persistent PATH setup on macOS, Linux, and Windows, command verification, and placing locally compiled standalone binaries on PATHQuota 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
spress 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 HOURSand 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 ./...codexometer v0.5.0