Compare commits

...

2 Commits

Author SHA1 Message Date
Alexander Heldt 8fe8f9d417 Log training sessions onto the selected day, not always today
The Log button stamps the selected day at the current time of day, so a
forgotten session can be back-filled from that day's view. The snackbar
says which day it landed on when it isn't today; Undo/Add note still
work on it.
2026-07-15 13:26:30 +00:00
Alexander Heldt c24d59e672 Make the Sleep trend yesterday line orange
Gray sank into the dashed grid lines; --eat orange stands apart from
today's blue and the average's teal in both themes.
2026-07-15 13:24:55 +00:00
3 changed files with 18 additions and 5 deletions
+13 -2
View File
@@ -1711,8 +1711,19 @@
logBtn.textContent = "Log"; logBtn.textContent = "Log";
logBtn.addEventListener("click", (e) => { logBtn.addEventListener("click", (e) => {
e.stopPropagation(); e.stopPropagation();
const ev = addEvent("training", "", Date.now(), { exerciseId: ex.id }); // Log onto the selected day (at the current time of day), so a session
showSnackbar(`${ex.name} logged`, ev); // that was forgotten yesterday can be back-filled from that day's view.
const day = selectedDay();
const onToday = ymd(day) === ymd(new Date());
let at = Date.now();
if (!onToday) {
const now = new Date();
at = new Date(day.getFullYear(), day.getMonth(), day.getDate(),
now.getHours(), now.getMinutes(), now.getSeconds()).getTime();
}
const ev = addEvent("training", "", at, { exerciseId: ex.id });
const dayStr = day.toLocaleDateString(undefined, { month: "short", day: "numeric" });
showSnackbar(onToday ? `${ex.name} logged` : `${ex.name} logged for ${dayStr}`, ev);
}); });
row.appendChild(main); row.appendChild(main);
+2
View File
@@ -1,4 +1,6 @@
[ [
{ "date": "2026-07-15", "text": "Logging a training session while viewing another day puts it on that day (the snackbar tells you where it went)" },
{ "date": "2026-07-15", "text": "The Sleep trend yesterday line is orange instead of gray, which was hard to see" },
{ "date": "2026-07-15", "text": "The Sleep trend average line is teal now, so it doesn't blend in with today's blue line and its projection" }, { "date": "2026-07-15", "text": "The Sleep trend average line is teal now, so it doesn't blend in with today's blue line and its projection" },
{ "date": "2026-07-15", "text": "Tapping a day in a chart selects it without jumping down to the history" }, { "date": "2026-07-15", "text": "Tapping a day in a chart selects it without jumping down to the history" },
{ "date": "2026-07-15", "text": "Meals with an amount logged show their grams in the day's history" }, { "date": "2026-07-15", "text": "Meals with an amount logged show their grams in the day's history" },
+3 -3
View File
@@ -927,11 +927,11 @@ input.switch:checked::after { transform: translateX(18px); }
fill: none; fill: none;
} }
.chart-svg .trend-yesterday { .chart-svg .trend-yesterday {
stroke: var(--muted); stroke: var(--eat); /* orange — the gray it had before sank into the grid */
stroke-width: 1.5; stroke-width: 1.5;
stroke-linejoin: round; stroke-linejoin: round;
fill: none; fill: none;
opacity: 0.75; opacity: 0.85;
} }
.chart-svg .trend-avg { .chart-svg .trend-avg {
stroke: var(--weight); /* teal — keeps it apart from today's blue and its blue projected tail */ stroke: var(--weight); /* teal — keeps it apart from today's blue and its blue projected tail */
@@ -954,7 +954,7 @@ input.switch:checked::after { transform: translateX(18px); }
} }
.lg.trend-today .sw { background: var(--sleep); } .lg.trend-today .sw { background: var(--sleep); }
.lg.trend-projected .sw { background: color-mix(in srgb, var(--sleep) 40%, var(--surface)); } .lg.trend-projected .sw { background: color-mix(in srgb, var(--sleep) 40%, var(--surface)); }
.lg.trend-yesterday .sw { background: var(--muted); } .lg.trend-yesterday .sw { background: var(--eat); }
.lg.trend-avg .sw { background: var(--weight); } .lg.trend-avg .sw { background: var(--weight); }
.lg[hidden] { display: none; } .lg[hidden] { display: none; }