Repository navigation
Show DeepSeek balance in tray status and float bar - #1071
aaron-he-zhu wants to merge 1 commit into
Conversation
DeepSeek is a balance-only provider, but the port rendered its balance as a fake 0%/100% quota meter in the tray status and float bar. Port upstream's balanceOnly metadata, keep the short balance text in the headline window description, move Paid/Granted to display details, and let the tray status and float bar show the balance text instead of a percentage. Adds a browser-proof fixture/scenario for the float bar.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Summary
DeepSeek is a balance-only provider: it reports an account balance, not a quota meter. The port already labels its lanes
Balance/Balance, but the balance leaked into percent surfaces as a meaningless 0 % used / 100 % used meter (seen in the float bar and tray status). This ports upstream'sbalanceOnlymetadata and shows the reported balance text where those surfaces would otherwise render a percentage.Before:
DeepSeek: 100% leftin the tray status / float-bar pill.After:
DeepSeek: ¥231.01in the tray status and¥231.01in the float-bar pill.What changed
ProviderId/ spec: newbalance_onlyflag (upstreamProviderMetadata.balanceOnly), set for DeepSeek, exposed asProviderId::is_balance_only().¥231.01,$3.50,$0.00 - add credits, or the unavailable wording). Paid/Granted move toPaid/Granteddisplay details so the card keeps that breakdown.balance_only_status_texthelper intray_presentation;metric_status_labelprefers it. It applies only when the provider declaresbalance_onlyand its headline window has no quota length or reset (a real metered window keeps its percentage).balanceText(computed with the same helper); the float-bar pill shows it instead of the fake percentage and keeps the neutral tone. Pill title readsDeepSeek: ¥231.01.floatbar-deepseek-balancebrowser-proof scenario and syntheticdeepseek-balancefixture; screenshot committed atdocs/proof/deepseek-balance/floatbar.png.## [Windows] Unreleased.The tray icon keeps its availability meter (a pixel icon cannot render text); only the tray status text and the float bar show the balance. A provider that reports a real quota length or reset keeps its percentage.
CircleCI does not run for fork PRs (see CONTRIBUTING); the checks below were run locally on the fork head.
Tests
Commands run on Windows 11 26300 (zh-CN), Rust 1.98.0, Node v24.22.1, pnpm 11.25.0, MSVC 14.44:
Notes on the failures, none in files touched by this change:
cargo test --workspacefailures are allcost_scanner::codex::tests::codex_auto_review::*(pricing-completeness expectations in the cost scanner). They reproduce in this environment independent of this diff.currency.test.ts,UsageSpendTrendPanel,QuotaBurndownChart,TrayPanelspend totals) that assume an en-US host; this Windows host reports zh-CN, soIntlrendersUS$4.25/ Chinese dates. All 67 tests covering the changed code pass.pnpm proof:check --only floatbarcould not complete in this environment: its headless Edge CDP run reportssurface never became readyfor both floatbar scenarios (the same page and fixture render fine when loaded directly in headless Chromium, and the proof build type-checks). Equivalent manual proof was captured instead (below).Proof
docs/proof/deepseek-balance/floatbar.png — Chromium (headless Edge, mocked IPC) at 520×120 for
?window=floatbar&fixture=deepseek-balance, showing the pill ¥231.01 instead of a percentage.CUA/native tray proof was not captured: no CUA driver is installed in this environment, and
floatbaris not aCODEXBAR_PROOF_MODEsurface (the harness supportsmain,settings:*,flyout). The real tray/float-bar rendering should still be spot-checked on a native Windows desktop before merge; the change is webview content (pill label) plus provider data, and the browser proof above exercises the same React component and bridge payload.Links
Sources/CodexBarCore/Providers/DeepSeek/DeepSeekProviderDescriptor.swift(balanceOnly,usesDetailBackedWindow) andSources/CodexBar/Menu/MenuBarLayout.swift(MenuBarDisplayText.deepSeekBalanceText).Summary by CodeRabbit