Skip to content

Tell users when their calorie goal is raised to the safety minimum - #15

Merged
YarinQuapi merged 1 commit into
masterfrom
fix-calorie-goal-not-saving
Nov 19, 2026
Merged

YarinQuapi merged 1 commit into
masterfrom
fix-calorie-goal-not-saving

Conversation

@YarinQuapi

Copy link
Copy Markdown
Owner

What changed

  • PUT /api/profile now returns floorKcal and goalClamped.
  • Web and mobile show "That goal is below your minimum, so it was raised to X kcal" (English and Hebrew). Web stays on the form so the raised value is visible.

Why

A goal below the safety minimum (resting metabolism, or 1,200/1,500 kcal) was silently raised, and stored as auto when it equalled the suggestion. The settings field looked like it reverted to its old value.

Reviewer notes

  • API tests (56), API and web typechecks pass; not exercised in a browser or simulator.
  • On mobile, the reload after saving may clear the message; a snackbar may be needed.
  • The form computes the minimum from the typed weight while the server uses the last weigh-in before this month, so the number can differ. Left unchanged.

🤖 Generated with Claude Code

Goals below the minimum were silently raised (and stored as auto when equal
to the suggestion), so the settings field appeared to revert. The API now
returns floorKcal and goalClamped, and web and mobile show a message.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@YarinQuapi
YarinQuapi merged commit cf96f2b into master Nov 19, 2026
2 of 3 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.

1 participant