Repository navigation
Show Soniox spend and balance as a pay-as-you-go card - #1030
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Set the pay-as-you-go cost flag rust/src/core/usage_snapshot.rs, rust/src/providers/soniox/* |
CostSnapshot adds a non-serialized pay_as_you_go flag. Soniox sets it, and its test checks the flag. |
Bridge propagation
| Layer / File(s) | Summary |
|---|---|
Carry the flag through the bridge apps/desktop-tauri/src-tauri/src/commands/bridge.rs, apps/desktop-tauri/src/types/bridge/usage.ts, apps/desktop-tauri/src-tauri/src/tray_presentation_tests.rs, apps/desktop-tauri/src-tauri/src/usage_metric/tests.rs |
The bridge copies the flag into its snapshot and exposes it to TypeScript. Test fixtures initialize the field to false. |
Cost-card presentation
| Layer / File(s) | Summary |
|---|---|
Render and localize pay-as-you-go costs apps/desktop-tauri/src/lib/cardCost.ts, apps/desktop-tauri/src/lib/cardCost.test.ts, apps/desktop-tauri/src/i18n/keyGroups/core.ts, rust/src/locale.rs, rust/src/locale/*.ftl |
Pay-as-you-go cards show the localized title, period spend, and optional balance without a meter. Tests cover compact, detailed, and hidden styles, plus the absent-balance case. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant Soniox
participant CostSnapshot
participant ProviderUsageSnapshot
participant CostSnapshotBridge
participant cardCostSection
Soniox->>CostSnapshot: Set pay_as_you_go
ProviderUsageSnapshot->>CostSnapshotBridge: Copy pay_as_you_go
CostSnapshotBridge->>cardCostSection: Provide payAsYouGo
Possibly related PRs
- nesszer/Win-CodexBar#1002: Adds Soniox cost data; this change marks that cost data as pay-as-you-go and presents it without a meter.
Suggested reviewers: pasharm
Merge Risk: 
Minimal · up to 69234
-
No actionable defect remains identified in the pay-as-you-go presentation change.
Pre-merge checks: 
7 · 
1
-
Failed checks: 1 warning Passed checks: 7 passed-
Full details: Provider Data Stays Siloed
-
Explanation
The change keeps Soniox data provider-scoped. Soniox sets only the generic
CostSnapshot.pay_as_you_gopresentation flag inrust/src/providers/soniox/mod.rs. The bridge copies that flag from the current provider result, andMenuCardpasses that same provider'scosttoExtraUsageBlock. The sharedcardCost.tsbranch matches the boolean flag and adds no identity, plan, account label, or email handling. The diff adds no newProviderId-specific branching outside the permitted provider code.
Full details: Secrets Handled Safely
-
Explanation
The PR changes only add a pay-as-you-go flag, Soniox card rendering, locale strings, and tests. Added lines contain no token, cookie, API key, OAuth credential, authorization header, logging call, user-facing error, or credential-file operation. Soniox authentication code and its test bearer key references are unchanged context; the new code only propagates spend metadata and balance values.
Full details: No Unapproved Dependencies
-
Explanation
The pull-request diff changes 21 source, test, and locale files only. It does not change any Cargo.toml or package.json, add an npm/yarn lockfile, or change the pinned pnpm packageManager version. No dependency approval is required.
-
Full details: Ui Changes Include Windows Proof
-
Explanation
The PR changes visible UI in
apps/desktop-tauri/src/lib/cardCost.ts: pay-as-you-go cards now remain visible when hidden and render spend and balance without a meter. The description includes a UI proof note, but it says only “desktop build” and does not identify a fresh Windows build or include screenshots.Resolution
Add screenshots from the changed UI or update the PR description with a proof note that explicitly states the UI was verified in a fresh Windows build, including the observed pay-as-you-go title, spend, balance, and no progress bar.
-
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
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.
Comment @coderabbitai help to get the list of available commands.
Summary
Soniox is prepaid, but its card showed spend against a limit and dropped the remaining balance. Upstream shows Soniox as a pay-as-you-go card.
CostSnapshot.pay_as_you_goflag (serde(skip)) with a.pay_as_you_go()builder, set in the Soniox result. It reaches the frontend as the bridge fieldpayAsYouGo.cardCost.ts: a pay-as-you-go branch, checked before the limit branch, renders:It stays visible under every cost summary style, including hidden.
PayAsYouGoTitleinlocale.rs, all 10.ftlfiles (translations from upstreammetric_mistral_payg) andcore.ts.UI proof
A desktop build was tested against a local fake Soniox API (
balanceandusage/monthlyboth returned 200), launched in tray-panel proof mode. The card read:There was no progress bar, with cost summary style compact.
Checks
cargo fmt --all -- --check: clean.cargo build --manifest-path rust/Cargo.toml --examples: ok.cargo test --manifest-path rust/Cargo.toml --lib: 5482 passed, 0 failed, 2 ignored.cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml: 832 passed, 0 failed.cargo clippy --all-targets -- -D warningson both manifests: clean.pnpm exec vitest run(apps/desktop-tauri): 168 files, 1667 tests passed. A newcardCost.test.tscase covers the pay-as-you-go card.Notes for reviewers
TypeSafe is pay-as-you-go upstream too, and has the same missing balance line. A separate PR will fix it.
Summary by CodeRabbit