Detect a live-window reshape from an order-independent oldest boundary
(`liveWindowOldestActivityId`: min by createdAt/id) instead of
`activities[0]`. The reducer sorts unsequenced rows to the end while the
server snapshot lists legacy unsequenced rows first, so the first live
append re-sorts the array and shifts index 0 — which previously looked
like a reshape and wrongly cleared the user's scrolled-up history.
Run the older-pages reset in useLayoutEffect so the cleared state commits
before paint; otherwise a thread switch renders one frame with the previous
thread's lazy-loaded pages still merged in, flashing stale work-log and
approval rows.
Applied to both web (ChatView) and mobile (use-thread-composer-state); the
shared sentinel helper lives in client-runtime with unit tests.
Co-Authored-By: Claude Opus 4.8 <[email protected]>