v1.1.0:7 — exercise-history popup auto-loads on scroll

The popup HAD an IntersectionObserver-based infinite scroll (since
v1.0.0:6 alongside the main workout-history page), but the observer
was unreliable inside an `absolute`-positioned scroll container with
a small 60px rootMargin. It often didn't fire at all — leaving the
user with a popup that scrolled internally but never fetched more
data even when hundreds of history entries existed server-side.

Fix: replace IntersectionObserver with a plain `scroll` event
listener on the popup. Fires whenever the user scrolls within 300px
of the bottom (matching WorkoutsList's lookahead on the main page).
Also runs once on mount in case the first page doesn't fill the
popup.

Bottom status row now shows "Loading more..." / "Scroll to load
more" / "End of history" so the user has feedback on state.

No schema, no API, no data.
This commit is contained in:
Keysat
2026-05-13 09:35:53 -05:00
parent 01529204cb
commit 1a77a0bfc2
3 changed files with 107 additions and 40 deletions
+6 -1
View File
@@ -12,6 +12,7 @@ import { v_1_1_0_3 } from './v1.1.0.3'
import { v_1_1_0_4 } from './v1.1.0.4'
import { v_1_1_0_5 } from './v1.1.0.5'
import { v_1_1_0_6 } from './v1.1.0.6'
import { v_1_1_0_7 } from './v1.1.0.7'
/**
* Version graph for the `proof-of-work` package.
@@ -44,9 +45,12 @@ import { v_1_1_0_6 } from './v1.1.0.6'
* v1.1.0:6 — Exercise-history popup max-height bumped from ~320px
* (5 rows) to 70vh (~15+ rows). Users with deep history
* can scroll without fighting a tiny inner scrollbar.
* v1.1.0:7 — Exercise-history popup auto-loads more rows on scroll
* (switched from a flaky IntersectionObserver-in-popup to
* a plain scroll listener with 300px lookahead).
*/
export const versionGraph = VersionGraph.of({
current: v_1_1_0_6,
current: v_1_1_0_7,
other: [
v_1_0_0_1,
v_1_0_0_2,
@@ -60,5 +64,6 @@ export const versionGraph = VersionGraph.of({
v_1_1_0_3,
v_1_1_0_4,
v_1_1_0_5,
v_1_1_0_6,
],
})