fix(menubar): cost budget stays USD; flag empty custom budget#508
Merged
Conversation
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.
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.
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 (theasCurrency()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.costvsdailyBudget) 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 buildpasses.