Show a meal's grams in the history list

Same pattern as weigh-ins: "80 g · note" or just "80 g" when there's
no note.
This commit is contained in:
Alexander Heldt
2026-07-15 12:47:39 +00:00
parent 6d54ecf238
commit 3e3eee678e
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -803,6 +803,9 @@
const noteEl = li.querySelector(".note"); const noteEl = li.querySelector(".note");
if (ev.type === "weight" && Number.isFinite(ev.weight)) { if (ev.type === "weight" && Number.isFinite(ev.weight)) {
noteEl.textContent = ev.note ? `${formatWeight(ev.weight)} · ${ev.note}` : formatWeight(ev.weight); noteEl.textContent = ev.note ? `${formatWeight(ev.weight)} · ${ev.note}` : formatWeight(ev.weight);
} else if (ev.type === "eat" && Number.isFinite(ev.grams) && ev.grams > 0) {
const g = `${Math.round(ev.grams)} g`;
noteEl.textContent = ev.note ? `${g} · ${ev.note}` : g;
} else { } else {
noteEl.textContent = ev.note || ""; noteEl.textContent = ev.note || "";
} }
+1
View File
@@ -1,4 +1,5 @@
[ [
{ "date": "2026-07-15", "text": "Meals with an amount logged show their grams in the day's history" },
{ "date": "2026-07-15", "text": "Every 1-hour gridline on the sleep charts now shows its hour mark" }, { "date": "2026-07-15", "text": "Every 1-hour gridline on the sleep charts now shows its hour mark" },
{ "date": "2026-07-15", "text": "The Sleep chart in the last-N-days card now has 1-hour gridlines too" }, { "date": "2026-07-15", "text": "The Sleep chart in the last-N-days card now has 1-hour gridlines too" },
{ "date": "2026-07-15", "text": "The Sleep trend chart is taller with 1-hour gridlines, so nearby lines are easier to tell apart" }, { "date": "2026-07-15", "text": "The Sleep trend chart is taller with 1-hour gridlines, so nearby lines are easier to tell apart" },