Skip to content

Color-coded menu bar icons + separator style + time-window selection (macOS 26 aware)#1207

Closed
johnlarkin1 wants to merge 5 commits into
steipete:mainfrom
johnlarkin1:upstream-pr/color-separator-macos26
Closed

Color-coded menu bar icons + separator style + time-window selection (macOS 26 aware)#1207
johnlarkin1 wants to merge 5 commits into
steipete:mainfrom
johnlarkin1:upstream-pr/color-separator-macos26

Conversation

@johnlarkin1

@johnlarkin1 johnlarkin1 commented May 29, 2026

Copy link
Copy Markdown
Contributor

evidence from my fork

Important

My b - i thought this got picked up with the latest release. also perf on the latest release isn't great - idk if you've noticed.
These are the features I still think are worthwhile. I like the color in the mac menubar! Not enough apps are utilizing that in macos26

Screenshot 2026-05-29 at 12 13 00 AM Screenshot 2026-05-29 at 12 12 57 AM Screenshot 2026-05-29 at 12 12 43 AM Screenshot 2026-05-29 at 12 28 25 AM Screenshot 2026-05-29 at 12 31 07 AM Screenshot 2026-05-29 at 12 31 05 AM

Note

the rest of the summary + other subheaders are claude gen'd

summary

Three small, opt-friendly menu-bar features (all used in my fork), plus a macOS 26.4 build fix.

1. Color-coded menu bar icons — Advanced ▸ "Color-coded icons" (default on)

Tints the menu-bar usage icon green → orange → red based on session usage so you can read pressure at a glance.

  • UsageColorLevel.tintColor(for:) interpolates the color from the primary window's used percent.
  • Applied in both StatusItemController icon paths (merged + per-provider). The tint is part of the icon cache key and the render-skip signatures, so it doesn't break the existing render-coalescing.
  • macOS 26 Liquid Glass: template images get re-colored by the system, which kills contentTintColor. So when a tint is active, IconRenderer.makeIcon(tintColor:) draws the shapes directly in the tint color and marks the image non-template (RGB pixels survive). On older macOS the icon stays a template and is tinted via the button's contentTintColor as before. A effectiveAppearance observer (macOS 26+) re-renders so the dynamic system colors resolve correctly on dark/light switches.

2. Separator style — Display ▸ "Separator" (dot/pipe, default dot)

Lets you pick the character between percent and pace in the both menu-bar display mode (e.g. 45% · +5% vs 45% | +5%).

3. Build fix: Swift 6.2.3 / macOS 26.4 SDK

Separate first commit. The nested makeTitle() in AccountSwitcherView.compactButtonTitle captured mutable vars, which crashes swift-frontend (IRGen SIGABRT) on the current toolchain. Reworked to pass the widths as parameters — no behavior change. Without this, main doesn't compile here, so it's bundled to keep the branch buildable; happy to split it into its own PR if you'd prefer.

4. Time-window selection — Display ▸ "Time windows"

Independently choose whether the menu-bar percent and pace values track the rolling session window (~5h for Claude/Codex) or the weekly window. Two segmented pickers, gated on the active display mode. Defaults preserve current behavior (percent = session, pace = weekly), so nothing changes unless you opt in.

  • MenuBarTimeWindow enum (session/weekly) + two persisted settings.
  • StatusItemController selects the window per setting: session → menuBarPercentWindow / UsagePaceText.sessionPace; weekly → secondary (with codex-projection / abacus fallbacks) / UsageStore.weeklyPace.

Notes

  • Defaults preserve current behavior for the separator (dot); color-coded icons default on but are one toggle away from off.
  • Adds UsageColorLevelTests, MenuBarSeparatorStyleTests, and a time-window settings round-trip test.
  • swift build, swift test (new tests), and ./Scripts/lint.sh lint all pass.

🤖 Generated with Claude Code

…Gen crash)

