Repository navigation
Address stopwatch performance review - #3
Merged
Merged
Conversation
merefield
force-pushed
the
agent/address-stopwatch-review
branch
from
August 11, 2026 12:48
5c7d972 to
73e549c
Compare
There was a problem hiding this comment.
Pull request overview
This PR follows up on the Stopwatch performance review by separating “pure” layout geometry from rendering so mouse hit-testing no longer triggers full terminal rendering, and by throttling filesystem discovery in live token telemetry while still consuming known cursors every second. It also reorders the presentation cycle to place Stopwatch immediately after Bars and bumps the maintained version to v0.1.1.
Changes:
- Introduces shared dashboard + stopwatch layout geometry used consistently for rendering and mouse hit-testing (including compact/error/empty states).
- Throttles Codex session discovery (5s incremental, 5m full) while preserving per-second consumption of already-known rollout cursors and forcing full discovery on Stop.
- Reorders meter styles (Stopwatch becomes #2) and updates version strings/tests to
v0.1.1.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates presentation order (Stopwatch #2) and bumps documented version/install examples to v0.1.1. |
| main_test.go | Updates expected --version output to v0.1.1. |
| internal/version/version.go | Bumps maintained fallback version to 0.1.1. |
| internal/version/version_test.go | Updates fallback-version assertion to 0.1.1. |
| internal/ui/view.go | Uses dashboardLayout() geometry to size meter/stopwatch areas without recomputing heights from rendered strings. |
| internal/ui/view_test.go | Updates style-grid classification test for reordered meter styles. |
| internal/ui/theme.go | Reorders meterStyleID so Stopwatch is second; updates style names accordingly. |
| internal/ui/stopwatch.go | Extracts pure stopwatch geometry (layoutStopwatchArea) and reuses it for rendering + hit-testing. |
| internal/ui/stopwatch_test.go | Verifies rendered stopwatch control rectangles match pure layout geometry and updates hit-testing assertions. |
| internal/ui/model.go | Replaces footer hit-testing via ansi.Strip(m.View()) parsing with geometry-based dashboardLayout() + footerButtonLayout(). |
| internal/ui/model_test.go | Updates style-cycle expectations and adds a geometry-vs-render hit test across multiple sizes/states. |
| internal/ui/meters.go | Updates usesMeterGrid logic to explicit style set (reflecting new enum order). |
| internal/ui/meters_test.go | Refactors tests to iterate explicit “quota meter” styles rather than relying on enum ordering. |
| internal/codex/live_usage.go | Adds discovery throttling (discoveryEvery, fullDiscoveryEvery) while still consuming known rollout cursors each fetch. |
| internal/codex/live_usage_test.go | Adds coverage for throttled discovery behavior and adjusts existing tests to force discovery when needed. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
merefield
marked this pull request as ready for review
August 11, 2026 12:52
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
v0.1.1Why
This follows up on the two Copilot review comments left after #2 was merged:
The original implementation performed redundant rendering for every mouse motion event and walked session directories on every one-second telemetry poll. These changes preserve responsive interaction and fresh final readings while substantially reducing repeated CPU, allocation, and filesystem work.
User impact
Stopwatch hover and clicks remain aligned with the rendered controls but require no render work during hit-testing. Existing sessions continue updating every second; newly created rollouts appear within approximately five seconds, and Stop always forces complete discovery. Stopwatch is now one press of
saway from the default Bars view.Validation
go test -race -cover ./...go vet ./...