Skip to content

Add optional colors for menu bar quota pace - #3429

Merged
steipete merged 1 commit into
steipete:mainfrom
jb510:jb/color-quota-pace
Sep 11, 2026
Merged

Add optional colors for menu bar quota pace#3429
steipete merged 1 commit into
steipete:mainfrom
jb510:jb/color-quota-pace

Conversation

@jb510

@jb510 jb510 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Adds the off-by-default Color Pace Indicator preference under Menu Bar → Icon. Session, Weekly and Auto pace tokens use green for reserve and red for usage ahead of pace, while retaining signed percentages. Zero and unavailable values stay neutral; the setting leaves existing layouts and legacy display modes intact. Labels cover all supported locales.

Maintainer decision: adopt this narrow opt-in preference. The UI and docs identify the layout tokens it affects.

The maintainer pass repairs the final status-item output: explicitly colored text now keeps native attributed rendering instead of being converted into a monochrome template image. Neutral text retains the template cache. It also preserves high-contrast precedence when a snapshot is stale, and replaces partial production-default stores in the preference tests with isolated stores.

Validation:

  • The proposal failed 12 final-output/consumer assertions. A further seven failures reproduced stale/high-contrast dimming. Both root causes are fixed.
  • All 118 focused tests pass, including final button transitions, conditionals and hidden branches, icon/multiline output, stale/high-contrast combinations, cache behavior, observation and legacy/stored-layout upgrades.
  • make check passes with zero SwiftLint violations across 2,177 files. Independent P0–P2 review is clean.
  • Developer-ID-signed native baseline and final runs passed. The final run exercises 16 Light/Dark cases on an actual NSStatusItem through the production renderer and consumer, alongside the production Settings pane. It checks positive/negative/zero pace, on/off persistence, leading icons, multiline, stale, high contrast and combined stale/high-contrast. Every case preserves the legacy layout. Captures use only synthetic values and owned windows/button regions.
  • Native proof source matches commit 4b59bae990003c857c67763d3025d096b7463324. Full make test passed all 1,066 selections across 89 groups on the first attempt, with no retries or timeouts (868.9 seconds). Exact-head CI passed all Linux x64, Linux ARM64, musl and macOS checks. Merged as fe7a45ffab530e6b850800fd4a01ef1972709b0d.

Docs and the Unreleased changelog are updated. Thanks @jb510!

Closes #3428

Inspected synthetic native before/after evidence

The setting is enabled in both status-item captures:

Proposal: icon-free output loses color Fixed native output
Before, colors lost After, green reserve and red ahead

Switching colors off restores monochrome:

Switching colors off restores monochrome

Stale values dim:

Stale values dim

High contrast takes precedence over stale dimming:

High contrast takes precedence over stale dimming

Dark appearance:

Dark appearance

Dark appearance with stale and high contrast:

Dark appearance with stale and high contrast

Upgraded settings default off, legacy layout retained

Enabled preference and token-scope explanation

CleanShot 2026-09-10 at 18 41 05@2x

@clawsweeper

clawsweeper Bot commented Sep 5, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T01:29:11.293626Z d1e2623 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper

clawsweeper Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 9:20 PM ET / September 11, 2026, 01:20 UTC (Revision 7).

ClawSweeper review

What this changes

Adds an off-by-default preference that colors menu bar pace percentages, with persistence, preview support, translations, documentation, and native rendering regression coverage.

Merge readiness

Ready for maintainer review

This remains useful, maintainer-approved work that is absent from main and v0.58.0. The earlier color-loss finding is resolved, native proof demonstrates the result, and no blocking defect remains.

