Redesign meal budget calculator for clarity and mobile UX#216
Merged
Conversation
Fix the core semantics of the Budget check card and tighten the mobile
experience:
- Floors vs ceilings: protein and soluble fiber are goals to fill ("to
go" / "goal met", emerald when met); calories, sat fat and sugar are
limits to spend down ("left" / "over", rose when exceeded). Previously
a negative at-rest remaining (e.g. -4g sat fat) rendered in the normal
accent color with a "remaining" label, reading as headroom when the
user was actually over.
- Each stat now shows a thin progress bar: a solid segment for what is
already logged plus a brighter pending segment for the staged food, so
"will this fit" is glanceable per macro.
- Promote the fit verdict to a prominent banner (Lucide check / alert /
ban icons, no emoji per brand guide) instead of trailing footer prose.
- Reformat the "Adds ..." breakdown into wrapping mono chips.
- Replace alert() error popups with an inline rose banner.
- Mobile tap targets: enlarge the search/favorite toggle, the meal-item
edit/delete/clear icon buttons, and the serving input padding.
- Accessibility: aria-labels on the mode toggles, serving qty/unit
inputs, and item-edit input; inputMode="decimal" for numeric keypads.
https://claude.ai/code/session_01QpWKsb6w9WShwviGZ62Mhw
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.
What & why
A full redesign pass on the Budget check card (
NutritionCalculatorCard.tsx), prompted by a mobile screenshot where a user 4g over their saturated-fat budget saw-4grendered in the normal accent color with a "remaining" label — reading as headroom when it was actually an overage.The core fix — floors vs ceilings
Calories, sat fat, and sugar are ceilings (spend down). Protein and soluble fiber are floors (fill up). They were flagged with
isMinTargetbut displayed identically. Now they read differently, even at rest:N leftN over(rose)N to gogoal met(emerald)Over/under is now evaluated on the at-rest remaining value too, not only once a food is staged — fixing the screenshot bug.
Other changes
check/alert-triangle/ban, no emoji per the brand guide) instead of trailing footer prose.alert()popups on log/favorite failures.aria-labels on the mode toggles, serving qty/unit inputs, and item-edit input;inputMode="decimal"for numeric keypads.Checks
pnpm type-check— cleanpnpm lint— 0 errors (pre-existing warnings only; none new in this file)pnpm test— 97/97 passingScoped to a single component; the desktop (
compact={false}) variant uses the same code paths.https://claude.ai/code/session_01QpWKsb6w9WShwviGZ62Mhw
Generated by Claude Code