Repository navigation
feat(ios): load older chat history without losing your place - #199038
roboclaw-bot wants to merge 1 commit into
Conversation
Worked on by: - @mikengyn - @vyctorbrzezowski Co-authored-by: mikengyn <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: a7e5c619-5af5-4049-998c-9a2b04e03fe9
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. What this changesAdds cursor-based older-history loading to iOS chat while preserving the reader’s position and bounding resident pages. Example: Read a 2,000-message conversation whose initial page contains messages 1801–2000.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 3 items remain Keep this useful, maintainer-authored draft open; two paging integration defects need repair, and the rendering dependency must land first. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe shared Apple chat model decodes Gateway history responses, retains older pages separately from the live tip, and supplies the iOS transcript and scroll owners with presentation rows. flowchart TD
A[Gateway chat history] --> B[iOS chat transport]
B --> C[Shared chat model]
C --> D[Live transcript tip]
C --> E[Older history pages]
D --> F[iOS transcript List]
E --> F
F --> G[Reader position anchors]
Technical reviewBest possible solution: Land the rendering dependency, then complete cursor paging with visible-row continuation and reaction support through the existing owners. Do we have a high-confidence way to reproduce the issue? Source establishes that main discards page cursors and exposes only the loaded tip; the two findings are traceable through production consumers, without executing target code. Is this the best way to solve the issue? Separating bounded read pages from live delta/outbox ownership is coherent, but presentation visibility and reaction eligibility must consume the newly loaded history. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f091e80650aa. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1633, Tests +545, Docs +1. Total +2179 across 40 files. Added test files: 4. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 14, 2026, 12:31 PM ET / 17:31 UTC. |
|
Closing: #200592 (
This branch was built on the pre-#200592 transcript ( |
Related: #192232
Stacked on #192232 (Marvinthebored) at
d3363988721e329abce8d2d6dbd6db51b82f120e, open and not modified. The publisher squashed that head, merged cleanly withmain1ac07b333, plus the authored change into one commit, so #192232's changes appear here: do not merge before #192232; rebase after it lands. Authored delta only:git diff $(git merge-tree --write-tree d3363988721e329abce8d2d6dbd6db51b82f120e 1ac07b333) f1a51ca1d6b9930a6bce819a80f9e73f332f7b79.What Problem This Solves
Native iOS chat shows only the latest history page; older messages cannot be loaded, so long conversations are cut off at the top.
User Impact
Scrolling toward the top of a chat loads earlier messages automatically, and the message you are reading stays exactly where it was. A small, localized Show earlier messages control at the top of the transcript appears only when older history exists; it covers chats too short to scroll and is reachable by VoiceOver and Switch Control as an ordinary button. At most three earlier pages stay in memory: the farthest page is dropped and reloaded on return, and returning to the latest message releases them. Grouping, word fade, sidebar animation and live-edge behavior are unchanged.
Draft for the Mac verification loop: native build, tests, screenshots and performance are pending; no Swift toolchain was available, so no Swift test has run.
Why This Change Was Made
Native chat discarded the
olderCursor/newerCursor/windowResetfieldschat.historyalready returns; the iOS transport already forwards opaque cursors. No Gateway protocol change.ChatOlderHistorykeeps the pages read above the live tip. The live delta/outbox owner keeps the tip; a full tip read only reports its new first row and boundary, so trimmed rows join the newest page. A tip that no longer reaches the pages ends them rather than showing a gap.windowResetmeans the boundary is unusable, not exhausted: pages and boundary drop until the next full tip read.limit ?? 200,src/gateway/server-methods/chat-history-handler.ts) under the iOS transport's existing 256 KiB cursor budget. The resident window is three read pages (≤600 rows, ≤768 KiB of page payload) beside the tip. One action reads at most three consecutive pages that add no visible rows, matching Control UI (docs/web/control-ui.md).newerCursor, drops the farthest page above, and reattaches at the tip. Jump to latest or sending returns to the tip.ChatReaderPageAnchorrecords realized rows' content positions before a page change and, after List lays it out (a scroller layout sentinel, since equal-height swaps keep the content size), shifts the offset by their content-relative move. It never undoes the reader's scrolling and ends once settled; at the live edge the existing follower owns the offset.Accepted edge cases and integration points
Accepted edge cases (rare, recoverable):
Integration points with frozen drafts (not edited):
readerPresentationMessagesstitchesolderHistory.presentation(tail:)(an input to its prepared transcript);runGroupshides live content while detached; iOS cells get.chatReaderRowMarker.onChange(of: scroll.followTarget)releases pages at the live edge;handleTranscriptDistanceChangeignores a detached window's bottom; the control is the first List row.decodeMessageson the main actor; join its decode phase, then recheckownsHistoryPageRead.invalidateHistoryCursordiscards pages; a proven same-conversation handoff may keep them.Evidence
Checked here:
pnpm native:i18n:verify:changed=falseafter baseline.Authored, not run (no Swift toolchain here):
ChatOlderHistoryTests: boundary decoding, seam stitching across tip slide/gap, snapshot de-duplication, three-page eviction/reread/reattach, replaced-session and moved-boundary reads discarded,windowResetending pages (not exhaustion).--openclaw-paged-history-fixture: accessible labeled button in a two-row chat loads the page above; a held page lands above the reader's row within 1 pt.Pending Mac verification
At
f1a51ca1d6b9930a6bce819a80f9e73f332f7b79with Xcode/Swift 6.3 and a task-owned simulator:Red controls, in a separate checkout of this head (build failures don't count): (1) restore
ChatView.swiftto the dependency head — both new UI tests must fail; (2) remove only the.chatReaderRowMarker(...)line — the reader-place test must fail withREADER_ROW_MOVED_WHEN_PAGE_LANDED.Screenshots pending: before/after of the top of a long chat, the Show earlier messages control visible, the transcript after a page loads (reader row unchanged), and VoiceOver focus on the control.
Performance pending: on the 2,000-row fixture (
--openclaw-screenshot-mode --openclaw-initial-tab chat --openclaw-initial-destination chat --openclaw-paged-history-fixture) and a long real Gateway chat, scroll from latest to first and back. Record offset drift per page landing (≤1 pt), resident rows (tip + ≤600), peak memory and Animation Hitches versus the dependency head on the same device; include detached-window scrolling and VoiceOver activation.Contributor credit: Vyctor Brzezowski and Mike Nguyen.
Work sessions
Linked for team reference; these sessions aren’t public.
Worked on by