The nested makeTitle() in AccountSwitcherView.compactButtonTitle captured the
mutable emailWidth/workspaceWidth vars, which crashes swift-frontend (IRGen,
SIGABRT) under the Swift 6.2.3 + macOS 26.4 SDK toolchain. Pass the widths as
parameters so the nested function captures only immutable values. No behavior
change.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Color-coded icons (Advanced ▸ "Color-coded icons", default on):
- UsageColorLevel.tintColor(for:) interpolates green→orange→red by session
  usage, applied in both StatusItemController icon paths.
- IconRenderer.makeIcon(tintColor:) draws shapes directly in the tint color and
  marks the image non-template so macOS 26 Liquid Glass keeps the RGB pixels;
  older macOS still tints the template via the button's contentTintColor. Tint
  participates in the icon cache key and the render-skip signatures.
- StatusItemController observes effectiveAppearance on macOS 26+ to re-render
  baked colors on dark/light switches.

Separator style (Display ▸ "Separator", dot/pipe, default dot):
- MenuBarSeparatorStyle drives the character between percent and pace in the
  "both" menu-bar display mode.

Adds colorCodedIcons + menuBarSeparatorStyle settings plumbing and tests.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@clawsweeper

clawsweeper Bot commented May 29, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed May 30, 2026, 10:17 AM ET / 14:17 UTC.

Summary
The PR adds color-coded menu-bar icon tinting, dot/pipe separator selection, independent session/weekly percent and pace settings, a Swift 6.2.3 account-switcher build workaround, and focused tests.

Reproducibility: yes. for the review findings through source inspection: absent colorCodedIcons resolves to true, and ProviderBrandIcon.image returns template images while brand-percent applies contentTintColor. I did not run the macOS UI because this is a read-only review.

Review metrics: 3 noteworthy metrics.

  • PR surface: 16 files, +437/-31. The patch spans rendering, preferences, persisted settings, and tests, so upgrade and UI proof matter before merge.
  • Persisted settings: 4 added. New stored preferences for color, separator, percent window, and pace window create upgrade/default behavior that CI alone does not settle.
  • Proof coverage: 0 current screenshots for time-window behavior. The visible screenshots cover earlier color/separator work but not the latest user-facing feature commit.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add a redacted screenshot or recording from the latest head showing Display > Time windows and the menu-bar percent/pace output after changing session vs weekly settings.
  • [P1] Preserve upgrade-compatible colorCodedIcons absent-key behavior and add focused SettingsStore coverage.
  • Apply non-template baked tinting to brand-percent icons on macOS 26, or explicitly exclude that mode from the feature.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR body has screenshots for color/separator UI, but they predate the May 30 time-window commit and do not show the new time-window controls or resulting percent/pace behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Mantis proof suggestion
A short macOS visual proof would materially help verify the new Display time-window controls and menu-bar output. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: verify CodexBar Display time-window controls and menu-bar percent/pace output after changing session vs weekly settings.

Risk before merge

  • [P1] Existing users without a stored colorCodedIcons key would get colored menu-bar icons on upgrade unless maintainers intentionally accept a default-on visual migration.
  • [P1] Brand-percent mode can remain monochrome on macOS 26 because it still relies on contentTintColor for template ProviderBrandIcon images.
  • [P1] Current proof covers the earlier color/separator UI but not the newly added session/weekly time-window controls or output.

Maintainer options:

  1. Preserve Upgrade Appearance (recommended)
    Keep an absent colorCodedIcons key resolving to the current monochrome behavior for upgraded installs, or add a tested fresh-install-only migration if default-on color is intentional.
  2. Accept Default-On Color
    Maintainers may intentionally accept the visual change, but the PR should make that upgrade behavior explicit and show upgrade proof before merge.
  3. Split The Appearance Work
    Land the compiler workaround or time-window work separately if the color default and macOS 26 rendering need product/design review.

Next step before merge

  • [P1] Contributor and maintainer follow-up are needed for the upgrade-default decision and current-head visual proof, so this is not a safe automated repair lane right now.

