Skip to content

fix(mobile): bound history pages and prevent selection scroll jumps - #607

Merged
huichen merged 2 commits into
mainfrom
claude/mobile-history-pr
Sep 14, 2026
Merged

huichen merged 2 commits into
mainfrom
claude/mobile-history-pr

Conversation

@huichen

@huichen huichen commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Limit initial history, warm reopen, and older-history pages to three user exchanges.
  • Disable Android focus-driven auto-scrolling in the inverted transcript while preserving native text selection and manual scrolling.
  • Add regression coverage for multi-page continuity, exhaustion, warm-cache trimming, and the native scroll prop.

Validation

  • Mobile TypeScript and ESLint passed.
  • Mobile Jest: 81 suites / 1,042 tests passed.
  • Android selection-menu behavior still needs physical-device verification.

@huichen
huichen enabled auto-merge (squash) September 14, 2026 00:04
@huichen
huichen merged commit 25d167e into main Sep 14, 2026
12 checks passed
@huichen
huichen deleted the claude/mobile-history-pr branch September 14, 2026 00:06
huichen added a commit that referenced this pull request Sep 26, 2026
…es it (#865)

Three instrument faults, each of which had produced a wrong number:

**The harness never installed the live-lane capability flags.** They live in the
per-pairing shared runtime, and `coalesce_events()` answers an unknown pairing
with a fresh, *disabled* flag rather than an error — so declaring coalescing
succeeded, asserted success, and wrote to a throwaway flag while the drain read
another. Every "coalesced" reading was the undeclared lane. `E2e::on_broker` now
does what the supervisor does before building the transport, and the measurement
asserts the flag and that merging actually happened.

That also needed the harness's flow control to stop counting messages as events:
one merged message stands for `coalescedCount` source events, so decrementing per
message left the drain permanently behind and asked for a full merge window
almost every event (a 3-minute measurement became hours). `assert_lane` learns
the same shape — a merged message keeps its group's *newest* envelope and `idx`
and carries the whole group's text, which is how the client reads it
(`start = idx - coalescedCount + 1`).

**The history measurement was not measuring the phone's page.** `dump_entries`
fetched a whole session and let the bridge's 512 KiB budget reduce it, which
answers "as many newest exchanges as fit", not the newest
`HISTORY_PAGE_USER_EXCHANGES` (3, since #607) the phone asks for — three-fold
high on a lean page. The scripted agent now pages like the real one
(`paginate_backward`), and `measure-lean-history.py --phone-page N` measures the
real page through the shipping trim and budget. Its `--session` flag lets a run
name the same sessions the other measurement uses.

**The numbers follow.** On the three heaviest runs, the phone's lane is
undeclared 70.3 / 66.6 / 60.9 MB → coalesced 3.12 / 2.97 / 2.44 MB → coalesced +
lean 0.82 / 0.82 / 0.47 MB. The trim's own contribution is **-72% to -81%**, not
the ~-98% a raw-to-lean ratio suggests: that credits the trim with merging it
did not do. `CONNECTION.md` now states both steps, and its history figures are
the phone's page rather than a whole session.
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