fix: compact DeepSeek balance in custom menu-bar layouts - #2816
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c7dde5ae7
ℹ️ 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".
| return ( | ||
| semanticWindows.session, | ||
| semanticWindows.weekly, | ||
| Self.compactDeepSeekMenuBarWindow(provider: provider, snapshot: snapshot, window: automatic)) |
There was a problem hiding this comment.
Keep the DeepSeek layout editor preview compact
When a live DeepSeek snapshot is available, this normalization only affects the status-item render path; MenuBarLayoutPreview.liveData independently assigns the unmodified automatic window in MenuBarLayoutEditor.swift, so resetCountdown and resetAbsolute still show the full ¥2.23 (Paid: …) string in the editor while the saved layout shows ¥2.23. Share this normalization with the preview path so the editor remains an accurate representation of the resulting menu-bar layout.
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Reviewed August 9, 2026, 6:02 PM ET / 22:02 UTC. ClawSweeper reviewWhat this changesThis PR centralizes DeepSeek balance shortening for automatic reset tokens and uses it for both the menu-bar item and its live layout-editor preview. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 3 items remain The patch appears correct and resolves the prior editor-preview mismatch, but it needs real after-fix application proof before merge; the attached image is explicitly a synthetic test-harness render. Priority: P2 Review scores
Verification
How this fits togetherCodexBar converts provider usage snapshots into rate-window data, then renders that data in the macOS menu bar and the settings layout preview. The change alters only DeepSeek’s display text on those two rendering paths. flowchart LR
A[DeepSeek usage snapshot] --> B[Automatic rate window]
B --> C[DeepSeek display normalizer]
C --> D[Menu bar render data]
C --> E[Layout preview render data]
D --> F[Saved menu bar]
E --> G[Settings preview]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the shared display-only normalization after a redacted live-app capture confirms that the editor preview and saved menu-bar item both show the compact balance. Do we have a high-confidence way to reproduce the issue? Yes, from source: a DeepSeek snapshot whose primary reset description contains the paid/granted breakdown reaches the automatic reset tokens unchanged on current main; the PR’s focused tests model that path. Is this the best way to solve the issue? Yes. A shared, DeepSeek-only display projection is narrower and safer than changing provider data or duplicating formatting logic in the menu bar and preview. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6f27b777afba. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
5c7dde5 to
be2ea99
Compare
|
Merged as Landing proof:
The separate bonus/granted-credit product preference in #2638 remains open; this PR intentionally used |

Summary
DeepSeek reports balance text such as
¥2.23 (Paid: ¥2.23 / Granted: ¥0.00). Saved/custom menu-bar reset tokens previously rendered that full value, which could overflow the status item. The live layout-editor preview also resolved its automatic window independently, so a status-only fix made the preview disagree with the saved result.This PR now applies one display-only automatic-window normalizer to both the running status item and
MenuBarLayoutPreview.liveData. DeepSeek reset-countdown and reset-absolute tokens render only the leading balance (¥2.23) on both surfaces. Used percentage, reset time, regeneration metadata, window duration, and placeholder state are preserved; other providers are unchanged.Changes
MenuBarLayoutAutomaticWindowDisplayNormalizer.RateWindowmetadata.0.49.1 — Unreleased.Visual proof
Synthetic data only; no accounts, credentials, or personal information. The two values in each row are the reset-countdown and reset-absolute tokens.
Validation
swift test --filter StatusItemBalanceDisplayTests— 37 passed.swift test --filter MenuBarLayoutRendererTests— 16 passed.swift test --filter MenuBarLayoutEditorTests— 10 passed.swift test --filter ProviderArchitectureGatekeeperTests— 38 passed.make check— passed; SwiftLint reported 0 violations.make test— 833 selections in 70 groups; all 70 passed on the first attempt, with 0 retries and 0 timeouts.patch is correct, 0.99 confidence).Out of scope
The issue's separate “granted/bonus credit only” preference remains a product decision and is intentionally not included.
Refs #2638