diff --git a/src/app.js b/src/app.js index 8f55f0a..ad3902c 100644 --- a/src/app.js +++ b/src/app.js @@ -4721,6 +4721,16 @@ // from tapping the tab. let backArmed = false; + // Returning to Today is a history navigation — by the back button, or by + // tapping the tab, which spends the same entry — and a browser restores the + // scroll position it saved against the entry it lands on. That position is + // wherever you happened to be when you left Today, so the viewport jumped on + // arrival even though showTab itself scrolls nothing. Tabs are not pages and + // carry no scroll of their own to restore, so the automatic behaviour has + // nothing useful to offer here and is turned off. (It also governs reloads, + // which now open at the top — the right place to start anyway.) + if ("scrollRestoration" in history) history.scrollRestoration = "manual"; + function armBack() { if (backArmed) return; history.pushState({ puppyTab: true }, ""); diff --git a/src/changelog.json b/src/changelog.json index 7f118b0..b075c57 100644 --- a/src/changelog.json +++ b/src/changelog.json @@ -1,4 +1,5 @@ [ + { "date": "2026-09-07", "text": "Going back to the Today tab no longer jumps the viewport either — by tapping it or with the back button. The other tabs stopped jumping in the last change, but returning to Today is a history step, and the browser was restoring the scroll position from when you last left it" }, { "date": "2026-09-07", "text": "The tab row now matches the frozen row above it that holds the date. It was a different shade, and the two sat as separate bars with the date row's rounded corners cutting between them; they share the same card colour now, and once you have scrolled the log buttons away they join into a single rounded block instead of two stacked ones" }, { "date": "2026-09-07", "text": "Switching tabs no longer jumps the page back to the top. The tab row is frozen to the top of the screen, so you change tabs from wherever you have scrolled to, and being thrown back past the log buttons you had just scrolled off was more disruptive than landing part-way down the new tab" }, { "date": "2026-09-07", "text": "The page is split into five tabs — Today, Sleep, Walks, Habits and Growth — instead of one long column of fourteen panels. Today has the overview, sleep & wake and the day's history; Sleep and Walks each have their day-by-day chart, their when-it-happens grid and their trend; Habits has the pee, poo and meal timing and counts; Growth has weight, training and notes. Getting to the weight curve no longer means scrolling past everything else. The day bar and the log buttons sit above the tabs and stay there whichever one you're on, so logging is still one tap from anywhere. Folding a panel by tapping its heading works exactly as before, inside its tab, and the app reopens on the tab you left it on. The back button (or the back gesture) returns you to Today from wherever you are, and pressing it again leaves the app — always two presses to get out, however much you'd been flicking between tabs beforehand" },