Repository navigation
fix(mobile): phone chat page stops following only when you touch, wheel or key-scroll it - #29072
Closed
brennanb2025 wants to merge 8 commits into
Conversation
On the phone page, "the reader scrolled away" was read from the direction scrollTop moved. Rows rendering, trims, re-measuring, pins and the place-hold move scrollTop too, so each of them could be misread as the reader. Following now stops on the reader's touch, an upward wheel or a scroll key, and resumes when the view rests at the end. A touch that never pans hands following back on lift, so a resting thumb never has the view pinned under it and momentum after a pan never re-pins. Switching chats opens at the newest message.
Closed
6 of 9 tasks
…ps following Following is re-derived when the finger lifts: only a pan down the screen over a list that can scroll leaves the end, so a swipe on a chat that still fits the screen, or a pan toward the end while output lands, gives following back and catches up. No write lands in iOS's bounce after a pan.
Opening another chat at its newest message is separate from how the page decides the reader stopped following, so it lands on its own.
… on this one The hold for the oldest message trimmed at the 2,000 cap is independent of how the page decides the reader stopped following; it lands on its own on top.
This was referenced Oct 15, 2026
Contributor
Author
|
Closing: following on the phone chat page is being reworked in #29271 (one windowed list); this change will be redone on top of it if still needed. Branch kept. |
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 over-the-air version of the phone app, which runs as a web page), Orca keeps you at the newest line while an agent writes, and stops doing that when you scroll up to read. It decided "you scrolled up" by watching which way the list's scroll position moved. But Orca itself, and the page laying out rows, move that position too, so Orca sometimes stopped following when you hadn't touched anything, or jumped you back while you were reading. Now Orca stops following only when you actually touch, wheel or key-scroll the list in a way that can take you away from the newest line, and starts again when you're back at the end.
What Changed
The problem. On the page, the web list Orca uses doesn't follow new output for us, so Orca does it by hand: it pins the list to the end as output arrives, and stops pinning when the reader scrolls away. "The reader scrolled away" was read from the direction the scroll position moved. Rows rendering, the oldest row being dropped at the 2,000-message limit, rows being re-measured, Orca's own pins and Orca's "keep your place" correction all move the scroll position too. Every page bug found in the follow-ups to #28413 was one of those writers misread by that check: following stopped on the first new message at the 2,000-message limit; "Scroll to latest" landed short and stopped following; a small nudge stopped following with no "Scroll to latest" button while output piled up below.
Real iPhone event logs from QA showed two more facts: iOS sends one touch-move at most before it takes over the pan, then a lift, then about 2 seconds of momentum scroll events after the finger is gone; and it never sent a touch-cancel.
Before → after, on the phone page:
main, and #29043/#29065)Native app builds are unchanged: they keep their own drag and momentum events.
Mechanism.
use-mobile-native-chat-tail-follow.ts: on the page, scroll events no longer decide that the reader left. Following turns off on the list's touch-start, an upward wheel, or Arrow Up / Page Up / Home (the last two only when the view can move up). It turns back on when a scroll event shows the view resting at the end with no finger on the list, on an explicit jump (send, "Scroll to latest"), or when the last finger lifts.MobileNativeChatView.tsx: spreads the hook's list-input props (the native drag/momentum handlers move there, unchanged).Why
The bug class this removes. On the page, "the reader scrolled away" was inferred from which way the scroll position moved, but layout and Orca's own writes move it too. Reading intent from input instead of from the position removes every writer from the question at once, instead of teaching the check to recognise each writer (#28807 tried that over six review rounds: a settle timer, a set of touch ids, a cancel state, a gesture quiet window; each piece had its own hole).
A second bug class, found in review and removed here: a pause that nothing re-derives. The first version of this PR turned following off at the touch start and gave it back at the lift only for a touch whose finger barely moved. When the finger moved but the list couldn't move away from the end (a chat that still fits the screen, or a pan toward the end), no scroll event came to turn following back on. The reply then grew below the screen unfollowed, with no button for the first 80 pt. The lift now works following out from whether the gesture could have taken the view away from the end, so a paused following always ends in a decision. The common pattern has the same rule: a gesture that can't move the view away from the end never stops following.
How "reader input" works on a page where iOS owns the pan. A native list reports drag-begin, drag-end and momentum-end. The page gets none of them. The touch start replaces drag-begin. The lift replaces drag-end. Momentum needs no end event: after a pan away from the end following is already off, so momentum scroll events can only turn it back on, and only by resting at the end.
Alternatives considered.
Differences from the common pattern. The common pattern stops following on the reader's own input (a native drag, or wheel / touch / key events on the web), only when that input can move the view away from the end. It resumes at the end, re-arms on send, and shows a jump-to-end control whenever it isn't following.
Known limitation (temporary). Scrolling that sends the page no touch, wheel or key event no longer stops following on the page: VoiceOver moving its focus through messages or its three-finger scroll, and iOS scrolling the list while you extend a text selection. While output streams, the next chunk moves the view back to the newest line. This is the same as the native app and as the page before #28413, and it differs from 1.4.226, where any upward movement stopped following. It isn't fixed here because "the position moved away from the end with no input" is exactly the check this PR removes: on the page, the cap trim, re-measuring, clamps and Orca's own writes also move the position with no input. Telling them apart needs its own design and device checks. Follow-up: treat accessibility and text-selection scrolling as the reader's input on the page (ticket to be filed by the coordinator).
Split out of this PR.
maincan open the next chat where you were in the last one) is its own PR offmain.Stacked on #29065 (which is stacked on #29043). Supersedes the following half of #28807.
Linked Issue
Follow-up to #28413; tracked with #28807.
Visual Proof
Pending: iOS simulator and phone-viewport browser QA runs on this branch.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
MobileNativeChatView.test.ts: one whole-flow test of the page. A swipe on a chat that fits the screen keeps following; a layout move doesn't stop following; a resting thumb isn't pinned under and catches up on lift; a nudge plus iOS momentum doesn't re-pin; reaching the end resumes; a wheel up stops. Replaces the old "a move up is the reader" test.Lint, typecheck and tests run in CI (nothing heavy runs on the author's machine).
Notes
Mobile only; no wire, settings or saved-data changes. Native builds unchanged.