feat: add CZK to the preferred currency picker - #2886
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 12, 2026, 6:27 AM ET / 10:27 UTC. ClawSweeper reviewWhat this changesThe PR adds Czech koruna (CZK) to the preferred-currency picker, offline rate table, and formatter coverage. Merge readiness⛔ Blocked until real behavior proof is added - 3 items remain The patch correctly follows the established preferred-currency design, but this external UI PR needs after-fix fresh-bundle proof before merge. Priority: P3 Review scores
Verification
How this fits togetherCodexBar converts provider cost estimates to a user-selected display currency. Settings supplies the chosen code, CurrencyExchange obtains a cached live or fallback rate, and UsageFormatter renders the converted amount in menu surfaces. flowchart LR
A[Provider cost estimate] --> B[Preferred currency setting]
B --> C[Currency conversion]
D[Cached live or fallback rates] --> C
C --> E[Cost formatter]
E --> F[Menu and settings display]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the existing list-driven currency design and merge after a redacted fresh-app proof shows both the CZK selection and converted output. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a new picker option rather than a report of broken behavior; the branch's runtime result still needs direct app proof. Is this the best way to solve the issue? Yes: extending the established picker, supported-code list, fallback rates, and formatter checks is the narrowest maintainable implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a90dfed5c264. LabelsLabel changes:
Label 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
|
Summary
Adds
CZK (Kč)to the preferred currency picker in Settings → General, following the exact shape of #2669 (KRW) on top of the list introduced in #2490 (refs #2449). Koruna-billed users currently convert the USD estimates by hand to compare against a card statement.Change
Three lines of source, no new exchange-rate logic:
CurrencyExchange.swift—"CZK"joinssupportedCurrencies, placed with the European currencies (after EUR) rather than appended, matching the existing regional grouping.CurrencyExchange.swift—"CZK": 21.0joins the hardcoded fallback table. Existing fallback values are untouched.PreferencesGeneralPane.swift—PreferredCurrencyOption.czkand its"CZK (Kč)"label.fetchLatestRatesIfNeededalready merges every rate in theopen.er-api.com/v6/latest/USDpayload, and that payload carriesCZK. Listing the code insupportedCurrenciesis what opens therequiresLiveRatesgate, so selecting CZK triggers the same live-fetch and 24h-cache path as the existing currencies; the hardcoded rate is only read before the first successful fetch.No public API surface change:
supportedCurrenciesgains an element, its signature is unchanged.Formatting
CZK is a two-decimal currency and
UsageFormatter.currencyStringpinsLocale(identifier: "en_US"), where ICU has noKčsymbol — amounts render asCZK 210.11. That is consistent with how other non-Latin-symbol currencies degrade under the pinned locale, and host-locale independence is preserved. (TheKčin the picker label is just the label, mirroring how"TWD (NT$)"names its local symbol.)Validation
swift test --filter UsageFormatter— passes, including the new assertionsNew coverage in
UsageFormatterTests.swift, mirroring the KRW assertions:convert(usdAmount:to:))CZKcode is rendered with two fraction digitsrequiresLiveRates("CZK") == true, so the live fetch actually triggers rather than the currency silently sitting on the hardcoded rate🤖 Generated with Claude Code