Fix usage display: CNY sidebar snapshot + 2-decimal spend - #147
Merged
Conversation
Brings the collapsible usage snapshot from PR #145 (cherry-picked 22880f1) onto main and adapts it to the CNY infrastructure now on main: - SidePanel usage snapshot renders spend in CNY (Y) with 2 decimals, mirroring SettingsView.vue (exchangeRate from usage:get-stats, 7.2 fallback). - SettingsView usage page: total + per-model spend now show 2 decimals instead of 4. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1fe75171-fea2-45ef-9401-bf8a4ea0f2ba
yikkuro
marked this pull request as ready for review
July 30, 2026 07:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two usage-display issues and brings the collapsible usage snapshot into the left SidePanel.
This PR cherry-picks the collapsible usage snapshot from draft PR #145 (commit
22880f1) and rebases it onto the latestmain, then adapts it to the CNY infrastructure already onmain(from #136). It supersedes/continues draft PR #145. Themain-side conflicts (from #142 "Hide Skills UI") were resolved so the change stays scoped to the SidePanel usage snapshot — no Phone/Usage nav items are re-introduced.Fixes
loadUsageSnapshotnow capturesexchangeRatefromusage:get-stats(with a7.2fallback mirroringSettingsView.vue). The oldformatUsd(Intlcurrency: USD→$) is replaced byformatCny, which multiplies by the rate and renderst("settings.currencySymbol")+ 2 decimals (e.g.¥304.92). The DEV mock passesexchangeRate: nullso it falls back to 7.2 and never ships enabled in prod..toFixed(4)to.toFixed(2). Other already-2-decimal figures (budget, etc.) are untouched.Validation
desktop:npx tsc --noEmit→ exit 0renderer:npx vue-tsc --noEmit→ exit 0renderer:npm run test→ 14 files / 199 tests passedrenderer:npx vite build→ success; confirmedimport.meta.env.DEVcompiles out (mock not shipped enabled)desktop npm testskipped — change is renderer-only (nodesktop/srcedits)