From 1c4bea51df3e0676c9a45ff2e7c43ade30f06f3e Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Sun, 12 Jul 2026 17:30:16 +0000 Subject: [PATCH] Increase the daily counts chart y-axis granularity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1-unit gridlines up to 10, 2-unit up to 20, 5-unit beyond — previously anything above 10 was squeezed into five segments. --- src/app.js | 9 +++++---- src/changelog.json | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app.js b/src/app.js index 3a47709..6e5b811 100644 --- a/src/app.js +++ b/src/app.js @@ -838,19 +838,20 @@ } // Pick a chart Y maximum and tick count so every tick label is a clean - // whole number (avoids 0, 0, 1, 1, 2 from rounding fractional steps). + // whole number (avoids 0, 0, 1, 1, 2 from rounding fractional steps): + // 1-unit gridlines up to 10, 2-unit up to 20, 5-unit beyond. function niceAxis(rawMax) { if (!(rawMax > 0)) return { yMax: 1, steps: 1 }; - if (rawMax <= 4) { + if (rawMax <= 10) { const m = Math.ceil(rawMax); return { yMax: m, steps: m }; } - if (rawMax <= 10) { + if (rawMax <= 20) { const m = Math.ceil(rawMax / 2) * 2; return { yMax: m, steps: m / 2 }; } const m = Math.ceil(rawMax / 5) * 5; - return { yMax: m, steps: 5 }; + return { yMax: m, steps: m / 5 }; } // Sleep-specific axis: always 2-hour granularity, capped at 24h/day, diff --git a/src/changelog.json b/src/changelog.json index a7904ce..d305978 100644 --- a/src/changelog.json +++ b/src/changelog.json @@ -1,4 +1,5 @@ [ + { "date": "2026-07-12", "text": "Finer-grained y-axis on the daily counts chart" }, { "date": "2026-07-12", "text": "The update banner now lists what changed in the new version" }, { "date": "2026-07-12", "text": "Fixed adding an exercise on iPhone: stale app updates, and the keyboard's Go key discarding the input" }, { "date": "2026-07-12", "text": "Training: define exercises with how-to reminders, log sessions in one tap, and follow a 14-day consistency view" }