Skip to content

Pace polish: per-provider pace capability, Copilot tray tint, Notion Monthly - #832

Merged
Finesssee merged 4 commits into
mainfrom
feat/pace-polish
Oct 11, 2026
Merged

Finesssee merged 4 commits into
mainfrom
feat/pace-polish

Conversation

@Finesssee

@Finesssee Finesssee commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Pace polish from the 2026-10-12 Mac parity decisions. Four scoped commits:

  1. Per-provider pace capability (c00b43e01). Each provider that opts in declares PACE_CAPABILITY in its own module (providers/<name>/mod.rs), as the upstream provider descriptors do. provider_factory::pace_capability dispatches with an exhaustive match, so a new ProviderId without an arm doesn't compile. ProviderId::pace_capability now delegates to it. Nothing changes for users.
  2. Amp: pin tests, no behaviour change (2da288cdf). This corrects the earlier summary. Upstream does not use a flat 30 days for Amp. AmpUsageSnapshot.swift:121-131 (v0.69 to v0.73) sizes a renewing window from the period span, or else uses calendarMonthResetWindow.resolvedResetWindowForPace, which is the real calendar month (28 days for a February cycle). Windows amp/subscription.rs already does the same. The new test legacy_renewal_window_uses_the_real_calendar_month_length pins it.
  3. Copilot: no tray pace colour (6554f158b). The Mac skips menu-bar pace for a non-Codex window without a length (UsageStore+HistoricalPace.swift:47, guard window.windowMinutes != nil). Before this change, Windows fell back to a 7-day length for snapshot.pace and tinted Copilot's tray icon. PaceSnapshot.window_has_length is a typed flag (not serialized). tray_pace_color filters on it, and the card's pace line is unchanged.
  4. Notion: "Monthly" label (bde474e54). The Mac labels it weeklyLabel: "Monthly" (NotionProviderDescriptor.swift:32). Notion now sets secondary_label_key = ProviderLabelMonthly, which crosses the bridge as secondaryLabelKey. The card prefers that key, and other monthly lanes keep the shared "30-Day" label.

Tests added

  • rust/src/providers/amp/mod.rs: legacy_renewal_window_uses_the_real_calendar_month_length
  • src-tauri/src/commands/bridge/pace.rs:
    • copilot_provider_pace_is_marked_lengthless_for_the_tray
    • provider_pace_from_a_window_with_a_length_keeps_the_tray_tint
  • src-tauri/src/tray_presentation_tests.rs: tray_pace_tint_skips_pace_from_a_window_without_a_length. This is the RGBA-level check; tray pixels can't be captured by the proof rig.
  • src-tauri/src/commands/bridge.rs: secondary_label_key_crosses_the_bridge_only_when_the_provider_sets_it
  • MenuCard.test.tsx: "names Notion's billing lane Monthly while other monthly lanes keep 30-Day"
  • Notion module test asserting the label key.

Commands (run on head bde474e)

Command Result
cargo fmt --all -- --check exit 0
cargo test --manifest-path rust/Cargo.toml 4101 passed, 0 failed, 1 ignored (plus doc/bin: 1 passed, 0 passed)
cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings exit 0
cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml 679 passed, 0 failed
cargo clippy --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml --all-targets -- -D warnings exit 0
pnpm --config.verify-deps-before-run=false test 118 files, 1050 passed
pnpm exec tsc --noEmit exit 0
pnpm run build exit 0

Proof

  • I rebuilt a debug app from this head with the proof shims (not committed) and drove it with the mock-server proof rig, using an isolated proof home.
  • The Notion pack card reads "Monthly 38% left · Resets in 14d · 9% in deficit · Runs out in 9d 19h". The rolling lane is unchanged.
  • The Copilot pack card is unchanged. Its tray tint is covered by the RGBA unit test above.
  • Local proof paths (not committed):
    • W:/mac-parity/report/lane-r/pr1/Notion/{panel.png,result.json,mac-card.png}
    • W:/mac-parity/report/lane-r/pr1/Copilot/{panel.png,result.json,mac-card.png}
    • W:/mac-parity/report/lane-r/pr1/checks.txt

Open questions (default chosen)

  • Tray tint for other lengthless windows. The tint is now skipped for every provider whose tray window has no length, not only Copilot. That matches the Mac's generic guard. A rough grep suggests this also affects bedrock, claude (lengthless lanes only), codebuddy, doubao, kilo, kiro, manus, mistral, openaiapi, opencode, opencodego, qoder, sub2api, synthetic, v0, warp and zed. Default: follow the Mac. The card pace line is untouched.
  • Notion label scope. Only Notion says "Monthly". Other providers' monthly lanes keep the shared "30-Day" key. Default: the smallest change.

Summary by CodeRabbit

  • Bug Fixes

    • Pace indicators no longer tint tray icons when a usage window has no defined duration.
    • Corrected pace calculations for monthly subscription windows to reflect their actual calendar length.
  • Improvements

    • Monthly usage lanes now display provider-appropriate labels, such as “Monthly” or “30-Day.”
    • Improved pace handling across providers with different reset schedules and window formats.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: nesszer/Win-CodexBar/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 8a9def21-7dd3-404d-add5-24198502ec3a

📥 Commits

Reviewing files that changed from the base of the PR and between 257a538 and bde474e.