Priority: P3
Reviewed head: 4b59bae990003c857c67763d3025d096b7463324

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused implementation, native before/after evidence, and extensive consumer and upgrade coverage provide strong confidence with no remaining blocking findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected native before/after status-item captures show the production renderer and consumer preserving green/red signed pace, neutral zero, toggle-off monochrome, and stale dimming; the body identifies the signed run with this head.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected native before/after status-item captures show the production renderer and consumer preserving green/red signed pace, neutral zero, toggle-off monochrome, and stale dimming; the body identifies the signed run with this head.
Evidence reviewed 9 items Policy and review scope: Read the complete root AGENTS.md. No nested AGENTS.md or maintainer-notes directory was present. Applied settings isolation, native rendering, provider separation, and focused-test guidance; did not execute tests or builds during this read-only review.
Earlier finding resolved: The renderer rejects template conversion when a glyph run has a different foreground color, preserving colored pace in the existing native attributed-title consumer. Added tests cover switching colors on and off, hidden conditional branches, leading icons, multiline output, and stale/high-contrast combinations.
Native before/after proof inspected: Inspected all four prepared images from the media manifest. The baseline is monochrome; the fixed image shows green -8%, red +11%, and neutral 0%; switching off restores monochrome, and the stale capture visibly dims colors. The captured PR body ties these images to a signed native run of this head through the production renderer and status-item consumer. Additional Light/Dark and Settings captures are described in the body but were not among the four locally prepared images.
Findings None None.
Security None None.

How this fits together

CodexBar turns provider quota snapshots into signed pace values for configurable menu bar layouts. The renderer combines those values with display preferences and sends attributed text or template images to the native status item.

flowchart LR
 A[Provider quota snapshots] --> B[Signed pace values]
 B --> D[Menu bar layout renderer]
 C[Saved color preference] --> D
 D --> E{Colored text present}
 E -->|Yes| F[Native attributed text]
 E -->|No| G[Monochrome template image]
 F --> H[Menu bar status item]
 G --> H
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta Swift production +63/-8; tests +503/-6; localized resources +75 Production growth supports the accepted preference, while most added code covers rendering, persistence, and optional native proof.

Technical review

Best possible solution:

Keep the accepted opt-in presentation preference, preserve signed values and existing layouts, and retain native attributed rendering wherever colors are present.

Do we have a high-confidence way to reproduce the issue?

Not applicable to the feature request; the earlier patch defect is resolved in source and demonstrated by native before/after captures.

Is this the best way to solve the issue?

Yes. Reusing existing pace tokens and rounded numeric values avoids a competing token model, and the accepted default-off preference preserves existing settings.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9f4f544a5bf8.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P3: This is optional visual polish that leaves existing layouts and default monochrome behavior intact.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected native before/after status-item captures show the production renderer and consumer preserving green/red signed pace, neutral zero, toggle-off monochrome, and stale dimming; the body identifies the signed run with this head.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected native before/after status-item captures show the production renderer and consumer preserving green/red signed pace, neutral zero, toggle-off monochrome, and stale dimming; the body identifies the signed run with this head.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected native before/after status-item captures show the production renderer and consumer preserving green/red signed pace, neutral zero, toggle-off monochrome, and stale dimming; the body identifies the signed run with this head.

Evidence

