diff --git a/src/app.js b/src/app.js index d645887..f4ff3ec 100644 --- a/src/app.js +++ b/src/app.js @@ -781,7 +781,9 @@ ptime.textContent = counter; since.textContent = `since ${formatTime(ts)}`; icon.textContent = state === "asleep" ? "😴" : "☀️"; - pill.title = `${state === "asleep" ? "Asleep" : "Awake"} since ${formatTime(ts)}`; + const flip = state === "asleep" ? "Sleep end" : "Sleep start"; + pill.title = `${state === "asleep" ? "Asleep" : "Awake"} since ${formatTime(ts)} — tap to log ${flip.toLowerCase()}`; + pill.setAttribute("aria-label", `${state === "asleep" ? "Asleep" : "Awake"} since ${formatTime(ts)}. Log ${flip.toLowerCase()}.`); updateBarClockMode(); } @@ -3674,6 +3676,16 @@ }); }); + // The timer pill doubles as a one-tap sleep toggle: tapping it logs the + // boundary that ends the state it shows, exactly like the matching quick + // action. Only reachable once the big card has scrolled away — in standby + // the pill is visibility:hidden, so clicks can never land on it. + document.getElementById("bar-clock").addEventListener("click", () => { + const { state } = currentSleepState(live()); + if (!state) return; // no sleep history yet; the pill is hidden anyway + quickLog(state === "asleep" ? "sleep-end" : "sleep-start"); + }); + document.querySelectorAll(".chart-days-picker button").forEach(b => { b.addEventListener("click", () => setChartDays(Number(b.dataset.days))); }); diff --git a/src/changelog.json b/src/changelog.json index 76177fc..d22989b 100644 --- a/src/changelog.json +++ b/src/changelog.json @@ -1,4 +1,5 @@ [ + { "date": "2026-08-21", "text": "The sleep timer pill in the day bar — the one that appears once you've scrolled past the big timer — is now tappable: tap it while the puppy is asleep to log the wake-up, or while awake to log a sleep start, without scrolling back up to the buttons" }, { "date": "2026-08-20", "text": "Added reminders: turn them on in Settings and your phone gets a notification when it's time to sleep (\"Awake for 45 min\") or when there's been no pee, poo or meal for a while. Each one has its own interval, they arrive even with the app closed, and they stay quiet while the puppy is logged as asleep so you're not nagged all night. On iPhone, add Puppy Tracker to your Home Screen first — iOS only allows notifications for installed apps" }, { "date": "2026-08-18", "text": "The sleep button that would just repeat the last one is now disabled: while asleep you can only tap ⏰ Sleep end, and while awake only 😴 Sleep start — no more accidental double taps creating zero-length sleep windows. If you did miss a boundary, you can still add it at the right time from the event log" }, { "date": "2026-08-02", "text": "Added free-text notes: tap 📝 Note to jot down things that happened on a day — vaccinations, vet visits, milestones — with a date, optional photo, and any text. All your notes are collected in a new Notes section that stays visible whatever day you're viewing, so you can see at a glance when things like a tick vaccination were done" }, diff --git a/src/index.html b/src/index.html index 22dbc09..e11c5d3 100644 --- a/src/index.html +++ b/src/index.html @@ -81,11 +81,13 @@
- +