Skip to content

Redesign meal budget calculator for clarity and mobile UX#216

Merged
d3mocide merged 1 commit into
mainfrom
claude/meal-budget-mobile-ux-trzgux
Jun 16, 2026
Merged

Redesign meal budget calculator for clarity and mobile UX#216
d3mocide merged 1 commit into
mainfrom
claude/meal-budget-mobile-ux-trzgux

Conversation

@d3mocide

Copy link
Copy Markdown
Owner

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 -4g rendered 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 isMinTarget but displayed identically. Now they read differently, even at rest:

Type Within budget Exceeded
Ceiling (cal / sat fat / sugar) N left N over (rose)
Floor (protein / fiber) N to go goal 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

  • Per-macro progress bar: a solid segment for what's already logged plus a brighter pending segment for the staged food, so "will this fit" is glanceable on each stat.
  • Fit verdict promoted to a banner (Lucide check / alert-triangle / ban, no emoji per the brand guide) instead of trailing footer prose.
  • "Adds ..." breakdown reformatted from a run-on sentence into wrapping mono chips (better mobile wrapping).
  • Inline error banner replaces jarring alert() popups on log/favorite failures.
  • Mobile tap targets: enlarged search/favorite toggle, meal-item edit/delete/clear icon buttons, and serving-input padding.
  • Accessibility: aria-labels on the mode toggles, serving qty/unit inputs, and item-edit input; inputMode="decimal" for numeric keypads.

Checks

  • pnpm type-check — clean
  • pnpm lint — 0 errors (pre-existing warnings only; none new in this file)
  • pnpm test — 97/97 passing

Scoped to a single component; the desktop (compact={false}) variant uses the same code paths.

https://claude.ai/code/session_01QpWKsb6w9WShwviGZ62Mhw


Generated by Claude Code

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
@d3mocide d3mocide marked this pull request as ready for review June 16, 2026 12:22
@d3mocide d3mocide merged commit e670456 into main Jun 16, 2026
4 checks passed
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.

2 participants