Security
Cleared: The diff changes local Swift UI, settings, rendering, and tests only; I found no concrete security or supply-chain concern.

Review findings

  • [P1] Preserve current icon appearance on upgrade — Sources/CodexBar/SettingsStore.swift:379
  • [P2] Bake macOS 26 tints for brand-percent icons — Sources/CodexBar/StatusItemController+Animation.swift:477
Review details

Best possible solution:

Keep the feature behind upgrade-compatible defaults, render every advertised color-coded menu-bar path with macOS 26-safe non-template images, and require updated visual proof for the time-window controls before merge.

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

Yes for the review findings through source inspection: absent colorCodedIcons resolves to true, and ProviderBrandIcon.image returns template images while brand-percent applies contentTintColor. I did not run the macOS UI because this is a read-only review.

Is this the best way to solve the issue?

No: the feature direction is useful, but the merge path should preserve upgrade appearance, use baked non-template tinting for brand-percent mode on macOS 26, and add current-head proof for the time-window controls.

Full review comments:

  • [P1] Preserve current icon appearance on upgrade — Sources/CodexBar/SettingsStore.swift:379
    colorCodedIcons is a new preference, so existing installs will not have this key. Falling back to true changes upgraded users from the current monochrome menu-bar icon to colored icons without an opt-in; keep absent-key behavior compatible or add a narrow tested fresh-install migration if maintainers want default-on color.
    Confidence: 0.96
  • [P2] Bake macOS 26 tints for brand-percent icons — Sources/CodexBar/StatusItemController+Animation.swift:477
    In brand-percent mode this path still displays ProviderBrandIcon.image(...), which is marked as a template image, and then applies contentTintColor. The PR says macOS 26 can recolor template images and drop that tint, so users with brand+percent enabled can still get a monochrome icon while color-coded icons are on.
    Confidence: 0.9

Overall correctness: patch is incorrect
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 72716d9fd545.

Label changes

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body has screenshots for color/separator UI, but they predate the May 30 time-window commit and do not show the new time-window controls or resulting percent/pace behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • remove proof: sufficient: Current real behavior proof status is insufficient, not sufficient.
  • remove status: ⏳ waiting on author: Current PR status label is status: 📣 needs proof.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded menu-bar feature PR with concrete merge blockers but no emergency runtime or security impact.
  • merge-risk: 🚨 compatibility: The new colorCodedIcons missing-key default can change existing users' menu-bar appearance on upgrade.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body has screenshots for color/separator UI, but they predate the May 30 time-window commit and do not show the new time-window controls or resulting percent/pace behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body has screenshots for color/separator UI, but they predate the May 30 time-window commit and do not show the new time-window controls or resulting percent/pace behavior.
Evidence reviewed

What I checked:

  • Repository policy read: AGENTS.md was read fully and its guidance on small menu-bar/settings changes, focused tests, and upgrade-safe settings defaults was applied to this review. (AGENTS.md:1, 72716d9fd545)
  • Current main does not already implement the feature: Current main has the existing menu-bar display mode and brand-percent settings, but no colorCodedIcons, MenuBarSeparatorStyle, MenuBarTimeWindow, or time-window persisted settings, so the PR is not obsolete. (72716d9fd545)
  • Upgrade default changes existing visual behavior: The PR initializes the new colorCodedIcons preference to true when the UserDefaults key is absent, so upgraded installs without that key would see colored menu-bar icons without an opt-in or migration. (Sources/CodexBar/SettingsStore.swift:379, 6580336dc3e4)
  • Provider brand icons are template images: Current ProviderBrandIcon.image marks provider SVGs as template images, which is the rendering path the PR itself says macOS 26 Liquid Glass can recolor and defeat contentTintColor. (Sources/CodexBar/ProviderBrandIcon.swift:31, 72716d9fd545)
  • Brand-percent path still relies on contentTintColor: The PR's brand-percent branch still installs ProviderBrandIcon.image and then applies setButtonTintColor, rather than baking a non-template tinted image for the macOS 26 path. (Sources/CodexBar/StatusItemController+Animation.swift:477, 6580336dc3e4)
  • Earlier review repairs were addressed: The prior inline comments about separator live refresh and appearance re-render cache invalidation were followed by contributor replies saying they were fixed, and the latest diff includes menuBarSeparatorStyle observation plus signature clearing on appearance changes. (Sources/CodexBar/SettingsStore+MenuObservation.swift:27, 6580336dc3e4)

