feat: track meals with calorie and protein defaults #4

Open
nelson wants to merge 3 commits from feat/meal-tracking into main
Owner

Summary

  • Log → Meal opens a Saved meals list ("No saved meals yet." when empty), a + New saved meal button, and Log a meal without saving it.
  • Saved meals have their own screen for name, calories and protein per portion, with Save/Cancel, an edit button on each, and delete. Saving one logs nothing.
  • Logging: tap a saved meal, then set portion, date, time and notes, then Log meal. Numbers can be changed for that one meal; the screen says the saved meal keeps its numbers. Logging never creates or changes a saved meal.
  • Data: meal-template (shared saved meal, one set of numbers per portion) and meal-entry (numbers stored as eaten, so changing or deleting a saved meal never rewrites past days). No migration.
  • Overview: a Meals column with one daily-total node per day, a Show/Hide toggle, and a hover panel. Clicking opens the meal day with per-meal Edit and + Add meal.

Verification

  • Backend npm test 11 pass; frontend npm test 10 pass, eslint . clean, vite build ok.
  • Dev server against live DB, nothing written: /api/meals and /api/meal-templates return [], invalid POST rejected with 400. Walked every meal screen (list, new saved meal, one-off, back navigation) on the real empty data; the tap-a-saved-meal and edit-saved-meal paths were checked with one in-page fake saved meal and writes blocked.

Preserved from https://github.com/romaine-life/kill-me/pull/111
Original GitHub author: nelsong6. Created: 2026-09-16T19:07:51Z. Updated: 2026-09-16T22:47:02Z.
GitHub labels: release:minor.
The original description above is unchanged; this native Forgejo pull request retains its exact source branch and head commit.

## Summary - **Log → Meal** opens a **Saved meals** list ("No saved meals yet." when empty), a **+ New saved meal** button, and **Log a meal without saving it**. - **Saved meals** have their own screen for name, calories and protein per portion, with Save/Cancel, an edit button on each, and delete. Saving one logs nothing. - **Logging**: tap a saved meal, then set portion, date, time and notes, then **Log meal**. Numbers can be changed for that one meal; the screen says the saved meal keeps its numbers. Logging never creates or changes a saved meal. - **Data**: `meal-template` (shared saved meal, one set of numbers per portion) and `meal-entry` (numbers stored as eaten, so changing or deleting a saved meal never rewrites past days). No migration. - **Overview**: a Meals column with one daily-total node per day, a Show/Hide toggle, and a hover panel. Clicking opens the meal day with per-meal Edit and + Add meal. ## Verification - Backend `npm test` 11 pass; frontend `npm test` 10 pass, `eslint .` clean, `vite build` ok. - Dev server against live DB, nothing written: `/api/meals` and `/api/meal-templates` return `[]`, invalid POST rejected with 400. Walked every meal screen (list, new saved meal, one-off, back navigation) on the real empty data; the tap-a-saved-meal and edit-saved-meal paths were checked with one in-page fake saved meal and writes blocked. --- Preserved from https://github.com/romaine-life/kill-me/pull/111 Original GitHub author: nelsong6. Created: 2026-09-16T19:07:51Z. Updated: 2026-09-16T22:47:02Z. GitHub labels: release:minor. The original description above is unchanged; this native Forgejo pull request retains its exact source branch and head commit.
Meal defaults hold one set of numbers per portion and log in one tap;
entries store their numbers as eaten so later default changes never
rewrite a past day. Daily totals appear as a Meals column on the
Overview and open a meal day with per-meal edit.
Creating a saved meal was hidden inside logging behind a checkbox whose
label changed meaning, and 'default' was the wrong word for it. Saved
meals now have their own list, '+ New saved meal' screen and edit
button; logging only logs. The example meal name placeholder is gone.
fix: show the pointer cursor on every enabled button
Some checks failed
Auto-merge Dependabot / auto-merge (pull_request) Has been skipped
Docker Build Check / Build app image (pull_request) Failing after 13s
Lint / Removed MSAL surface (pull_request) Successful in 22s
Lint / Semantic release label (pull_request) Failing after 41s
Lint / Trailing Newlines (pull_request) Successful in 12s
Lint / Filename Underscores (pull_request) Successful in 7s
Lint / OpenTofu Format (pull_request) Failing after 10s
Lint / Semantic version rules (pull_request) Successful in 1m26s
Lint / YAML Extensions (pull_request) Successful in 51s
Lint / code-quality (pull_request) Failing after 0s
Lint / Image fingerprint config (pull_request) Failing after 14m5s
c1a04cf1c3
Tailwind 4 resets buttons to the arrow cursor, so Tailwind-styled buttons
like the Log type picker never showed a hand on hover.
Author
Owner

Preserved GitHub comment by nelsong6, created 2026-11-03T18:37:38Z, updated 2026-11-03T18:37:38Z: https://github.com/romaine-life/kill-me/pull/111#issuecomment-6612380999

Moved to native Forgejo pull request #4. The original description and exact source branch/head commit are preserved there. Please continue discussion and changes on Forgejo. https://openproject.romaine.life/wp/FORGEJO-3

Preserved GitHub comment by nelsong6, created 2026-11-03T18:37:38Z, updated 2026-11-03T18:37:38Z: https://github.com/romaine-life/kill-me/pull/111#issuecomment-6612380999 Moved to native Forgejo pull request https://forgejo.romaine.life/romaine-life/kill-me/pulls/4. The original description and exact source branch/head commit are preserved there. Please continue discussion and changes on Forgejo. https://openproject.romaine.life/wp/FORGEJO-3
Some checks are pending
Auto-merge Dependabot / auto-merge (pull_request) Has been skipped
Docker Build Check / Build app image (pull_request) Failing after 13s
Lint / Removed MSAL surface (pull_request) Successful in 22s
Lint / Semantic release label (pull_request) Failing after 41s
Lint / Trailing Newlines (pull_request) Successful in 12s
Lint / Filename Underscores (pull_request) Successful in 7s
Lint / OpenTofu Format (pull_request) Failing after 10s
Lint / Semantic version rules (pull_request) Successful in 1m26s
Lint / YAML Extensions (pull_request) Successful in 51s
Lint / code-quality (pull_request) Failing after 0s
Lint / Image fingerprint config (pull_request) Failing after 14m5s
Suite default / * (pull_request)
Required
Suite cluster-service / * (pull_request)
Required
Suite tofu / * (pull_request)
Required
Suite web-app / * (pull_request)
Required
This pull request has changes conflicting with the target branch.
  • frontend/src/components/SorenessLanes.jsx
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'feat/meal-tracking:feat/meal-tracking'
git switch 'feat/meal-tracking'
Sign in to join this conversation.
No description provided.