Interleave the sleep and wake lists, move walks down
Sleep windows and Wake windows were two panels showing two halves of one sequence: a wake window is precisely the gap between two sleeps, so the panels alternated with each other and neither could be read as the day's rhythm on its own. Answering "how long was he up before that nap?" meant looking at one panel, holding a time in your head, and finding it in the other. They are one list now, the two window sets sorted together by start time, which is all the interleaving that alternating-by-construction needs. Each row states whether it is asleep or awake and carries a stripe in its colour, so the alternation reads before the words do, and the row still running keeps the highlight it had. renderWindowList grew the ability for a window to bring its own class and label; the single-kind lists still pass one of each for the whole list and tag only the open row, where "Walking" is news rather than a repeat of the heading it sits under. One rule had to be spelled out: the new per-kind stripe ties on specificity with the generic .ww.ongoing, and being later would have won, leaving an open awake row with a faded edge instead of its full-strength one. The walks group — the panel and both its patterns — moves below "Pees, poos & meals". The three stay together: they were grouped under Walks deliberately, and leaving the patterns behind would strand two walk charts among the sleep ones. Both old panel keys go stale, so anyone who had folded Sleep windows or Wake windows gets the merged panel open, as with any panel that is new to a build.
This commit is contained in:
+20
-2
@@ -462,18 +462,36 @@ textarea { resize: vertical; }
|
||||
border-color: var(--accent);
|
||||
background: var(--accent-soft);
|
||||
}
|
||||
.ww.ongoing .ww-tag {
|
||||
/* Every row can carry a state, not only the open one: the merged sleep/wake
|
||||
list labels each row asleep or awake, where the label is the whole point. */
|
||||
.ww .ww-tag {
|
||||
font-size: 0.75rem;
|
||||
color: var(--accent);
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
color: var(--muted);
|
||||
}
|
||||
/* A stripe in the row's own colour, so an alternating list reads as alternating
|
||||
before you get to the words. */
|
||||
.ww.sleep-ww { border-left: 3px solid color-mix(in srgb, var(--sleep) 55%, transparent); }
|
||||
.ww.wake-ww { border-left: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
|
||||
.ww.walk-ww { border-left: 3px solid color-mix(in srgb, var(--walk) 55%, transparent); }
|
||||
.ww.sleep-ww .ww-tag { color: var(--sleep); }
|
||||
.ww.wake-ww .ww-tag { color: var(--accent); }
|
||||
.ww.walk-ww .ww-tag { color: var(--walk); }
|
||||
.ww.ongoing .ww-tag { color: var(--accent); }
|
||||
.ww.sleep-ww.ongoing {
|
||||
border-color: var(--sleep);
|
||||
background: color-mix(in srgb, var(--sleep) 14%, var(--surface));
|
||||
}
|
||||
.ww.sleep-ww.ongoing .ww-tag { color: var(--sleep); }
|
||||
/* Spelled out like the other two: the faded stripe above would otherwise win
|
||||
over the generic .ww.ongoing on specificity ties and leave the open awake
|
||||
row without its full-strength edge. */
|
||||
.ww.wake-ww.ongoing {
|
||||
border-color: var(--accent);
|
||||
background: color-mix(in srgb, var(--accent) 14%, var(--surface));
|
||||
}
|
||||
.ww.walk-ww.ongoing {
|
||||
border-color: var(--walk);
|
||||
background: color-mix(in srgb, var(--walk) 14%, var(--surface));
|
||||
|
||||
Reference in New Issue
Block a user