📒 Files selected for processing (31)
  • apps/desktop-tauri/src-tauri/src/commands/bridge.rs
  • apps/desktop-tauri/src-tauri/src/commands/bridge/pace.rs
  • apps/desktop-tauri/src-tauri/src/commands/providers.rs
  • apps/desktop-tauri/src-tauri/src/commands/providers/reset_backfill.rs
  • apps/desktop-tauri/src-tauri/src/powertoys.rs
  • apps/desktop-tauri/src-tauri/src/tray_bridge.rs
  • apps/desktop-tauri/src-tauri/src/tray_presentation.rs
  • apps/desktop-tauri/src-tauri/src/tray_presentation_tests.rs
  • apps/desktop-tauri/src-tauri/src/usage_metric.rs
  • apps/desktop-tauri/src/components/MenuCard.test.tsx
  • apps/desktop-tauri/src/components/MenuCard.tsx
  • apps/desktop-tauri/src/types/bridge.ts
  • rust/src/core/pace_capability.rs
  • rust/src/core/provider.rs
  • rust/src/core/provider_factory.rs
  • rust/src/core/usage_snapshot.rs
  • rust/src/providers/alibaba/mod.rs
  • rust/src/providers/alibabatokenplan/mod.rs
  • rust/src/providers/amp/mod.rs
  • rust/src/providers/commandcode/mod.rs
  • rust/src/providers/copilot/mod.rs
  • rust/src/providers/cursor/mod.rs
  • rust/src/providers/doubao/mod.rs
  • rust/src/providers/grok/mod.rs
  • rust/src/providers/kimi/mod.rs
  • rust/src/providers/mimo/mod.rs
  • rust/src/providers/notion/mod.rs
  • rust/src/providers/ollama/mod.rs
  • rust/src/providers/opencodego/mod.rs
  • rust/src/providers/stepfun/mod.rs
  • rust/src/providers/zai/mod.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.



📝 Walkthrough

Walkthrough

Provider pace capabilities are declared in provider modules and dispatched through the factory. Pace snapshots now expose whether the selected window has a length, which affects tray tint. Secondary-window locale keys pass through snapshots and can determine menu-card labels.

Changes

Pace reporting

Layer / File(s) Summary
Provider pace capability lookup
rust/src/core/pace_capability.rs, rust/src/core/provider.rs, rust/src/core/provider_factory.rs, rust/src/providers/*/mod.rs
Provider modules declare pace capabilities. The factory maps provider IDs to these declarations or to UNSUPPORTED. Amp tests cover 28-day and 31-day renewal windows.
Pace window metadata and tray tint
apps/desktop-tauri/src-tauri/src/commands/bridge.rs, apps/desktop-tauri/src-tauri/src/commands/bridge/pace.rs, apps/desktop-tauri/src-tauri/src/tray_presentation*
Pace snapshots record whether the selected primary window has a length. Tray tint is skipped when the pace window has no length. Tests cover lengthless and length-bearing windows.

Secondary-lane labels

Layer / File(s) Summary
Secondary label key propagation
rust/src/core/usage_snapshot.rs, rust/src/providers/notion/mod.rs, apps/desktop-tauri/src-tauri/src/commands/bridge.rs, apps/desktop-tauri/src/types/bridge.ts, apps/desktop-tauri/src-tauri/src/commands/*, apps/desktop-tauri/src-tauri/src/powertoys.rs, apps/desktop-tauri/src-tauri/src/tray_bridge.rs, apps/desktop-tauri/src-tauri/src/tray_presentation_tests.rs, apps/desktop-tauri/src-tauri/src/usage_metric.rs
Usage snapshots can carry a secondary label key. The bridge passes it through when a secondary window exists. Notion sets ProviderLabelMonthly for its secondary billing window.
Translated secondary labels
apps/desktop-tauri/src/components/MenuCard.tsx, apps/desktop-tauri/src/components/MenuCard.test.tsx
Menu cards translate secondaryLabelKey when present and otherwise use the existing label fallback. Tests verify the distinct Notion and Augment monthly labels.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix


Merge Risk: ⚪ Minimal · up to bde47

The Notion Monthly label has a matching translation key, and no actionable merge-blocking risk is established. Merge after normal checks.

Pre-merge checks | Passed 7 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check Warning The title accurately summarizes the main changes, but it is a descriptive phrase rather than the required short imperative summary. Rewrite the title as an imperative, such as "Polish per-provider pace, Copilot tray tint, and Notion monthly labels".
✅ Passed checks (7 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Provider Data Stays Siloed Passed No provider-data silo violation is introduced. UsageSnapshot::secondary_label_key carries only a locale key, and ProviderUsageSnapshot::from_fetch_result copies it from the same provider snapshot;…
Secrets Handled Safely Passed PASS. The reviewed diff adds only pace metadata, locale-key fields, provider capability constants, tests, and fixture initialization. The new bridge fields contain booleans, numeric pace data, or the …
No Unapproved Dependencies Passed The pull-request diff changes only Rust and TypeScript source and test files. It does not modify any Cargo.toml or package.json, add an npm/yarn lockfile, or change the pnpm packageManager version. No…
Ui Changes Include Windows Proof Passed The PR changes visible UI behavior in MenuCard.tsx and tray presentation. The description includes a fresh-build proof note: the author rebuilt a debug app from the reviewed head, drove the proof ri…

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR


🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 React Doctor (0.9.14)

Project "apps/desktop-tauri" is not a workspace project or a directory. Available projects: desktop-tauri



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.

@Finesssee
Finesssee merged commit 2baeb30 into main Oct 11, 2026
4 checks passed
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.

1 participant