Files
t3code/apps/web
olafuraandClaude Opus 4.8 a279bca0f8 refactor(client): extract the shared older-history lazy-load engine
The lazy-load state machine (~160 lines each) was hand-copied in the web
ChatView and the mobile composer, and every review-round fix had to be
applied to both — half the review churn on this PR was the copies drifting.

One shared hook, `useOlderThreadActivities` in client-runtime, now owns all
of the hardened behavior: reshape-sentinel reset, generation guard,
synchronous in-flight coalescing, the advancing cursor (all-overlap pages
keep paging), dedup against the latest merged set, and hasMore-preserving
failure handling. Clients pass a `loadPage` transport wrapper and keep only
their platform scroll trigger and error surfacing.

The decision kernel (reshape detection, cursor selection, page dedup) is
exported as pure functions with unit tests; react becomes an optional peer
dependency of client-runtime, scoped to the new subpath.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-20 17:27:49 +02:00
..
2026-06-29 22:57:48 +00:00