Skip to content

Surface logged time on meal entries, add fasting-friendly "since last meal" stat#268

Merged
d3mocide merged 2 commits into
mainfrom
claude/meal-log-timestamp-op001j
Jul 19, 2026
Merged

Surface logged time on meal entries, add fasting-friendly "since last meal" stat#268
d3mocide merged 2 commits into
mainfrom
claude/meal-log-timestamp-op001j

Conversation

@d3mocide

Copy link
Copy Markdown
Owner

Summary

  • Each meal log entry (Today's Recent Meals, Nutrition Day view) now shows the actual logged clock time as the primary label instead of it being a secondary detail — the meal-type slot (breakfast/lunch/dinner/snack) remains as smaller secondary context, since it's still real data used elsewhere (log-sheet defaults, edit flow).
  • Added a live "since last meal" duration stat to RecentMealsCard, computed from the most recent meal event's timestamp, for tracking time since you last ate (useful for fasting). It refreshes every 30s and only renders when viewing "today" (gated via a new showTimeSinceLast prop, passed true from the Today page and conditionally from the Nutrition Day page when the selected day is today).
  • Added fmtElapsed to frontend/src/lib/format.ts — like the existing fmtMinutes but omits the hour segment under 60 minutes (so it reads "12m" instead of "0h 12m") for a live elapsed-time display.

No backend changes were needed — MealEvent.ts (the logged timestamp) was already returned by the API and already ordered newest-first.

Test plan

  • pnpm type-check passes
  • pnpm lint passes (pre-existing unrelated warning in IngredientBuilder.tsx)
  • pnpm test passes (130/130)
  • Manually verify in browser: Today page shows "since last meal" ticking up, meal rows show clock time prominently; Nutrition Day view shows the stat only when viewing today, not past days

Generated by Claude Code

claude added 2 commits July 18, 2026 16:01
Each meal log entry now shows its actual logged clock time as the
primary label (with the slot still shown as secondary context), and
Today/Nutrition Day surface a live "since last meal" duration for
fasting tracking, computed from the most recent meal event.
The lock had drifted from pyproject.toml (e.g. pinned fastapi==0.137.1
while pyproject.toml required ==0.139.0), and pip-audit flags a CVE in
the pinned setuptools==82.0.1 (PYSEC-2026-3447). Regenerated via
pip-compile --allow-unsafe --extra=dev --generate-hashes against
pyproject.toml (pip-tools 7.5.3, Python 3.12, matching CI) to bring
setuptools to 83.0.0 and resync all pins with pyproject.toml.

Verified locally with the regenerated lock: hash-verified install,
ruff, mypy, and pip-audit all pass clean. Could not run the full
pytest suite locally (no timescaledb extension available in this
sandbox for the hypertable migrations), so CI is the first full
signal on that step.
@d3mocide
d3mocide marked this pull request as ready for review July 19, 2026 22:59
@d3mocide
d3mocide merged commit da7052f into main Jul 19, 2026
4 checks passed
d3mocide pushed a commit that referenced this pull request Jul 19, 2026
Rebases and combines three stale Dependabot PRs (#265, #266, #267)
onto main after the requirements-dev.lock regen in #268:

- litellm 1.91.0 -> 1.92.0
- uvicorn[standard] 0.50.1 -> 0.51.0
- tzdata 2025.2 -> 2026.3

Regenerated both requirements.lock and requirements-dev.lock via
pip-compile (pip-tools 7.6.0, Python 3.12) to keep locks consistent
with pyproject.toml. Verified locally: hash-verified install, ruff,
mypy, and pip-audit all pass clean.
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