fix(web): usage chart no longer makes Claude look like the bigger spender - #5697
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6d47bf5. Configure here.
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Approved 6d47bf5 Self-contained visualization fix in a usage chart component, changing from stacked to layered rendering. Author owns this file. The Medium-severity duplicate key finding blocks approval at the configured threshold independently. You can customize Macroscope's approvability policy. Learn more. |
## What's Changed * fix(web): usage chart no longer makes Claude look like the bigger spender by @t3dotgg in pingdotgg/t3code#5697 **Full Changelog**: pingdotgg/t3code@v0.0.33-nightly.20260808.1033...v0.0.33-nightly.20260808.1035 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.33-nightly.20260808.1035
Adopts the three upstream commits after #381: a cross-environment usage page reading provider transcripts (pingdotgg#5684), its chart fix (pingdotgg#5697), and one mobile sheet for model and thread settings (pingdotgg#5625). Resolutions: - server.ts / ws.ts / client-runtime state: upstream's UsageService and its usageSummary atom family are additive next to the fork's diagnostics services (HostResourceProbe, ProcessResourceMonitor, TraceDiagnostics, BackgroundPolicy) and hostResourceSnapshot family — unioned. - ThreadComposer: pingdotgg#5625 folds the model picker and provider options into a single settings sheet, replacing the fork's ControlPillMenu. The sheet is adopted, and the fork's usage signal rides on it: the trigger keeps ProviderUsageIcon with the live marker rather than upstream's plain ProviderIcon, so quota state stays visible at a glance. The fork-only collapsed-composer pill (upstream has none) now opens the same sheet instead of the retired menu. Adversarial review caught that retiring the model menu also orphaned the fork's numeric usage note: the marker survived on the trigger icon but the quota percentage the menu rows carried had no home. It now hangs off the trigger label, so both halves of the fork's usage signal survive the consolidation. The plain ProviderIcon import went with upstream's replaced icon. Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
…nder (pingdotgg#5697) Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

The daily chart on the usage page stacked the two providers, and Claude Code was always the upper band. So Claude always looked like it was winning, even on days where Codex spent 5x more. The shape you read first was a ranking that did not exist.
The series are now layered instead of stacked. Both start from the same zero baseline, so height means the same thing for both, and the point where one overtakes the other is exactly where the lines cross. Fills drop to 12% and the strokes go to 2px, so nothing is hidden behind anything.
Two side effects worth knowing:
Picked from six options. Mocks with all of them: https://cupw3euvewrb.postplan.dev
Verified by rendering the real component at both revisions and comparing the output.
buildDayColumnsnow returns absolute per-provider values rather than stack offsets, and the test that asserted contiguous additive bands is replaced by one that pins the values down as absolute.Written by Claude Opus 5 (1M context) on Claude Code.
Note
Low Risk
Visualization-only change on the usage page with updated unit tests; no API, auth, or billing logic.
Overview
Fixes misleading usage page daily provider chart: stacked areas always put Claude Code on top, so it looked like the bigger spender even when Codex spent more.
buildDayColumnsnow emits absolute per-provider values (nobase/topstack offsets); daily total stays the sum of bands.UsageProviderChartdraws layered smoothed lines and faint fills from zero (not closed stack bands), dropsreversedCurvePath, scales the Y axis to the max single provider-day (not combined daily total), sorts series by period total for paint order, and renders fills then strokes (12% opacity, 2px lines) so lines stay visible. Hover totals are unchanged.Tests assert absolute band values and that column totals match the sum of bands.
usageProviderscomments clarifyPROVIDER_ORDERis legend/table order only, not chart stacking.Reviewed by Cursor Bugbot for commit 6d47bf5. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix usage chart to render providers as layered zero-baseline series instead of stacked bands
UsageProviderChartnow renders each provider as an independent zero-baseline area/line series, with fills extending to the bottom of the plot.buildDayColumnsno longer returnsbase/topfields on bands — onlyproviderandvalue— andtotalis now the sum of band values.Macroscope summarized 6d47bf5.