Support OpenCost currency detection and overrides - #1472
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 740d267. Configure here.
| onChange={onChange} | ||
| ariaLabel="Currency override" | ||
| searchPlaceholder="Search currencies by name or code" | ||
| className="w-full" |
There was a problem hiding this comment.
Escape closes Settings over menu
Medium Severity
Opening the currency SelectMenu inside Settings and pressing Escape dismisses the whole Settings dialog (or the unsaved-changes confirm) instead of closing the dropdown. Settings listens for Escape in the capture phase and stops propagation, so the menu never gets a chance to handle it.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 740d267. Configure here.
| label: name && name !== code ? `${name} (${code})` : code, | ||
| } | ||
| }) | ||
| .sort((a, b) => a.label.localeCompare(b.label, 'en')), |
There was a problem hiding this comment.
Non-monetary codes selectable
Medium Severity
CURRENCY_OPTIONS is built from Intl.supportedValuesOf('currency') with no filter, so non-monetary codes such as XXX and XTS appear in the Settings picker. Saving those values fails because NormalizeOpenCostCurrency rejects them.
Reviewed by Cursor Bugbot for commit 740d267. Configure here.


Summary
OpenCost reports numeric costs without a dependable currency label on its normal allocation and asset responses. This PR gives Radar a trustworthy currency contract without pretending to perform conversion:
Closes #1355 and #1470.
What changed
Resolution and API contract
Configuration
--opencost-currency, desktop, and Helmcost.currencysupport.Presentation
Intl.NumberFormat, including zero-decimal currencies such as JPY, and no longer renders malformed runtime codes as dollars.Testing
make testnpm --prefix web test— 54 files, 470 testsnpm --prefix packages/k8s-ui test— 145 files, 2,555 passed, 1 skippedmake tscmake build./scripts/test-chart.shNotes
Currency detection is intentionally conservative. It reads only explicit or official OpenCost custom-pricing ConfigMaps referenced by active workloads; it does not infer from arbitrary namespace data. Conflicting active configuration falls back to USD. Radar labels values but never converts them.