Project today's end-of-day sleep total on the Sleep trend chart

A dashed tail continues today's line from now to midnight by adding the
increments the N-day average curve makes over the same stretch, so the
projection follows the usual daily rhythm instead of extrapolating the
current rate (which overshoots right after a long night). The legend
shows the projected total; with no history there's no average and no
projection.
This commit is contained in:
Alexander Heldt
2026-07-15 10:36:22 +00:00
parent cebe923d68
commit ab0e51108c
4 changed files with 45 additions and 4 deletions
+12
View File
@@ -939,7 +939,19 @@ input.switch:checked::after { transform: translateX(18px); }
fill: none;
opacity: 0.7;
}
/* Today's projected tail: same weight/color as today so it reads as its
continuation, dashed + faded because it hasn't happened yet. */
.chart-svg .trend-projected {
stroke: var(--sleep);
stroke-width: 2.5;
stroke-dasharray: 2 4;
stroke-linecap: round;
stroke-linejoin: round;
fill: none;
opacity: 0.55;
}
.lg.trend-today .sw { background: var(--sleep); }
.lg.trend-projected .sw { background: color-mix(in srgb, var(--sleep) 40%, var(--surface)); }
.lg.trend-yesterday .sw { background: var(--muted); }
.lg.trend-avg .sw { background: color-mix(in srgb, var(--sleep) 55%, var(--surface)); }
.lg[hidden] { display: none; }