fix(web): auto-reveal newer days when scrolling up after a deep timeline jump #1396

Merged
chris merged 1 commit from fix/timeline-auto-reveal-newer-days into main 2026-10-25 22:24:49 +01:00
Owner

Root cause

Lost wakeup with three compounding gaps: (1) the top reveal sentinel renders inside the IntersectionObserver's 900px rootMargin but above the viewport after a deep jump — the single transition callback fires at the -900px crossing where the geometry check correctly rejects it (ISSUE-074 guard), and while the user scrolls the remaining distance the sentinel stays continuously intersecting, so no further callback ever fires; (2) every hydration-pump reveal check early-returned while jumpingDayKey was set; (3) jumpToTimelineDay's finally cleared the guard without a follow-up check, stranding any pending reveal. Result: the user reached the top with only the manual „Neuere Tage anzeigen" button.

Fix (wiring only, no new machinery)

  • schedulePreviousDaysRevealCheck() now also runs from the scroll handler (tick-coalesced, strict-geometry-gated, so the ISSUE-074 prepend drift loop cannot resurrect — its regression test stays green).
  • jumpToTimelineDay's finally consumes the reveal state once at settle, with the guard lifted and settled geometry.

Testing

  • New E2E regression test proven failing on the branch base (3/3: start index stuck at 20, zero auto-reveals), passing after the fix incl. --repeat-each=2; full scroll stability describe x2 (8 passed); newer-days-hydration + live-insert suites 5 passed.
  • npm run check: 0 errors; npm run test:unit: 356 passed.
  • KNOWN_ISSUES.md: ISSUE-207 (resolved).
## Root cause Lost wakeup with three compounding gaps: (1) the top reveal sentinel renders inside the IntersectionObserver's 900px rootMargin but above the viewport after a deep jump — the single transition callback fires at the -900px crossing where the geometry check correctly rejects it (ISSUE-074 guard), and while the user scrolls the remaining distance the sentinel stays continuously intersecting, so no further callback ever fires; (2) every hydration-pump reveal check early-returned while `jumpingDayKey` was set; (3) `jumpToTimelineDay`'s finally cleared the guard without a follow-up check, stranding any pending reveal. Result: the user reached the top with only the manual „Neuere Tage anzeigen" button. ## Fix (wiring only, no new machinery) - `schedulePreviousDaysRevealCheck()` now also runs from the scroll handler (tick-coalesced, strict-geometry-gated, so the ISSUE-074 prepend drift loop cannot resurrect — its regression test stays green). - `jumpToTimelineDay`'s finally consumes the reveal state once at settle, with the guard lifted and settled geometry. ## Testing - New E2E regression test proven failing on the branch base (3/3: start index stuck at 20, zero auto-reveals), passing after the fix incl. `--repeat-each=2`; full `scroll stability` describe x2 (8 passed); newer-days-hydration + live-insert suites 5 passed. - `npm run check`: 0 errors; `npm run test:unit`: 356 passed. - KNOWN_ISSUES.md: ISSUE-207 (resolved).
fix(web): auto-reveal newer days when scrolling up after a deep timeline jump
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build Android CI image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Deploy review instance (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 7m10s
536fddbee1
After a deep jump (axis click or ?date=/?y= restore) scrolling back up
never auto-loaded newer days: the user reached the top seeing only the
manual "Neuere Tage anzeigen" button. Three compounding gaps:

1. The reveal observer fires only on intersection TRANSITIONS. Post-jump
   the sentinel sits above the viewport but already inside the 900px
   rootMargin; its single callback fires at the -900px crossing where
   sentinelWithinRevealMargin correctly rejects it (ISSUE-074 guard),
   and no further transition occurs while the user scrolls the rest of
   the way to the top — the wakeup was lost.
2. Every hydration-pump reveal check early-returned while jumpingDayKey
   was set, and nothing re-checked after it cleared at settle, so a
   pendingPreviousDaysReveal set mid-jump stranded forever.
3. Scroll events only drove the URL-state persist, never the reveal
   check.

Fix is wiring, not machinery: schedulePreviousDaysRevealCheck now runs
from the scroll handler (tick-coalesced and strict-geometry-gated, so a
sentinel entirely above the viewport still never reveals and the ISSUE-
074 prepend drift loop cannot resurrect), and jumpToTimelineDay's
finally consumes the pending state once at settle with the guard
lifted. Viewport anchoring across prepends is untouched.

New E2E test (timeline scroll stability describe): jump deep via the
axis, wheel up to the top without ever clicking the fallback button,
assert the window walks back to index 0 and every day gets requested.
Proven failing on the branch base (start index stuck at the jump window
20, 3/3 attempts); passes after the fix, including --repeat-each=2
alongside the full scroll-stability, newer-days-hydration and live-
insert suites. [ISSUE-207]
chris merged commit 0fef32f6b4 into main 2026-10-25 22:24:49 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!1396
No description provided.