Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c9ea45410 | ||
|
|
3584758b86 | ||
|
|
18d3778241 |
No files matched your search
@@ -122,4 +122,46 @@ suite("the palette wraps rather than running out");
|
|||||||
"…and the palette wraps, so two share rather than one having none");
|
"…and the palette wraps, so two share rather than one having none");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------- the day's split in the overview
|
||||||
|
// The Meals tile keeps the day's total; this is the breakdown under it. The
|
||||||
|
// case that matters is the one where it must not appear at all.
|
||||||
|
{
|
||||||
|
let kinds = [];
|
||||||
|
let el = { hidden: false, textContent: "" };
|
||||||
|
const view = load({
|
||||||
|
names: ["NO_KIND", "renderDayFoodKinds"],
|
||||||
|
stubs: {
|
||||||
|
document: { getElementById: () => el },
|
||||||
|
liveFoodKinds: () => kinds,
|
||||||
|
foodKindNames: () => new Map(kinds.map(k => [k.id, k.name])),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const meal = (grams, foodKindId = "") => ({ type: "eat", grams, foodKindId });
|
||||||
|
const show = (evs) => { el = { hidden: false, textContent: "" }; view.renderDayFoodKinds(evs); return el; };
|
||||||
|
|
||||||
|
suite("the day's food split");
|
||||||
|
{
|
||||||
|
kinds = [];
|
||||||
|
eq(show([meal(180), meal(120)]).hidden, true,
|
||||||
|
"meals with no kind show no breakdown — the tile's total already says it");
|
||||||
|
eq(show([]).hidden, true, "a day with no meals shows nothing");
|
||||||
|
|
||||||
|
kinds = [{ id: "d", name: "Dry" }, { id: "f", name: "Fresh" }];
|
||||||
|
const both = show([meal(200, "d"), meal(100, "f"), meal(60, "d")]);
|
||||||
|
eq(both.hidden, false, "once a meal carries a kind, the breakdown appears");
|
||||||
|
eq(both.textContent, "Dry 260 g · Fresh 100 g", "…summed per kind, in the chart's order");
|
||||||
|
|
||||||
|
eq(show([meal(200, "d"), meal(50)]).textContent, "Dry 200 g · No kind 50 g",
|
||||||
|
"unlabelled food on a day that has kinds is named, not dropped");
|
||||||
|
|
||||||
|
kinds = [];
|
||||||
|
eq(show([meal(90, "gone")]).textContent, "Deleted kind 90 g",
|
||||||
|
"a kind deleted since still labels its food rather than vanishing");
|
||||||
|
|
||||||
|
kinds = [{ id: "d", name: "Dry" }];
|
||||||
|
eq(show([meal(0, "d"), meal(120, "d")]).textContent, "Dry 120 g",
|
||||||
|
"a meal logged without an amount adds nothing to the split");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default report("food-kinds");
|
export default report("food-kinds");
|
||||||
+88
-2
@@ -147,6 +147,7 @@ suite("what the sentence is allowed to say");
|
|||||||
"foodTrendMoves", "foodSeriesSentences", "foodSeriesFor"],
|
"foodTrendMoves", "foodSeriesSentences", "foodSeriesFor"],
|
||||||
stubs: {
|
stubs: {
|
||||||
liveFoodKinds: () => kinds,
|
liveFoodKinds: () => kinds,
|
||||||
|
loadFoodKinds: () => kinds,
|
||||||
foodKindNames: () => new Map(kinds.map(k => [k.id, k.name])),
|
foodKindNames: () => new Map(kinds.map(k => [k.id, k.name])),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -203,12 +204,16 @@ suite("what the sentence is allowed to say");
|
|||||||
names: ["NO_KIND", "FOOD_COLORS", "foodTrend", "foodSeriesFor"],
|
names: ["NO_KIND", "FOOD_COLORS", "foodTrend", "foodSeriesFor"],
|
||||||
stubs: {
|
stubs: {
|
||||||
liveFoodKinds: () => [],
|
liveFoodKinds: () => [],
|
||||||
foodKindNames: () => new Map([["gone", "Old recipe"]]),
|
// The tombstone: gone from the picker, still carrying name and colour.
|
||||||
|
loadFoodKinds: () => [{ id: "gone", name: "Old recipe", colorIndex: 2, deleted: true }],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const days = byKind([{ gone: 100 }, { gone: 110 }, { gone: 120 }, { gone: 130 }, { gone: 0 }]);
|
const days = byKind([{ gone: 100 }, { gone: 110 }, { gone: 120 }, { gone: 130 }, { gone: 0 }]);
|
||||||
eq(namesOnly.foodSeriesFor(days).map(s => s.name), ["Old recipe"],
|
const series = namesOnly.foodSeriesFor(days);
|
||||||
|
eq(series.map(s => s.name), ["Old recipe"],
|
||||||
"it keeps its name rather than vanishing or reading as 'No kind'");
|
"it keeps its name rather than vanishing or reading as 'No kind'");
|
||||||
|
eq(series[0].colorIndex, 2,
|
||||||
|
"…and its colour, which grey would confuse with the 'No kind' series");
|
||||||
}
|
}
|
||||||
|
|
||||||
suite("the caption stays bounded as kinds are added");
|
suite("the caption stays bounded as kinds are added");
|
||||||
@@ -246,4 +251,85 @@ suite("what the sentence is allowed to say");
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------- the highlighted day's readout
|
||||||
|
// Tapping a bar selects that day; this is what the selection says. It reads off
|
||||||
|
// the existing selection rather than keeping its own, so the two cannot drift.
|
||||||
|
{
|
||||||
|
let kinds = [];
|
||||||
|
let selected = "2026-09-20";
|
||||||
|
let el = { hidden: false, textContent: "" };
|
||||||
|
const info = load({
|
||||||
|
names: ["NO_KIND", "FOOD_COLORS", "foodTrend", "foodSeriesFor", "renderFoodDayInfo"],
|
||||||
|
stubs: {
|
||||||
|
document: { getElementById: () => el },
|
||||||
|
selectedDay: () => new Date(selected + "T12:00:00"),
|
||||||
|
ymd: (d) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`,
|
||||||
|
liveFoodKinds: () => kinds,
|
||||||
|
loadFoodKinds: () => kinds,
|
||||||
|
foodKindNames: () => new Map(kinds.map(k => [k.id, k.name])),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const day = (n, byKind, excluded = false) => ({
|
||||||
|
ymd: `2026-09-${String(n).padStart(2, "0")}`,
|
||||||
|
date: new Date(2026, 8, n),
|
||||||
|
grams: Object.values(byKind).reduce((s, v) => s + v, 0),
|
||||||
|
gramsByKind: byKind, excluded, meals: 0, mealsMissingGrams: 0,
|
||||||
|
});
|
||||||
|
const read = (days) => {
|
||||||
|
el = { hidden: false, textContent: "" };
|
||||||
|
info.renderFoodDayInfo(days, info.foodSeriesFor(days));
|
||||||
|
return el;
|
||||||
|
};
|
||||||
|
|
||||||
|
suite("the highlighted day's breakdown");
|
||||||
|
{
|
||||||
|
kinds = [{ id: "d", name: "Dry", colorIndex: 0 }, { id: "f", name: "Fresh", colorIndex: 1 }];
|
||||||
|
const days = [
|
||||||
|
day(18, { d: 200, f: 100 }), day(19, { d: 210, f: 90 }), day(20, { d: 260, f: 100 }),
|
||||||
|
];
|
||||||
|
selected = "2026-09-20";
|
||||||
|
const r = read(days);
|
||||||
|
eq(r.hidden, false, "the selected day gets a readout");
|
||||||
|
ok(/Dry 260 g · Fresh 100 g/.test(r.textContent), "each kind's amount, in the stack's order");
|
||||||
|
ok(/360 g in total/.test(r.textContent), "…and the total, so you needn't add them up");
|
||||||
|
ok(/Sep 20/.test(r.textContent), "…named, so it is clear which bar it belongs to");
|
||||||
|
|
||||||
|
selected = "2026-09-18";
|
||||||
|
ok(/Dry 200 g/.test(read(days).textContent), "selecting another bar moves the readout");
|
||||||
|
|
||||||
|
// Out of the window entirely: the chart is not showing that day at all.
|
||||||
|
selected = "2026-08-01";
|
||||||
|
eq(read(days).hidden, true, "a day outside the window has no bar and so no readout");
|
||||||
|
}
|
||||||
|
|
||||||
|
suite("the days that say something else");
|
||||||
|
{
|
||||||
|
kinds = [{ id: "d", name: "Dry", colorIndex: 0 }, { id: "f", name: "Fresh", colorIndex: 1 }];
|
||||||
|
selected = "2026-09-20";
|
||||||
|
const withEmpty = [day(18, { d: 200, f: 100 }), day(19, { d: 210 }), day(20, {})];
|
||||||
|
ok(/no food logged/.test(read(withEmpty).textContent), "a day with no food says so");
|
||||||
|
|
||||||
|
const withExcluded = [day(18, { d: 200, f: 100 }), day(19, { d: 210 }), day(20, {}, true)];
|
||||||
|
ok(/not counted/.test(read(withExcluded).textContent),
|
||||||
|
"a day marked not counted says that instead of reading as empty");
|
||||||
|
}
|
||||||
|
|
||||||
|
suite("an unsplit chart gets the day total too");
|
||||||
|
{
|
||||||
|
// No kinds defined: there is still no hover on a phone, so the figure was
|
||||||
|
// only readable by eye off the axis.
|
||||||
|
kinds = [];
|
||||||
|
selected = "2026-09-20";
|
||||||
|
const days = [day(18, { "": 300 }), day(19, { "": 320 }), day(20, { "": 340 })];
|
||||||
|
const r = read(days);
|
||||||
|
eq(r.hidden, false, "the readout appears without any kinds defined");
|
||||||
|
eq(r.textContent, "Sun, Sep 20 — 340 g.", "…as the plain total, named by day");
|
||||||
|
ok(!/No kind/.test(r.textContent),
|
||||||
|
"…without inventing a kind name for food that has none");
|
||||||
|
ok(!/in total/.test(r.textContent),
|
||||||
|
"…and without saying the same number twice");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default report("food-trend");
|
export default report("food-trend");
|
||||||
+89
-3
@@ -447,6 +447,42 @@
|
|||||||
return new Map(loadExercises().map(x => [x.id, x.name]));
|
return new Map(loadExercises().map(x => [x.id, x.name]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The day's food, split the way the chart splits the window. The Meals tile
|
||||||
|
// keeps the total — that is the headline figure, and the breakdown will not
|
||||||
|
// fit in a 90px tile — so this sits under the grid instead.
|
||||||
|
//
|
||||||
|
// Only shown when a meal that day actually carries a kind: an account not
|
||||||
|
// using kinds should see the overview it has always seen, and a day whose
|
||||||
|
// meals all predate kinds is exactly that case.
|
||||||
|
function renderDayFoodKinds(dayEvents) {
|
||||||
|
const el = document.getElementById("stat-food-kinds");
|
||||||
|
if (!el) return;
|
||||||
|
const names = foodKindNames();
|
||||||
|
const order = liveFoodKinds().map(k => k.id);
|
||||||
|
const totals = new Map();
|
||||||
|
let anyKind = false;
|
||||||
|
for (const e of dayEvents) {
|
||||||
|
if (e.type !== "eat" || !(Number.isFinite(e.grams) && e.grams > 0)) continue;
|
||||||
|
const id = e.foodKindId || NO_KIND;
|
||||||
|
if (id !== NO_KIND) anyKind = true;
|
||||||
|
totals.set(id, (totals.get(id) || 0) + e.grams);
|
||||||
|
}
|
||||||
|
if (!anyKind) { el.hidden = true; return; }
|
||||||
|
|
||||||
|
// Same order as the chart's layers, with "No kind" last, so the two read
|
||||||
|
// as the same breakdown rather than two arbitrary lists.
|
||||||
|
const ids = [...totals.keys()].sort((a, b) => {
|
||||||
|
if (a === NO_KIND) return 1;
|
||||||
|
if (b === NO_KIND) return -1;
|
||||||
|
const ia = order.indexOf(a), ib = order.indexOf(b);
|
||||||
|
return (ia === -1 ? Infinity : ia) - (ib === -1 ? Infinity : ib);
|
||||||
|
});
|
||||||
|
el.textContent = ids
|
||||||
|
.map(id => `${id === NO_KIND ? "No kind" : (names.get(id) || "Deleted kind")} ${Math.round(totals.get(id))} g`)
|
||||||
|
.join(" · ");
|
||||||
|
el.hidden = false;
|
||||||
|
}
|
||||||
|
|
||||||
// The chips both dialogs use. Built from the live kinds plus "No kind",
|
// The chips both dialogs use. Built from the live kinds plus "No kind",
|
||||||
// which always comes last and is always offered — a meal is allowed to have
|
// which always comes last and is always offered — a meal is allowed to have
|
||||||
// no kind, permanently, and the picker should never imply otherwise.
|
// no kind, permanently, and the picker should never imply otherwise.
|
||||||
@@ -898,6 +934,7 @@
|
|||||||
const gramsEl = document.getElementById("stat-meals-grams");
|
const gramsEl = document.getElementById("stat-meals-grams");
|
||||||
gramsEl.textContent = gramsTotal > 0 ? `${Math.round(gramsTotal)} g` : "";
|
gramsEl.textContent = gramsTotal > 0 ? `${Math.round(gramsTotal)} g` : "";
|
||||||
gramsEl.hidden = !(gramsTotal > 0);
|
gramsEl.hidden = !(gramsTotal > 0);
|
||||||
|
renderDayFoodKinds(dayEvents);
|
||||||
// Walk time is a duration, not a count, so the tile leads with it and puts
|
// Walk time is a duration, not a count, so the tile leads with it and puts
|
||||||
// "N walks" underneath — the day's exercise at a glance.
|
// "N walks" underneath — the day's exercise at a glance.
|
||||||
document.getElementById("stat-walk").textContent = formatDuration(walkMsInRange(events, from, to));
|
document.getElementById("stat-walk").textContent = formatDuration(walkMsInRange(events, from, to));
|
||||||
@@ -2019,6 +2056,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderFoodLegend(series);
|
renderFoodLegend(series);
|
||||||
|
renderFoodDayInfo(days, series);
|
||||||
renderFoodTrendNote(days, series);
|
renderFoodTrendNote(days, series);
|
||||||
|
|
||||||
setChartSVG(svg, parts);
|
setChartSVG(svg, parts);
|
||||||
@@ -2031,7 +2069,9 @@
|
|||||||
// With no kinds defined this returns a single unnamed series, which is what
|
// With no kinds defined this returns a single unnamed series, which is what
|
||||||
// makes the whole feature invisible to anyone not using it.
|
// makes the whole feature invisible to anyone not using it.
|
||||||
function foodSeriesFor(days) {
|
function foodSeriesFor(days) {
|
||||||
const names = foodKindNames();
|
// Every kind ever, tombstones included — a deleted one keeps both its name
|
||||||
|
// and its colour, which is what lets its food stay identifiable below.
|
||||||
|
const all = new Map(loadFoodKinds().map(k => [k.id, k]));
|
||||||
const used = (id) => days.some(d => (d.gramsByKind?.[id] || 0) > 0);
|
const used = (id) => days.some(d => (d.gramsByKind?.[id] || 0) > 0);
|
||||||
const out = [];
|
const out = [];
|
||||||
for (const k of liveFoodKinds()) {
|
for (const k of liveFoodKinds()) {
|
||||||
@@ -2042,13 +2082,19 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Kinds deleted since, but still on meals in this window: their food is
|
// Kinds deleted since, but still on meals in this window: their food is
|
||||||
// real and has to appear somewhere, under the name the tombstone kept.
|
// real and has to appear somewhere, under the name and colour the tombstone
|
||||||
|
// kept. Falling back to grey here would be wrong twice over — it is also
|
||||||
|
// "No kind"'s colour, so the two series would be indistinguishable in both
|
||||||
|
// the stack and the legend.
|
||||||
for (const d of days) {
|
for (const d of days) {
|
||||||
for (const id of Object.keys(d.gramsByKind || {})) {
|
for (const id of Object.keys(d.gramsByKind || {})) {
|
||||||
if (id === NO_KIND || out.some(s => s.id === id)) continue;
|
if (id === NO_KIND || out.some(s => s.id === id)) continue;
|
||||||
if (!used(id)) continue;
|
if (!used(id)) continue;
|
||||||
|
const gone = all.get(id);
|
||||||
out.push({
|
out.push({
|
||||||
id, name: names.get(id) || "Deleted kind", colorIndex: null,
|
id,
|
||||||
|
name: gone?.name || "Deleted kind",
|
||||||
|
colorIndex: gone ? (gone.colorIndex ?? 0) : null,
|
||||||
of: (dd) => dd.gramsByKind?.[id] || 0,
|
of: (dd) => dd.gramsByKind?.[id] || 0,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -2063,6 +2109,46 @@
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// What the highlighted bar holds, in words. Tapping a bar selects that day
|
||||||
|
// — the behaviour every chart already has — so this reads off the selection
|
||||||
|
// rather than keeping a second one of its own, which would then have to be
|
||||||
|
// kept in step with it.
|
||||||
|
//
|
||||||
|
// Shown whether or not the bars are split. A phone has nothing to hover, so
|
||||||
|
// the bar's tooltip is unreachable and the day's figure was otherwise only
|
||||||
|
// readable by eye off the axis — that is as true of one bar as of a stack.
|
||||||
|
function renderFoodDayInfo(days, series) {
|
||||||
|
const el = document.getElementById("grams-day-info");
|
||||||
|
if (!el) return;
|
||||||
|
const day = days.find(d => d.ymd === ymd(selectedDay()));
|
||||||
|
if (!day) { el.hidden = true; return; } // not a day this window draws
|
||||||
|
|
||||||
|
const date = day.date.toLocaleDateString(undefined, { weekday: "short", month: "short", day: "numeric" });
|
||||||
|
el.hidden = false;
|
||||||
|
if (day.excluded) {
|
||||||
|
el.textContent = `${date} — not counted.`;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Series order, so this reads as the stack above it read bottom to top.
|
||||||
|
const parts = series
|
||||||
|
.map(s => ({ name: s.name, g: s.of(day) }))
|
||||||
|
.filter(p => p.g > 0)
|
||||||
|
.map(p => `${p.name} ${Math.round(p.g)} g`);
|
||||||
|
const total = `${Math.round(day.grams)} g`;
|
||||||
|
|
||||||
|
if (parts.length === 0) {
|
||||||
|
el.textContent = `${date} — no food logged.`;
|
||||||
|
} else if (series.length <= 1) {
|
||||||
|
// Unsplit: the one part *is* the total, and naming it twice — "No kind
|
||||||
|
// 340 g · 340 g in total" — would be daft.
|
||||||
|
el.textContent = `${date} — ${total}.`;
|
||||||
|
} else {
|
||||||
|
// The total is worth repeating beside the parts: it is what the bar's
|
||||||
|
// height shows, and it saves adding them up.
|
||||||
|
el.textContent = `${date} — ${parts.join(" · ")} · ${total} in total.`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function renderFoodLegend(series) {
|
function renderFoodLegend(series) {
|
||||||
const el = document.getElementById("grams-legend");
|
const el = document.getElementById("grams-legend");
|
||||||
if (!el) return;
|
if (!el) return;
|
||||||
|
|||||||
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
[
|
[
|
||||||
{ "date": "2026-09-22", "text": "Meals can be labelled with a kind of food. Make up your own in Settings → Food kinds — dry, fresh, raw, whatever you feed — and pick one when you log a meal; tap the ★ beside one to have it chosen for you automatically. You can also invent a kind from inside the log dialog if you realise you need it mid-meal. All of it is optional: “No kind” is always offered, every meal you have already logged keeps working untouched, and with no kinds defined the app looks and behaves exactly as it did. Once you are using them, the Food (grams) chart splits each day's bar by kind with a legend, and draws a separate trend line for each, so you can see fresh creeping up while dry comes down. The sentence underneath names only the kinds that are actually moving and folds the rest into one clause, so it stays short however many kinds you have. Renaming a kind updates the meals logged as it; deleting one keeps them readable under the name it had. A guest can label a meal with a kind you have created but cannot add, rename or delete them" },
|
{ "date": "2026-09-22", "text": "Tap a bar in the Food (grams) chart and a line under it spells that day out — “Sat, Sep 20 — 340 g”, or “Dry 260 g · Fresh 100 g · 360 g in total” once you are using kinds. A phone has nothing to hover over, so the amount for a given day was previously only readable by eye off the axis. It follows whichever day is highlighted, so the ← → arrows and the date picker move it too, and it says so plainly when a day has no food logged or is marked as not counted" },
|
||||||
|
{ "date": "2026-09-22", "text": "Meals can be labelled with a kind of food. Make up your own in Settings → Food kinds — dry, fresh, raw, whatever you feed — and pick one when you log a meal; tap the ★ beside one to have it chosen for you automatically. You can also invent a kind from inside the log dialog if you realise you need it mid-meal. All of it is optional: “No kind” is always offered, every meal you have already logged keeps working untouched, and with no kinds defined the app looks and behaves exactly as it did. Once you are using them, today's overview shows the day's food broken down — “Dry 260 g · Fresh 100 g” — under the stat tiles, and the Food (grams) chart splits each day's bar by kind with a legend, and draws a separate trend line for each, so you can see fresh creeping up while dry comes down. The sentence underneath names only the kinds that are actually moving and folds the rest into one clause, so it stays short however many kinds you have. Renaming a kind updates the meals logged as it; deleting one keeps them readable under the name it had. A guest can label a meal with a kind you have created but cannot add, rename or delete them" },
|
||||||
{ "date": "2026-09-21", "text": "Fixed the figures under the Food (grams) chart contradicting each other. It read like “down about 329 g a week — roughly 460 g a day then, 320 g a day now”, where subtracting the two amounts gives 140 g, not 329 g. The rate was worked out per week while the line itself only covers the complete days in the window — at most five of them on a 7-day window, since today isn't finished — so it was stretched past the days it was measured from. It now gives the change between the two ends, which is a figure you can check by subtracting them: “down about 140 g — from roughly 460 g a day to 320 g”" },
|
{ "date": "2026-09-21", "text": "Fixed the figures under the Food (grams) chart contradicting each other. It read like “down about 329 g a week — roughly 460 g a day then, 320 g a day now”, where subtracting the two amounts gives 140 g, not 329 g. The rate was worked out per week while the line itself only covers the complete days in the window — at most five of them on a 7-day window, since today isn't finished — so it was stretched past the days it was measured from. It now gives the change between the two ends, which is a figure you can check by subtracting them: “down about 140 g — from roughly 460 g a day to 320 g”" },
|
||||||
{ "date": "2026-09-21", "text": "You can measure the time between two events. Press and hold one row, press and hold another, and a bar along the bottom shows the gap — “3h 42m · Ate 12:10 → Poo 15:52” — which answers things like how long after a meal he needs to go out. It stays there until you clear it with the ✕, so you can change day in between and pick the second event from another day; when the pair straddles midnight the bar shows the dates too. It works on any row that is a single moment: the history log, the notes log and weigh-ins. Holding a row you already picked unpicks it, and a third pick is ignored until you clear. Tapping a row still opens it for editing as before. One cost: because holding a row now means something, you can no longer select the text of a note to copy it" },
|
{ "date": "2026-09-21", "text": "You can measure the time between two events. Press and hold one row, press and hold another, and a bar along the bottom shows the gap — “3h 42m · Ate 12:10 → Poo 15:52” — which answers things like how long after a meal he needs to go out. It stays there until you clear it with the ✕, so you can change day in between and pick the second event from another day; when the pair straddles midnight the bar shows the dates too. It works on any row that is a single moment: the history log, the notes log and weigh-ins. Holding a row you already picked unpicks it, and a third pick is ignored until you clear. Tapping a row still opens it for editing as before. One cost: because holding a row now means something, you can no longer select the text of a note to copy it" },
|
||||||
{ "date": "2026-09-21", "text": "A day marked “not counted” no longer appears in the Sleep trend or the Walk trend. It was already left out of the average and out of the “yesterday” comparison, but the day you were actually looking at was still drawn as the boldest line on the chart — so the one day you had said not to trust was the one the panel led with. Now it is left off and its legend chip goes with it, leaving the average and yesterday, which is what you would want to see on a day like that" },
|
{ "date": "2026-09-21", "text": "A day marked “not counted” no longer appears in the Sleep trend or the Walk trend. It was already left out of the average and out of the “yesterday” comparison, but the day you were actually looking at was still drawn as the boldest line on the chart — so the one day you had said not to trust was the one the panel led with. Now it is left off and its legend chip goes with it, leaving the average and yesterday, which is what you would want to see on a day like that" },
|
||||||
|
|||||||
@@ -265,6 +265,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- The day's food broken down by kind. Its own line rather than
|
||||||
|
inside the Meals tile: that tile is about 90px wide, and a
|
||||||
|
breakdown of two or three kinds will not sit in it. Hidden unless
|
||||||
|
a meal that day actually carries a kind. -->
|
||||||
|
<p id="stat-food-kinds" class="muted-note food-kind-split" hidden></p>
|
||||||
|
|
||||||
<div class="lasts">
|
<div class="lasts">
|
||||||
<div class="last-row"><span>Last pee</span><span id="last-pee">—</span></div>
|
<div class="last-row"><span>Last pee</span><span id="last-pee">—</span></div>
|
||||||
<div class="last-row"><span>Last poo</span><span id="last-poo">—</span></div>
|
<div class="last-row"><span>Last poo</span><span id="last-poo">—</span></div>
|
||||||
@@ -399,6 +405,11 @@
|
|||||||
<div class="chart-title">Food (grams)</div>
|
<div class="chart-title">Food (grams)</div>
|
||||||
<svg id="chart-grams" class="chart-svg" viewBox="0 0 320 160" role="img" aria-label="Grams of food eaten per day, split by kind, with a trend line through each"></svg>
|
<svg id="chart-grams" class="chart-svg" viewBox="0 0 320 160" role="img" aria-label="Grams of food eaten per day, split by kind, with a trend line through each"></svg>
|
||||||
<div id="grams-legend" class="legend" hidden></div>
|
<div id="grams-legend" class="legend" hidden></div>
|
||||||
|
<!-- The highlighted day, broken down. Tapping a bar selects that
|
||||||
|
day (as it does on every chart), so this is what the selection
|
||||||
|
amounts to here — there is no hover on a phone, and the bar's
|
||||||
|
tooltip is unreachable. -->
|
||||||
|
<p id="grams-day-info" class="muted-note food-day-info" aria-live="polite" hidden></p>
|
||||||
<!-- What the trend line says, and when it is not saying anything —
|
<!-- What the trend line says, and when it is not saying anything —
|
||||||
see renderFoodTrendNote. -->
|
see renderFoodTrendNote. -->
|
||||||
<p id="grams-note" class="muted-note" hidden></p>
|
<p id="grams-note" class="muted-note" hidden></p>
|
||||||
|
|||||||
@@ -1110,10 +1110,17 @@ button.linklike:hover { text-decoration: underline; filter: none; }
|
|||||||
}
|
}
|
||||||
|
|
||||||
.excluded-note { margin: 8px 0 0; }
|
.excluded-note { margin: 8px 0 0; }
|
||||||
|
/* Sits between the stat tiles and the "last X" rows, so it reads as a
|
||||||
|
footnote to the Meals tile above it. */
|
||||||
|
.food-kind-split { margin: -8px 0 14px; }
|
||||||
|
/* Tied to the bar above it, so it sits closer to the chart than the trend
|
||||||
|
caption below and takes the accent to read as "the highlighted one". */
|
||||||
|
.food-day-info { margin: 6px 0 0; color: var(--accent); }
|
||||||
|
|
||||||
/* The day's own figures stay readable but visibly step back, so "this one is
|
/* The day's own figures stay readable but visibly step back, so "this one is
|
||||||
not in the numbers" is legible from the day as well as from the charts. */
|
not in the numbers" is legible from the day as well as from the charts. */
|
||||||
.overview.day-excluded .stats,
|
.overview.day-excluded .stats,
|
||||||
|
.overview.day-excluded .food-kind-split,
|
||||||
.overview.day-excluded .last-row { opacity: 0.55; }
|
.overview.day-excluded .last-row { opacity: 0.55; }
|
||||||
|
|
||||||
/* The hatch every chart uses for a day that doesn't count. The pattern itself
|
/* The hatch every chart uses for a day that doesn't count. The pattern itself
|
||||||
|
|||||||
Reference in new issue
Block a user