Repository navigation
Conversation
Add "Color bars by quota left" under Menu Bar → Icon, off by default. When on, each meter bar is green with 50% or more left, orange from 25% and red below 25%; a lane without a value is gray. Colors follow the quota left even with "Show usage as used". Quota colors reuse the provider-color fallbacks: the meter stays a monochrome template while highlighted, stale or loading, with increased contrast, or in accessibility appearances. Shades are fixed per light and dark menu bar and each passes meetsAppearanceContrast. The color style is part of the icon cache key and status item render signature. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3330a5c6f0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| func quotaColorStyle(for provider: UsageProvider, button: NSButton, isLoading: Bool) -> IconRenderer | ||
| .QuotaColorStyle? | ||
| { | ||
| guard self.settings.menuBarColorByQuota else { return nil } |
There was a problem hiding this comment.
Re-render quota-only icons on color-mode changes
When users enable only Color bars by quota left (while Color by provider remains at its default off value), menu tracking, appearance KVO, and Increase Contrast notifications all call refreshStatusItemContentForColorMode, but that helper still returns unless menuBarColorByProvider is enabled. Consequently this state-dependent style is not recomputed when a menu opens/closes or the appearance/accessibility mode changes, so the non-template colored icon can remain highlighted or retain light-mode shades in dark mode until some unrelated icon update; the refresh gate needs to accept either color option.
Useful? React with 👍 / 👎.
| warpEyesFilled: Bool = false) | ||
| { | ||
| // With quota colors the whole bar (track, outline, fill and critter details) uses its color. | ||
| let baseFill = quotaColors.map { $0.color(forBarValue: remaining) } ?? monochromeFill |
There was a problem hiding this comment.
Keep credits fallback colors based on remaining credits
With Show usage as used enabled and Codex rendering its credits-only fallback (for example, credits have loaded before a usage snapshot), creditsRatio in this renderer is still derived from creditsRemaining, but this line sends it through a style that complements every value as though it were percent used. That inverts the threshold color—a nearly full credits bar can become red and a nearly empty one green—so the credits lane must be identified as already representing percent left when its color is selected.
Useful? React with 👍 / 👎.
| hideCritters: self.settings.menuBarHidesCritters, | ||
| quotaLayoutPolicy: .provider(provider, snapshot: snapshot)) | ||
| quotaLayoutPolicy: .provider(provider, snapshot: snapshot), | ||
| quotaColors: quotaColors) |
There was a problem hiding this comment.
Apply quota colors to user-plugin meters
When the unified icon's current selection is a user provider plugin in Critters/Meter bars mode, applyIcon takes the plugin branch at lines 265-310 and returns after calling IconRenderer.makeIcon without quotaColors, so this new argument is reached only for built-in providers. Plugin snapshots already supply primary and secondary percentage lanes via pluginMeterPercents, yet enabling the global quota-color toggle leaves those meter bars monochrome; compute and pass the same style in the plugin branch as well.
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. What this changesAdds an off-by-default setting that colors menu bar meters green, orange, or red according to remaining quota. Example: Claude has 80% session quota and 30% weekly quota remaining.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision Merge readiness⛔ Blocked before merge - 5 items remain Keep open for a maintainer decision on the new color preference; lifecycle, credits, plugin coverage, and cache defects need correction. Priority: P3 Decision needed
Before merge
Findings
Tests
Agent review detailsHow this fits togetherProvider snapshots and saved display preferences enter the status-item controller, which selects quota values and rendering options and sends rendered images to the macOS menu bar. flowchart LR
A[Provider snapshots] --> C[Status item controller]
B[Saved display preferences] --> C
D[Appearance and menu state] --> C
C --> E[Icon renderer and cache]
E --> F[Menu bar button]
Technical reviewBest possible solution: If the owner accepts this preference, complete it within the existing renderer and lifecycle paths, preserving remaining-quota semantics, plugin coverage, and threshold-aware caching. Do we have a high-confidence way to reproduce the issue? This proposes new behavior rather than reporting a current-main bug; the introduced defects have concrete source paths but were not executed during this read-only review. Is this the best way to solve the issue? Extending the existing renderer is appropriately scoped, but the proposal needs owner approval and complete integration with existing refresh, credits, plugin, and cache behavior. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7447bc77c249. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 12, 2026, 1:26 PM ET / 18:26 UTC. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Adds an opt-in Color bars by quota left toggle under Settings → Menu Bar → Icon (default off). When it is on, each meter bar in the Critters and Meter bars styles is drawn by how much of that quota is left:
This is meant as a different request from #3533 (provider-colored meters, closed as not planned): the color carries quota state, like Color Pace Indicator (#3429), rather than brand identity. It follows #3429's shape (one toggle, off by default) and reuses the contrast policy raised in #3533.
Synthetic proof rendered through
IconRenderer.makeIcon(Claude critter, light and dark rows, default vs. quota colors); seeIconRendererQuotaColorTests.Behavior
MenuBarLayoutRenderer.effectiveProviderTintColor: the meter returns to the monochrome template while the menu is open (highlighted), data is stale or loading, the inactive-display contrast option or system Increase Contrast is on, or the appearance is an accessibility appearance or unknown.meetsAppearanceContrast(2:1 against the 85% / 25% gray references). System green and orange fail that check on light bars, hence fixed shades.makeIconreturns the same template image. The color style is part of the icon cache key and the status item render signature, so toggling the setting or an appearance change redraws.Changes
IconRenderer+QuotaColors.swift:QuotaColorStyle(levels, shades, render signature) andeffectiveQuotaColorStyle(options:increasedContrast:isLoading:).IconRenderer.makeIcon(..., quotaColors:): per-bar colors, non-template image only when colors apply, status overlay drawn in the neutral shade.StatusItemController: computes the style from the existing render options and passes it to the meter icon.menuBarColorByQuota(default off, persisted, part of menu observation) and the toggle in the Menu Bar pane.docs/ui.md, and a CHANGELOG entry.Commands run
Scripts/install_lint_tools.sh swiftformat swiftlint, thenswiftformatandswiftlint lint --stricton the touched files: cleannode Scripts/check-app-locales.mjsandnode Scripts/sync-widget-locales.mjs --check: OKsource Scripts/test_environment.sh && swift test --filter "IconRendererQuotaColorTests|MenuBarQuotaColorSettingsTests|IconRendererHideCrittersTests|IconRendererStatusOverlayTests|MenuBarPaceColorSettingsTests|MenuBarLayoutRendererTests|ProviderArchitectureGatekeeperTests|IconRendererGrokTests": 190 tests in 8 suites passed (Xcode 26.6 / Swift 6.3.3; the test target needed raised-solver-*-thresholdlimits to type-check existing upstream tests on this older toolchain)CODEXBAR_QUOTA_COLOR_PROOF_DIR=.github/pr-proof swift test --filter IconRendererQuotaColorTestsNot run locally:
make test-fast/make test. The test harness requires apython3withos.waitid, and this machine only has 3.11 and 3.9, so the full suite is left to PR CI.make checkran its lint and script tests but stops at the sameos.waitidprecondition.Notes
🤖 Generated with Claude Code