What I checked:

  • Policy and review scope: Read the complete root AGENTS.md. No nested AGENTS.md or maintainer-notes directory was present. Applied settings isolation, native rendering, provider separation, and focused-test guidance; did not execute tests or builds during this read-only review. (AGENTS.md:1, 4b59bae99000)
  • Earlier finding resolved: The renderer rejects template conversion when a glyph run has a different foreground color, preserving colored pace in the existing native attributed-title consumer. Added tests cover switching colors on and off, hidden conditional branches, leading icons, multiline output, and stale/high-contrast combinations. (Sources/CodexBar/MenuBarLayoutRenderer.swift:463, 4b59bae99000)
  • Native before/after proof inspected: Inspected all four prepared images from the media manifest. The baseline is monochrome; the fixed image shows green -8%, red +11%, and neutral 0%; switching off restores monochrome, and the stale capture visibly dims colors. The captured PR body ties these images to a signed native run of this head through the production renderer and status-item consumer. Additional Light/Dark and Settings captures are described in the body but were not among the four locally prepared images. (Tests/CodexBarTests/PaceColorNativeProofTests.swift:96, 4b59bae99000)
  • Fresh and upgraded settings: The new preference reads false when absent and writes only its own key. Dictionary-backed tests verify persistence, observation, and preservation of legacy display mode, saved layouts, provider overrides, and spacing across reloads and toggles. (Tests/CodexBarTests/MenuBarPaceColorSettingsTests.swift:27, 4b59bae99000)
  • Current main still uses neutral pace text: The pinned main renderer passes unchanged style attributes for pace tokens; it does not implement the proposed optional coloring. (Sources/CodexBar/MenuBarLayoutRenderer.swift:561, 9f4f544a5bf8)
  • Latest release comparison: GitHub contents inspection of v0.58.0 likewise shows neutral pace attributes and the older template conversion. The requested capability has not been established as shipped. (Sources/CodexBar/MenuBarLayoutRenderer.swift:560, 88fa2f45fa1e)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Lev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (6 earlier review cycles)
  • reviewed 2026-09-05T01:30:36.546Z sha d1e2623 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-10T18:09:58.527Z sha 9560a4e :: needs real behavior proof before merge. :: [P2] Preserve colored pace when selecting the status-item output
  • reviewed 2026-09-10T18:23:32.256Z sha 9560a4e :: needs real behavior proof before merge. :: [P2] Preserve colored pace when selecting the status-item output
  • reviewed 2026-09-10T22:28:22.248Z sha 89cd010 :: needs real behavior proof before merge. :: [P2] Preserve colored pace when selecting the status-item output
  • reviewed 2026-09-10T22:46:28.924Z sha 89cd010 :: needs real behavior proof before merge. :: [P2] Preserve colored pace when selecting the status-item output
  • reviewed 2026-09-11T01:09:13.853Z sha 4b59bae :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 10, 2026
@jb510

jb510 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Moved the toggle into Menu Bar → Icon and renamed it “Color Pace Indicator”. Its description is now “Green pace indicator when behind pace, red when ahead of pace (risk of running out early)”. Rendering and preference persistence are unchanged.

The PR body now includes the author’s real Settings screenshot showing the red +17% preview, explicitly labeled as captured before this placement/wording revision. The revised debug app has been rebuilt and restarted locally.

Validation at 89cd010: all 1,060 test selections across 89 groups passed on the first attempt, with no retries or timeouts. Swift formatting/lint for the changed UI file and locale validation pass. The previously documented ambient TypeScript dependency issue in the local environment remains unchanged.

@clawsweeper

clawsweeper Bot commented Sep 10, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Add the off-by-default Color Pace Indicator preference for Session, Weekly and Auto pace layout tokens, retaining signed values, zero/unavailable neutrality, and existing layouts.

Preserve colored status-item text by rejecting template conversion for differing foreground colors. Keep high-contrast precedence over stale alpha. Cover final button transitions, conditional branches, layout variants and upgraded preferences, with isolated signed native before/after proof.

Closes steipete#3428

Co-authored-by: Jon Brown <jb@9seeds.com>
@steipete

Copy link
Copy Markdown
Owner

Accepting the narrow, off-by-default Color Pace Indicator preference under Menu Bar → Icon. The maintainer pass fixes final template-output color loss and stale/high-contrast precedence, preserves existing layouts, and adds consumer/upgrade regressions. Signed native proof now covers the actual status item and updated Settings control; inspected before/after images and validation details are in the PR body. Landing remains gated on the full suite and exact-head CI.

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 11, 2026
@steipete
steipete merged commit fe7a45f into steipete:main Sep 11, 2026
9 checks passed
@steipete

Copy link
Copy Markdown
Owner

Merged as fe7a45f. The off-by-default Color Pace Indicator preference is under Menu Bar → Icon and applies to the three existing layout pace tokens. Existing layouts and legacy display modes remain intact.

The maintainer pass fixed two rendering defects: template images stripped colors from icon-free layouts, and stale alpha overrode high-contrast precedence. Colored text now uses the existing native title path, while neutral text keeps template caching. The preference tests also use isolated stores.

Validation passed: 118 focused tests, all 1,066 full-suite selections with no retries/timeouts, lint, independent P0–P2 review, every Linux/musl/macOS CI check, and 16 signed synthetic native cases on the actual status item. Inspected before/after captures are in the PR body; the merged tree matches the reviewed source. Docs and the Unreleased changelog are updated. Thanks @jb510!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make menu bar quota pace easier to interpret with optional colors

2 participants