Repository navigation
fix(mobile): phone page loads older messages only from the Load earlier button, so the chat no longer freezes at the top - #29043
Closed
brennanb2025 wants to merge 4 commits into
Conversation
…r tap On the phone page a scroll near the top paged in older history, often while iOS was still bouncing the list past the top. The place-hold then wrote scrollTop while WebKit owned the scroll, and the list stopped scrolling until the reader left the chat. The page now loads older history only from the existing Load earlier control (the native app keeps its drag paging), and the place-hold never writes while the list is bounced past either end.
brennanb2025
force-pushed
the
brennanb2025/mobile-page-history-tap-load
branch
from
October 15, 2026 07:41
237d0af to
922ae9c
Compare
This was referenced Oct 15, 2026
Closed
Closed
Closed
brennanb2025
changed the base branch from
main
to
brennanb2025/mobile-older-page-not-lost
October 15, 2026 11:59
brennanb2025
added a commit
that referenced
this pull request
Oct 15, 2026
…d-on change # Conflicts: # mobile/src/session/MobileNativeChatOverlay.tsx # mobile/src/session/use-mobile-native-chat-session.ts
# Conflicts: # mobile/src/session/MobileNativeChatView.tsx
brennanb2025
added a commit
that referenced
this pull request
Oct 15, 2026
…ge change # Conflicts: # mobile/src/session/MobileNativeChatOverlay.tsx # mobile/src/session/use-mobile-native-chat-session.ts
…y paging change
brennanb2025
added a commit
that referenced
this pull request
Oct 15, 2026
This was referenced Oct 15, 2026
Closed
Contributor
Author
|
Superseded by #29271, which carries this change together with the rest of the phone chat scroll work in one PR against main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
On the phone's chat page (the version of the phone app that updates over the air and runs as a web page), scrolling up to the top of a long chat could freeze the chat: it stopped scrolling until you left it. The page loaded older messages on its own when you reached the top, often while the iPhone's "bounce" past the top was still moving the list, and Orca then moved the list itself at the same moment. Now older messages load only when you tap the "Load earlier messages" button that already sits at the top, and the keep-your-place correction never moves the list while iOS is bouncing it. (Auto-scroll that keeps a following chat at the newest message can still move it, as on
main; the follow-up that changes following handles that.)What Changed
The problem. On the phone page, reaching the top of the loaded history loads the next older page automatically (within 60 px of the top). When the page lands, a "keep your place" correction sets the list's scroll position so the reader's message stays put. In a logged iPhone run the load fired at scroll position -15, inside iOS's rubber-band bounce past the top; the correction then wrote the scroll position while WebKit (the iPhone's browser engine) still owned the scroll. After that iOS sent no more scroll events and the chat would not scroll until the reader left it. This is latent on
maintoo: a fast flick to the top can land the load mid-bounce the same way.Before (on
main), on the phone page: reaching the top loads older messages by itself, sometimes mid-bounce, which can freeze the chat.After, on the phone page:
main.Native app builds are unchanged: they still load older history when the reader drags near the top, and the operating system holds the reader's place there.
Mechanism.
use-mobile-native-chat-tail-follow.ts: the gate that lets a scroll near the top load history (scrollMayLoadEarlier, wasreaderIsScrolling) is now true only for a native list's own drag, so on the page only the button's tap loads. The page-only "reader moved up" flag existed only for that gate; it is now a local value in the existing "stop following" check.MobileNativeChatScrollHold.tsx: the correction takes no snapshot, and so makes no write, while the list's scroll position is outside its range (below 0, or past the bottom), which is what iOS's bounce looks like from JavaScript. Its anchor and timing aremain's.Lands and reverts on its own. One commit on
main. Merge after #29137, which makes a lost older page show a retry line. Without it, this PR (which makes the button the only way to load older history) would turn a lost page into a button that does nothing. Reverting it brings back auto-loading at the top. The next PR in this stack (which changes which message the correction anchors) builds on it but this one doesn't depend on it.Why
A tap on iOS only registers on a list at rest (a tap during momentum just stops the scroll), so a tapped page is requested from a still list and normally lands on one. The case that froze, a write inside the bounce, is refused outright. A page that lands during an ordinary flick inside the content (not past an end) still gets the correction; that hasn't been seen to freeze the list (0 of 5 in QA of the current page).
Alternatives considered.
overscroll-behavior): changes how the chat feels at both ends and is unverified for this kind of scroller on iOS; worth a separate look, not needed for this fix.Differences from the common pattern. The common pattern loads older history from a "Load earlier" button at the top of the list and holds the reader's place with one correction when rows land.
main. The next PR in this stack anchors the message the reader was reading.Linked Issue
None. Follow-up to #28413; replaces the paging half of draft #28807.
Visual Proof
Pending: iPhone over-the-air page QA (reach the top; tap Load earlier; last page) will be attached by the review loop.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
MobileNativeChatView.test.ts: on the page, scrolling to the top and into the bounce doesn't load; tapping the Load earlier control does. Native paging tests unchanged.MobileNativeChatScrollHold.test.tsx: no write while the list is bounced past the top;main's hold tests unchanged.CI runs lint, typecheck and tests. No local runs (shared-machine limits).
AI Disclosure
Review
Agent skill upstream boundary
Notes
Phone page only (over-the-air build on iOS and Android web views); native builds, desktop, SSH and remote hosts are unaffected. No wire or settings changes.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)