Likely related people:

  • steipete: Accessible current-main blame/log for SettingsStore and StatusItemController menu-bar behavior is attributed to Peter Steinberger, including the v0.31.0 release baseline and latest main commits. (role: recent area contributor; confidence: medium; commits: f83fb70b7f24, 72716d9fd545; files: Sources/CodexBar/SettingsStore.swift, Sources/CodexBar/StatusItemController.swift, Sources/CodexBar/StatusItemController+Animation.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 449026a333

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// appearance changes so dynamic colors (systemGreen/Orange/Red) resolve to their new values.
if #available(macOS 26, *) {
self.appearanceObservation = NSApp.observe(\.effectiveAppearance) { [weak self] _, _ in
Task { @MainActor in self?.updateIcons() }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Invalidate icon render signatures on appearance changes

When the macOS 26 appearance observer fires, calling updateIcons() is not enough to re-render the baked non-template tint: if usage/status values are unchanged, applyIcon rebuilds the same tint= signature and shouldSkipMergedIconRender/shouldSkipProviderIconRender returns before IconRenderer.makeIcon can resolve the dynamic system color again. In the dark/light switch case described in the comment, the old RGB bitmap can therefore remain until some other icon-signature input changes; clear the cached render signatures or include an appearance/color hash in them before updating.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is also fixed

Comment thread Sources/CodexBar/PreferencesDisplayPane.swift
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: sufficient Contributor real behavior proof is sufficient. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 29, 2026
johnlarkin1 and others added 2 commits May 29, 2026 00:20
Addresses two review findings:

- Observe menuBarSeparatorStyle in the menu observation token, so changing the
  Dot/Pipe picker refreshes the status item immediately instead of waiting for
  another observed setting or usage update.
- On the macOS 26 effectiveAppearance change, clear the cached icon render
  signatures before updateIcons(). The signatures don't encode appearance, so an
  unchanged usage/status value would otherwise short-circuit the re-render and
  leave the stale baked (non-template) bitmap until some other input changed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The toggle lived under Advanced, making it hard to find next to the other
menu-bar appearance settings. Move it into Display ▸ Menu Bar (default stays
on) so the disable option sits where users look for menu-bar icon options.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@johnlarkin1

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 29, 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added 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 May 29, 2026
Adds a third menu-bar configuration: independent session vs weekly
time-window selection for the percent and pace values.

- MenuBarTimeWindow enum (session/weekly)
- Two persisted settings with backward-compatible defaults
  (percent=session, pace=weekly)
- Segmented pickers in the Display preferences pane, gated on display mode
- StatusItemController selects the percent/pace window per setting
  (session -> menuBarPercentWindow / UsagePaceText.sessionPace,
   weekly -> secondary / UsageStore.weeklyPace)
- Round-trip test for the new settings

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@johnlarkin1 johnlarkin1 changed the title Color-coded menu bar icons + separator style (macOS 26 aware) Color-coded menu bar icons + separator style + time-window selection (macOS 26 aware) May 30, 2026
@clawsweeper clawsweeper Bot added 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. and removed proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels May 30, 2026
@steipete

Copy link
Copy Markdown
Owner

Thanks for exploring these menu-bar options. Closing this combined PR so any follow-up can be split into independently reviewable changes. The current branch changes the existing-user color default, still depends on a template-image tint path that does not solve the reported macOS behavior, treats every secondary quota as weekly, and adds unlocalized controls. Separate provider-aware time-window and icon-rendering proposals with compatible defaults and current UI proof would be easier to validate and land.

@steipete steipete closed this Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants