Drop the timing and walking hint lines
Both restated their own chart in prose. The timing hint gave the typical pee gap as a sentence directly under a row whose whole job is to show that gap on a track, and the walking one gave a target the walk trend already draws as a line with a chip naming the number. Removed with them: the pee-gap cache in renderTiming, which existed only so the hint and the pee row could share one computation, and the .timing-hint rule. median and walkTargetFor stay — the timing chart and the walk trend's goal line are still their callers. The changelog entry announcing walks keeps its mention of the rule of thumb. That one shipped and was true at the time, so a new entry retires it rather than an edit pretending it was never there.
This commit is contained in:
+1
-20
@@ -763,26 +763,14 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
function renderTiming(events) {
|
function renderTiming(events) {
|
||||||
const peeGaps = gapsBetween(events, "pee");
|
|
||||||
|
|
||||||
for (const row of TIMING_ROWS) {
|
for (const row of TIMING_ROWS) {
|
||||||
const svg = document.getElementById(`timing-chart-${row.type}`);
|
const svg = document.getElementById(`timing-chart-${row.type}`);
|
||||||
const note = document.getElementById(`timing-note-${row.type}`);
|
const note = document.getElementById(`timing-note-${row.type}`);
|
||||||
if (!svg || !note) continue;
|
if (!svg || !note) continue;
|
||||||
const gaps = row.type === "pee" ? peeGaps : gapsBetween(events, row.type);
|
const gaps = gapsBetween(events, row.type);
|
||||||
const last = lastEventOfType(events, row.type);
|
const last = lastEventOfType(events, row.type);
|
||||||
drawTimingChart(svg, note, row, gaps, last ? Math.max(0, Date.now() - last.at) : null);
|
drawTimingChart(svg, note, row, gaps, last ? Math.max(0, Date.now() - last.at) : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
const hint = document.getElementById("timing-hint");
|
|
||||||
const typicalPee = median(peeGaps);
|
|
||||||
if (typicalPee != null) {
|
|
||||||
hint.textContent =
|
|
||||||
`Based on ${peeGaps.length} pee gap${peeGaps.length === 1 ? "" : "s"}. ` +
|
|
||||||
`Aim to take the puppy out a little before the typical ${formatDuration(typicalPee)} mark.`;
|
|
||||||
} else {
|
|
||||||
hint.textContent = "Log a few more pees, poos and meals to see typical timings.";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawTimingChart(svg, note, row, gaps, since) {
|
function drawTimingChart(svg, note, row, gaps, since) {
|
||||||
@@ -1071,13 +1059,6 @@
|
|||||||
const totalMs = walkMsInRange(events, from, to);
|
const totalMs = walkMsInRange(events, from, to);
|
||||||
document.getElementById("walk-total").textContent =
|
document.getElementById("walk-total").textContent =
|
||||||
windows.length ? `(${formatDuration(totalMs)})` : "";
|
windows.length ? `(${formatDuration(totalMs)})` : "";
|
||||||
|
|
||||||
const goal = walkTargetFor(loadConfig().birthday);
|
|
||||||
const goalEl = document.getElementById("walk-goal");
|
|
||||||
goalEl.textContent = goal
|
|
||||||
? `Rule of thumb at this age: about ${goal.perWalk} min per walk, ${goal.walks}× a day (~${goal.total} min).`
|
|
||||||
: "";
|
|
||||||
goalEl.hidden = !goal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Which history rows sit inside a sleep or walk window, so the list can run a
|
// Which history rows sit inside a sleep or walk window, so the list can run a
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
[
|
[
|
||||||
|
{ "date": "2026-09-01", "text": "Dropped two hint lines: the “Based on N pee gaps…” sentence under the Timing charts, and the “Rule of thumb at this age…” one in the Walks panel. The charts above them already say it. The age-based walking goal is still there, drawn as the goal line on the Walk trend" },
|
||||||
{ "date": "2026-09-01", "text": "On the dark theme the awake timers are a warm near-white now — both “Awake for” at the top and the pill in the day bar — instead of yellow text on a yellow-tinted pill. The light theme keeps its dark gold, where white would disappear into a near-white pill" },
|
{ "date": "2026-09-01", "text": "On the dark theme the awake timers are a warm near-white now — both “Awake for” at the top and the pill in the day bar — instead of yellow text on a yellow-tinted pill. The light theme keeps its dark gold, where white would disappear into a near-white pill" },
|
||||||
{ "date": "2026-09-01", "text": "Toned the awake timer down: the pill in the day bar is a fainter yellow and its text a good deal darker, so “Awake for” is comfortable to read rather than technically legible. The Awake labels elsewhere darkened with it" },
|
{ "date": "2026-09-01", "text": "Toned the awake timer down: the pill in the day bar is a fainter yellow and its text a good deal darker, so “Awake for” is comfortable to read rather than technically legible. The Awake labels elsewhere darkened with it" },
|
||||||
{ "date": "2026-08-31", "text": "The asleep timer text is a deeper blue, so “Asleep for” in the day-bar pill and on the big card is properly readable against its own pale blue background instead of the near-invisible blue-on-blue it was — the same treatment the awake gold just got, and it applies to the Asleep labels in the Sleep & wake list too" },
|
{ "date": "2026-08-31", "text": "The asleep timer text is a deeper blue, so “Asleep for” in the day-bar pill and on the big card is properly readable against its own pale blue background instead of the near-invisible blue-on-blue it was — the same treatment the awake gold just got, and it applies to the Asleep labels in the Sleep & wake list too" },
|
||||||
|
|||||||
@@ -215,7 +215,6 @@
|
|||||||
<!-- The axis is stretched (see drawTimingChart), so say what the middle
|
<!-- The axis is stretched (see drawTimingChart), so say what the middle
|
||||||
of a bar means rather than leave it to be inferred. -->
|
of a bar means rather than leave it to be inferred. -->
|
||||||
<p class="muted-note">The middle of every bar is that type's typical gap: left of it is sooner than usual, right of it is longer, and the faded stretch runs out to the longest gap in the window.</p>
|
<p class="muted-note">The middle of every bar is that type's typical gap: left of it is sooner than usual, right of it is longer, and the faded stretch runs out to the longest gap in the window.</p>
|
||||||
<p class="muted-note timing-hint" id="timing-hint"></p>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Sleep and wake windows are the same boundaries read two ways — a wake
|
<!-- Sleep and wake windows are the same boundaries read two ways — a wake
|
||||||
@@ -290,9 +289,6 @@
|
|||||||
<h2>Walks <span class="muted-note" id="walk-total"></span></h2>
|
<h2>Walks <span class="muted-note" id="walk-total"></span></h2>
|
||||||
<ul id="walk-list" class="wake-list"></ul>
|
<ul id="walk-list" class="wake-list"></ul>
|
||||||
<p id="walk-empty" class="empty">No walks yet for this day. Use 🦮 Walk start / 🏁 Walk end to time one.</p>
|
<p id="walk-empty" class="empty">No walks yet for this day. Use 🦮 Walk start / 🏁 Walk end to time one.</p>
|
||||||
<!-- Age-based guidance ("the five-minute rule"), only when a birthday
|
|
||||||
is set and the puppy is still growing. -->
|
|
||||||
<p id="walk-goal" class="muted-note" hidden></p>
|
|
||||||
<div class="chart walk-chart" id="walk-chart-wrap" hidden>
|
<div class="chart walk-chart" id="walk-chart-wrap" hidden>
|
||||||
<div class="chart-title">Minutes per day <span data-chart-days-label>(last 7 days)</span></div>
|
<div class="chart-title">Minutes per day <span data-chart-days-label>(last 7 days)</span></div>
|
||||||
<svg id="chart-walk" class="chart-svg" viewBox="0 0 320 160" role="img" aria-label="Minutes walked per day"></svg>
|
<svg id="chart-walk" class="chart-svg" viewBox="0 0 320 160" role="img" aria-label="Minutes walked per day"></svg>
|
||||||
|
|||||||
@@ -390,7 +390,6 @@ button.danger { background: var(--danger); }
|
|||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
.timing-hint { margin: 10px 4px 0; line-height: 1.4; }
|
|
||||||
|
|
||||||
/* ---------- timing range charts ---------- */
|
/* ---------- timing range charts ---------- */
|
||||||
.timing-charts {
|
.timing-charts {
|
||||||
|
|||||||
Reference in New Issue
Block a user