Repository navigation
improve(ios): rebuild the chat transcript around the web reading model - #200592
Conversation
- Page older history through olderCursor with reading-position restore. - Fold completed turns into Worked for <duration>; group adjacent tool rows. - Keep subagent launches visible; show sessions_yield acknowledgments and exit codes. - Full-width assistant replies on one width rule; delete the bubble flags. - File and GitHub chips, session title, agent-name placeholder, readable model label.
|
🦞👀 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: blocked before merge. What this changesRebuilds native chat presentation with older-history paging, grouped work, child-session links, inline references, and revised layout and metadata. Example: Read a 4,414-message conversation initially showing only its latest history page.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 6 items remain Keep this maintainer-authored draft open: it addresses a real history-paging gap and useful native-chat improvements, but five integration defects need repair. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe shared Apple chat model consumes Gateway history and live events, projects transcript rows, and supplies iOS and macOS chat views and message actions. flowchart TD
A[Gateway history and events] --> B[Native chat transport]
B --> C[Shared chat view model]
C --> D[Transcript projection]
D --> E[iOS transcript List]
D --> F[macOS chat]
E --> G[Paging and reading anchors]
Technical reviewBest possible solution: Land paging through the existing chat owners first, then complete the presentation changes while preserving canonical identities, accessible loading, reachable children, and visible failures. Do we have a high-confidence way to reproduce the issue? Current main omits older-page cursors from its history payload despite existing transport support, establishing the central paging gap from source; no target code was executed during this read-only review. Is this the best way to solve the issue? The existing List and shared view model are appropriate owners, pagination is a coherent first stage, and retaining individual launch buttons is smaller and more complete than the added grouped-launch renderer. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8f223d9d5860. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1829, Tests +927. Total +2756 across 52 files. Added test files: 2. 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:
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 17, 2026, 8:15 AM ET / 13:15 UTC. |
…ay visible - One disclosure style: fixed header, rotating chevron, eased content (opacity under Reduce Motion). - Reply details become a context table: prompt budget bar, token rows, this reply's time and cost. - Folds need tool activity in the turn; plain earlier replies stay visible. - Header identity button keeps a 44 pt target.
|
Before/after from the screenshot-mode demo chat (synthetic data). Left:
|
… redraws - ChatReadingPosition is the only iOS writer of the transcript offset; delete ChatReaderRunAnchor, ChatSynchronousFollow, the paging restore and the bottom-pin writer. - Prepends hold the distance from the end so List's own compensation is never counted twice; accepted edge: ~8 pt of fling lost at a mid-fling landing. - SidebarDrawerPanRecognizer owns the drawer: 44 pt leading-edge zone, the transcript pan waits for it; the shell's DragGesture is gone. - Gateway state, link previews, agent name and the drawer flag leave row inputs, so rows redraw only on their own content. - DEBUG behavior probe: offset-writer attribution, signposts, drawer marks; ios:behavior cases for sidebar, sideways swipe, disclosure and prepend; XCTHitchMetric UI test.
- ChatStreamingAssistantTextBody swapped a plain render for a TimelineView whenever a reveal started or caught up, rebuilding the subtree; every streaming list item then restarted its fade. - Keep one TimelineView and pause it while no reveal is pending.
…n window - The early window opened at 80 pt, one content strip when the gap above the reply was blank, so the setup gate failed whenever the reply drew sooner. - Log per-window motion so a failure names the window and the second of the recording.
|
Independent iOS proof — mixed Markdown and images iPhone 17 Simulator, iOS 27.2, native Debug builds from ios-media-before-after.mp4
|
|
Independent iOS proof — text streaming and tablet reading pane Same real isolated Gateway and exact native builds: ios-text-stream-before-after.mp4
On iPad Pro 13-inch Simulator, the same saved mixed-media conversation rendered on both builds. This is the reading-pane crop with the sidebar open during capture; the comparison does not cover rotation or accessibility text sizes. |
|
Independent iOS proof — long-history stress and the remaining scroll movement Candidate Loading older history. Fifteen fast swipes loaded two older pages. The app's behavior probe measured 0 pt beyond the reader's scroll on the first insertion and 5.9 pt on the second. The latter exceeds the harness's 4 pt limit. The probe recorded 0 pt of resting displacement and no teleports in this run. The clip cuts between the two page loads; the offset is measured from the probe, not estimated from the video. ios-history-two-page-loads.mp4Expanding tools. On the same preloaded conversation, the disclosure header stayed in place as the tool rows opened. The harness measured no header drift or unexplained movement of the sampled rows in that window. The fixture includes a tool failure (the intentionally empty workspace has no ios-history-tool-disclosure.mp4The slow automated pagination gesture opened the message context menu on this simulator, so the paging result above comes from the separate fast-swipe run. This is one candidate run, not a physical-device or all-pages claim. The scripted model label is masked in both clips. |
|
Integration retest — prepared locally I reconciled the current-main navigation and nested-tool changes with the redesign, then addressed the independent review findings around loaded history, streaming position, tool order, and child-session links. On iPhone 17 Simulator with a real isolated Gateway, I scrolled back in the 40-turn conversation and sent a new message with the keyboard closed. The new question returned to the viewport and the reply completed. ios-send-from-history-integrated.mp4The tested tree This records a local candidate ( |
|
Merged via squash.
|
openclaw#200592) Use a wider reading column in native iOS chat while keeping the reader's position during streaming, tool disclosures, and older history loads. Keep overlapping history, preserve tool and reply order, and retain access to every launched child session. Integrate with the current sidebar and nested tool handling. A send from an older scroll position returns the new question to view. Co-authored-by: Ayaan Zaidi <[email protected]> Co-authored-by: Vyctor H. Brzezowski <[email protected]>
ChatObscuredPresentation and OpenClawSessionColorDot lost their last uses in c9285dd (#200592). The chat view now applies drawer and scene visibility through ChatPresentationActivity, which reads openClawChatIsObscured itself, and the sidebar no longer draws a session color dot. The shared OpenClawKit Periphery intersection reports both as dead code, so every pull request whose scope triggers that scan fails "Intersect shared OpenClawKit dead code". The dot held the only "Session color" string, so the native string inventory drops that entry.
ChatObscuredPresentation and OpenClawSessionColorDot lost their last uses in d8f4cfa (openclaw#200592). The chat view now applies drawer and scene visibility through ChatPresentationActivity, which reads openClawChatIsObscured itself, and the sidebar no longer draws a session color dot. The shared OpenClawKit Periphery intersection reports both as dead code, so every pull request whose scope triggers that scan fails "Intersect shared OpenClawKit dead code". The dot held the only "Session color" string, so the native string inventory drops that entry.





Problem
On long, tool-heavy sessions the iOS chat fell well short of the web Control UI:
olderCursorwas never decoded, so older pages were never requested.sessions_yieldacknowledgments were hidden under "Tool details". Failed commands showed no exit code.#123appeared instead of file and PR chips.Solution
One transcript model, with the web UI as the guide:
Layout: assistant replies span one reading column, and user messages keep a tinted bubble. One width rule uses the measured pane width
w:min(768, w − 2·margin);This deletes
openClawAssistantBubblesInCleanChrome,openClawAssistantUsesReadingColumn, the assistant card style with its seam drawing, andreadingColumnWidth/usesExpandedLayout/expandedHorizontalMargin.Container: iOS keeps
List(fix(ios): stops chat from going blank after sending a message or a reply arrives #192232).__openclaw.id, thenseq.Tool activity:
chat-turn-presentation.ts).sessions_yieldshows its acknowledgment.Chips: file references and GitHub items in message bodies get chips, following the web markdown rules. PR merge state is not fetched; chips use the web's unknown-state look.
Chrome:
agent.identity.get;Reply footer: relative time. Exact time, duration, tokens, cost, context and model sit behind a tap, like the web tooltip.
Newly decoded fields, all already sent by the Gateway, so there is no schema change:
olderCursor,hasMore,__openclaw.seq,recordTimestampMs,customType,continuation, toolexitCode.References and what we didn't adopt:
Listwith re-anchoring by id.Evidence (draft: more to come)
Real session, iPad 13" simulator: 35 history pages, 4,414 messages, 2,199 tool calls.
Replay: feeding all 35 pages through the view model keeps every one of the 4,414 messages.
Scroll workload (iPad simulator, behavior probe, 120 slow swipes each way):
These numbers predate the scroll-owner change below; prepend behavior is now measured by
prepend-no-jump.OpenClawKit (macOS
swift test): 2,700 of 2,705 pass. The 5 failures are timing tests under full-suite load: 2 audio-player tests that also fail onmain, plus TLS cancellation and canonical-history tests that pass when run alone.iOS unit tests (iPhone 17 simulator): 1,117 pass. The one failure, the audio case of
managed assistant media starts its artifact load with the playback route, also fails onmain: since fix: make incoming audio recordings playable inline #196787 audio loads only after Play is tapped, and the test still expects an automatic load.macOS: the package and test targets build.
Still pending:
ChatScrollPerformanceUITests, dedicated iPhone);Scroll, gesture and redraw ownership
On a phone the transcript bounced on expand/collapse, could scroll while the sidebar opened, and redrew every row on unrelated state changes. Five writers set the scroll offset independently (reader run anchor, synchronous follow, paging restore, bottom-pin
follow, scroll commands), and two gestures (the shell's SwiftUI drag and the transcript's pan) ran at once.ChatReadingPosition(pure policyChatReadingPolicy+ a UIKit adapter on the transcript's collection view) is the only code that writes the transcript offset on iOS.ChatReaderRunAnchor.swift,ChatSynchronousFollow.swift, the paging restore and the bottom-pin writer are deleted. Rules:List's own compensation is never counted twice;SidebarDrawerPanRecognizeropens the sidebar only from a 44 pt leading-edge zone below the nav-bar row; the transcript's pan waits for it to fail. The shell's SwiftUIDragGestureis gone.Accepted edge: when an older page lands mid-fling, the reader's scroll in the ~2 frames where
Listchanges the content is not kept (8.4–8.8 pt measured). ThereList's compensation cannot be told apart from the reader's scroll (it can land before the content height changes); an attempt to observe the offset during that window adoptedList's write and jumped ~1,500 pt, so it was reverted.prepend-no-jumpstays abadcase for this.Measurement tooling (DEBUG, only with
--openclaw-behavior-probe): offset-writer attribution and signposts (ChatScrollInstrumentation), drawer-pan marks, and fourpnpm ios:behaviorcases with gates; plusChatScrollPerformanceUITests(XCTHitchMetric) for device hitch runs.Behavior cases (iPhone 17 simulator, 3 samples each, same seeded 40-turn chat):
sidebar-open-still(edge swipe and button)swipe-right-still(40 pt drift down and up)disclosure-header-stillguardprepend-no-jumpReadingPosition.prependwrite per landing; −8.4 to −8.8 pt on the first prepend, 0 on the second (gate ≤ 4 pt, staysbad)stream-turn(8 samples)The simulator's synthetic drags never start the transcript's own pan, so the sidebar and swipe cases pass on
maintoo: they guard the fix but don't reproduce the device bug. Device hitch numbers are pending on a dedicated iPhone.Offset writers during the prepend case, all samples:
user(reader),system:…UpdateCoalescingCollectionView…(List), andReadingPosition.prepend. No other writer.Streamed list items stopped re-fading.
ChatStreamingAssistantTextBodyswapped a plain render for aTimelineViewwhenever a word reveal started or caught up between chunks. That rebuilt the subtree, and every list item in the streaming reply (each holds its own reveal state) faded in again from zero. On this branch the finished bullets blinked in 2 of 8stream-turnruns (read by the screen check as a 55 pt move);mainhas the same code but didn't trigger it in 5 runs. OneTimelineView, paused while idle, keeps the identity; 8/8 runs clean after.stream-turn's early drawn window now spans three 40 pt strips, so the setup gate stops failing when the reply draws sooner.Impact
macOS shares
OpenClawChatUI: