Repository navigation
Port Mac window lengths and menu-bar pace lane (F1-F7) - #835
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to This change brings window-length and tray pace-tint behavior to Windows. No actionable merge-blocking risk was identified in the supplied review material. Pre-merge checks |
|
Summary
Mac-parity port of the seven window-length gaps (F1 to F7) from the Lane R validation. In each, Windows either dropped a usage-window length that the Mac keeps, or paced the tray on a different lane than the Mac. A window with no length gets no menu-bar pace and, for some rows, no card pace line. Mac citations are upstream
v0.73.0unless noted. Each one was rechecked against the bare upstream repo.Sources/CodexBarCore/Providers/Codebuff/CodebuffUsageSnapshot.swift:97-106(windowMinutes: 7 * 24 * 60)MiniMaxUsageSnapshot.swift:116-119,:225-287(windowMinutes(for:))MiniMaxUsageFetcher.swift:880-888(windowTypeOverride: "Weekly") →MiniMaxUsageSnapshot.windowMinutes(for:)regen_windowdropped the payload minutesresetRegenerates, no provider check), and the "Regenerates" wording from #833 is unchangedResources/Plugins/synthetic.js:260-263; cardMenuCardView+ModelHelpers.swift:179-186(syntheticRollingRegenDetailreplaces the pace),MenuCardView.swift:1407-1415now < end, so an ended period lost its lengthend > startandstart <= nowProviders/Grok/GrokCreditsProxyFetcher.swift:86-93(v0.70.0:98-104){1: 1440, 3: 60, 5: 1, 6: 10080}; the monthly MCP marker (unit 5, number 1) keeps the 30-day sentinel; the 5-hour plausibility check runs on token limits onlyResources/Plugins/zai.js:85-99bridge.rs:438-460at723aa7725): the primary lane, or the secondary lane when the primary is an informational placeholder, whatever metric the icon drew. It was skipped when that lane had no length (window_has_length)weeklyPaceguards: pace allowed, quota left > 0, the window has its own length, monthly sentinel resolved, expected use ≥ 3%Sources/CodexBar/StatusItemController+Animation.swift:1207-1225(menuBarPaceWindow, called at:914-927);StatusItemController.swift:349-360(menuBarMetricWindow);Sources/CodexBar/UsageStore+HistoricalPace.swift:8-64,:118-124F7 design
tray_presentation.rs. The two Mac exceptions are a typed provider hook,Provider::menu_bar_pace_lane()(defaultNone). Only Codex (Secondary, its weekly lane afternormalize_named_windows) and Abacus (Primary) override it. Shared code has no provider checks.ProviderUsageSnapshotgains a tray-onlypace_authoritativeflag (allowsPace(dataConfidence:)). It isskip_serializing, so the frontend payload is unchanged. The oldPaceSnapshot.window_has_lengthflag is removed.pacethat the Settings detail uses is unchanged.TrayPresentationPlan::resolve, only when pace tint is on.resolveruns on provider refresh and on tray-relevant settings, locale, currency or preferences changes (tray_bridge.rs:346,:368,:411), never on a timer. The shell already instantiates providers this way for metadata.Providers whose tray tint changes (only with "Color menu bar icon by pace" on)
minimumExpectedPercent: 3). Both are new.usage_metric::automatic_window), whenever the drawn window isn't the primary one:automatic_metric_prefers_secondary_window).doubao/mod.rs:467-510), so they drive the tint.UsagePace::weeklyneeds a future reset), so its tint doesn't change.Tests added
codebuff::tests::weekly_lane_is_seven_days_and_credits_lane_has_no_lengthminimax::coding_plan_html::tests::services_rows_take_their_length_from_the_window_type,minimax::coding_plan::tests::window_type_minutes_follow_the_mac_unitsminimax::coding_plan::tests::weekly_row_without_start_and_end_is_seven_daysSome(300)/Some(10_080)on regen windows; vitestmetricRowModel"hides pace on a regenerating window that keeps its length" (pace text and marker null, workday ticks kept)grok::credits_proxy_tests::ended_period_keeps_its_lengthzai::tests::time_limit_primary_takes_its_unit_length,weekly_time_limit_primary_is_seven_daystray_presentation::tests:tray_pace_tint_is_opt_in_and_follows_the_drawn_window_stage(stage plus rendered RGBA for Bars and Percent)tray_pace_tint_follows_the_selected_metric_lanecodex_tray_pace_tint_uses_its_weekly_lanetray_pace_tint_follows_the_mac_weekly_pace_guards(no length, not authoritative, exhausted, 1.7% vs 3.3% expected)tray_pace_tint_uses_the_icon_fallback_windowtray_pace_tint_scores_a_regenerating_window_with_a_lengthstacked_tray_icon_keeps_usage_colours_when_pace_tint_is_enabledbridge::pace::tests::copilot_lengthless_window_keeps_provider_and_lane_pace.Commands (PR head
70e311cce)All on a local Windows workstation; logs in
W:/mac-parity/report/lane-f/checks/.cargo fmt --all -- --checkcargo test --manifest-path rust/Cargo.tomlcargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warningscargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.tomlcargo clippy --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml --all-targets -- -D warningspnpm --config.verify-deps-before-run=false testpnpm exec tsc --noEmitpnpm run buildProof
tray_presentationunit tests above (stage and rendered RGBA). It isn't captured live, because the provider icons sit in the hidden-icons area.build-proof.shdebug build of the head (proof shims not committed), compared with the same build of723aa7725.win_run.pywith the localhost mock server, an isolated home andpark.pyon the secondary monitor.W:/mac-parity/report/lane-f/:runs/<Pack>@before|@after/panel.png;Codebuff-before-after-mac.png,MiniMax-before-after-mac.png,Synthetic-before-after-mac.png,Zai-before-after-mac.png.packs/MiniMaxServices, runsruns/MiniMaxServices@before|@after):ended_period_keeps_its_length.Known differences, not changed (reverse direction: Windows has a length the Mac lacks)
Open questions (default chosen)
windowMinutes(for: "Weekly").CodexHistoricalPaceEvaluator) when historical tracking is on and work days are off. Windows keeps linearUsagePacefor the tray. Default: not ported (smallest change).5b799e69c(see below). The expected/actual pace bars in that section were already there before this PR and still show for the regenerating five-hour window. That is left for a Settings follow-up.MenuBarLayoutRenderer.swift:664, :1017); Windows tints the tray icon. Default: keep the icon tint as the Windows version.Adversarial validation (Opus,
W:/mac-parity/report/lane-f/VALIDATE.md)Verdict: MERGE-READY. Commits added after the builder's head
70e311cce:7325962feMerge origin/main (includes Settings follow-ups: System language, quota warnings export, cost switches, thresholds, no email under HPI #834).5b799e69cHide the Settings pace budget on regenerating windows (paceBudget.ts, with vitest cases).900f1a4acMove MiniMax coding plan tests to their own file (coding_plan_tests.rs; all 18 tests kept).ea8f8eb01Assert the stacked tint test would tint a single icon (TrayPaceColor::Ahead).dcb95da94Reject Z.ai window lengths that overflow (checked_mul, with a test).Checks on
dcb95da94:cargo fmt --checkpass; rustcargo test4119 passed, 0 failed, 1 ignored; tauricargo test687 passed, 0 failed; clippy-D warningspass on both manifests; vitest 119 files, 1078 tests passed;tsc --noEmitpass;pnpm run buildpass.Proof: Settings › Providers › Synthetic before (
70e311cce) shows "Weekly tokens · On-pace budget" plus the chart; after (dcb95da94) shows neither, with card rows unchanged. Saved locally inW:/mac-parity/report/lane-f/validate/runs/SyntheticWeeklyRegen@{before,after}/; not committed.