Skip to content

Port v0.59 optional tray pace colors - #493

Merged
Finesssee merged 2 commits into
port/upstream-0.59.0from
port/upstream-v0.59-tray-pace-colors
Sep 13, 2026
Merged

Finesssee merged 2 commits into
port/upstream-0.59.0from
port/upstream-v0.59-tray-pace-colors

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

What changed

Ports the concrete v0.59 pace-color behavior to the existing Windows tray surface:

  • Adds an opt-in persisted menuBarColorPace setting and Display tab toggle.
  • Colors the existing Windows tray usage indicator green when behind pace and red when ahead of pace.
  • Keeps zero, unavailable, and non-finite deltas at the normal usage color; error icons remain desaturated.
  • Covers settings persistence, bridge propagation, renderer direction, and UI behavior with tests.

Upstream reference: fe7a45ffab530e6b850800fd4a01ef1972709b0d.

Scope boundary

Windows has no one-to-one equivalent of the upstream macOS status-item pace token, so this port uses the existing PaceSnapshot with the existing tray bar/percent renderer. It does not change detailed card pace colors or add macOS-only status-item, plugin, or NSMenu behavior. Devin, Kimi, and shared spend changes are outside this PR.

Validation

  • pnpm test -- --run: 60 files, 350 tests passed.
  • pnpm test -- --run src/surfaces/settings/tabs/DisplayTab.test.tsx: 5 tests passed.
  • pnpm run check-locale: 851 locale keys matched.
  • pnpm run build: passed.
  • Shared settings round-trip and tray direction focused tests: passed.
  • cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml: 403 tests passed.
  • Fresh CARGO_INCREMENTAL=0 pnpm --dir apps/desktop-tauri run tauri:build:debug: passed.
  • Fresh desktop artifact: 54,306,816 bytes; SHA-256 89460BB261AA9DCBFB844CE457710E92AC0E8F47FD46AABDA72B644D90A83FDE.

The shared Rust suite run during this porting batch had one unrelated timing-sensitive Claude subprocess test failure (1,768 passed, 1 failed, 1 ignored); its exact rerun passed and the port worktree does not modify that runner. Native Windows CUA visual acceptance was unavailable in this validation session, so manual tray/menu visual verification remains a follow-up acceptance step.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 988f0a01-de89-4647-bf2c-63d6b800a45f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tlq5l

tlq5l commented Sep 13, 2026

Copy link
Copy Markdown

Thermo-nuclear code-quality review (Oracle request; read-only swarm receipt unavailable for this PR)

Verdict: PASS for merge readiness; no merge-blocking thermo finding was verified in the local audit.

The requested swarm task for PR #493 timed out before producing a valid receipt. I therefore checked the complete diff and surrounding settings-to-tray path locally. The optional menu_bar_color_pace field is propagated through the typed settings model, partial update command, persistence defaults, tray refresh trigger, and renderer; the render wrappers preserve existing callers and the new behavior has focused direction/opt-in tests.

No high-confidence large-file, wrapper, orchestration, type-boundary, atomicity, or decomposition regression was found. The CircleCI/interaction-guard status is tracked separately from this thermo verdict.

@tlq5l

tlq5l commented Sep 13, 2026

Copy link
Copy Markdown

Superseding thermo verdict — BLOCKED.

Oracle found a canonical pace-policy divergence in this PR. The tray renderer reclassifies raw delta_percent in rust/src/tray/render.rs and tray_bridge.rs, while rust/src/core/usage_pace.rs already owns PaceStage with an on-track band of absolute delta at most 2. A +1 or -1 delta is therefore colored ahead or behind by this PR even though the canonical stage is OnTrack. Drive the tint from the existing PaceSnapshot.stage instead of recreating classification from the raw delta.

@tlq5l

tlq5l commented Sep 13, 2026

Copy link
Copy Markdown

Thermo follow-up: blocker fixed and validated.

Oracle had blocked this PR because tray code reclassified pace from raw delta_percent, bypassing the canonical PaceStage band. Commit 5435c41ff maps the bridge stage through TrayPaceColor::from_stage; on_track stays normal even when the raw delta is +1.

Validation: canonical pace renderer test 1/1; Tauri tray bridge test 1/1; Rust and Tauri clippy with -D warnings; and cargo fmt --all -- --check all pass. The pre-existing apps/desktop-tauri/src-tauri/Cargo.toml worktree edit was left uncommitted.

Oracle post-fix verdict: PASS. Hosted CI and Windows CUA evidence remain separate process gates.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

Windows UI validation note: fresh pnpm run tauri:build:debug completed successfully and produced target/debug/codexbar-desktop-tauri.exe from this repaired branch. The CUA inventory returned no native apps and its app-selection API was unavailable, so no screenshot/window assertion could be captured. This is a tooling evidence limitation; the code-level thermo verdict remains PASS.

@Finesssee
Finesssee merged commit 3f08d66 into port/upstream-0.59.0 Sep 13, 2026
1 check passed
@Finesssee Finesssee mentioned this pull request Sep 15, 2026
junglesub-bot Bot pushed a commit to junglesub/Win-CodexBar that referenced this pull request Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants