Skip to content

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
brennanb2025/mobile-older-page-not-lostfrom
brennanb2025/mobile-page-history-tap-load
Closed

brennanb2025 wants to merge 4 commits into
brennanb2025/mobile-older-page-not-lostfrom
brennanb2025/mobile-page-history-tap-load

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​19 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​21 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8

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 main too: 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:

  • Scrolling to the top no longer loads older messages. The "Load earlier messages" button (already there, the first thing in the list whenever older history exists) loads them when tapped and shows a spinner while loading.
  • If iOS is still bouncing the list past the top or bottom when a page lands (for example, the reader taps and then pulls the list down while it loads), Orca leaves the scroll position alone. The reader then sees the newly loaded messages at the top instead of their own message, but the chat keeps scrolling.
  • Everything else about holding the reader's place is unchanged from 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, was readerIsScrolling) 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 are main'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.

  • Keep auto-loading and only skip the correction while bounced: a quick flick to the top would then lose the reader's place nearly every time.
  • Delay the correction until the bounce ends: needs scroll-settle timers and a "correction still owed" flag, the timing machinery that produced several bugs in fix(mobile): phone chat page keeps following after a nudge, per chat, and at 2,000 messages #28807's review rounds.
  • Turn off the bounce with CSS (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.

  • Intended: tap-only on the page matches the common pattern.
  • Intended: native builds keep loading on drag. The operating system holds the place there and never hit this freeze, so this PR leaves native alone.
  • Intended: skipping the correction while the list is bounced has no counterpart in the common pattern, which doesn't hand-build its list inside an iOS web view. The write mid-bounce is the freeze; skipping it costs the reader their place once.
  • Temporary: the correction still anchors the lowest thing on screen, as on 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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

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

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…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
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
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Superseded by #29271, which carries this change together with the rest of the phone chat scroll work in one PR against main.

@brennanb2025
brennanb2025 deleted the brennanb2025/mobile-page-history-tap-load branch October 19, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant