Skip to content

fix(menubar): cost budget stays USD; flag empty custom budget#508

Merged
iamtoruk merged 1 commit into
mainfrom
fix/menubar-budget-currency-and-cue
Jun 18, 2026
Merged

fix(menubar): cost budget stays USD; flag empty custom budget#508
iamtoruk merged 1 commit into
mainfrom
fix/menubar-budget-currency-and-cue

Conversation

@iamtoruk

Copy link
Copy Markdown
Member

Two small follow-ups from the multi-agent validation of the daily-budget work (#505/#506).

1. Currency consistency

The daily cost budget is defined in USD (presets are $25…$500, the custom field shows $), but the "exceeded" banner ran the value through the display-currency rate (asCurrency()), so a non-USD user saw the field and banner disagree, e.g. field "$100" but banner "€92" for the same threshold. This was pre-existing (the asCurrency() label predates #505), surfaced more by the custom field.

Fix: render the budget label in USD via a new asUSD() helper (no FX conversion), so the picker, the field, and the banner all agree. The over-budget comparison was already USD-vs-USD (current.cost vs dailyBudget) and is unchanged. Full display-currency budgets would mean converting presets (ugly, non-round), so the budget stays USD-denominated.

2. Empty custom cue

Selecting "Custom…" and leaving the field blank stores 0, which silently disables the alert while the picker still shows "Custom…". The help text now reads "Enter an amount above, or the alert stays off." in that state, so it doesn't look armed when it isn't.

Verification

  • swift build passes.
  • macOS app (not covered by the JS suite). Runtime check: in a non-USD currency, set a $ budget and confirm field/banner match; select Custom with an empty field and confirm the hint shows and no flame fires.

Two follow-ups from the budget review:

- Currency consistency: the daily cost budget is defined in USD (the presets and
  the custom field are labeled "$"), but the "exceeded" banner ran the value
  through the display-currency rate, so a non-USD user saw the field and banner
  disagree (e.g. field "$100", banner "EUR 92"). Render the budget label in USD
  via a new asUSD() helper so the picker, field, and banner all agree. The
  over-budget comparison was already USD vs USD and is unchanged.

- Empty custom cue: selecting "Custom..." and leaving the field blank stores 0,
  which silently disables the alert while the picker still shows "Custom...".
  The help text now says "Enter an amount above, or the alert stays off." in
  that state so it does not look armed when it isn't.
@iamtoruk iamtoruk merged commit dbe4e94 into main Jun 18, 2026
3 checks passed
@iamtoruk iamtoruk deleted the fix/menubar-budget-currency-and-cue branch June 18, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant