Repository navigation
chore(ios): measure chat scroll and streaming stability on the simulator - #198293
Conversation
|
🦞👀 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 maintainer review before merge. What this changesAdds an opt-in iOS simulator harness that measures chat movement, row remounts, keyboard transitions, and relaunch behavior. Example: A streamed reply moves upward 42 points when its final message replaces the live bubble.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR provides useful simulator regression coverage, and the previously reported blockers are resolved. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe runner drives the simulator against an isolated Gateway and scripted QA provider, then grades geometry and lifecycle events recorded by the Debug-only chat probe. flowchart LR
Runner[Simulator runner] --> App[iOS Debug app]
App --> Gateway[Isolated Gateway]
Gateway --> Mock[QA mock provider]
Mock --> Gateway
App --> Probe[Opt-in geometry probe]
Probe --> Grader[Behavior grader]
Grader --> Report[Metrics and gate report]
Technical reviewBest possible solution: Retain the opt-in measurement harness while delivering runtime scrolling repairs through the separate stacked PR. Do we have a high-confidence way to reproduce the issue? This PR adds measurement tooling; its supplied simulator run demonstrates the intended known-bug and guard cases, and no target code was executed during this read-only review. Is this the best way to solve the issue? The runner reuses existing simulator pairing and QA response generation, while the probe observes the production chat view without taking ownership of scrolling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against afa871c6e916. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +310, Tests +86, Docs +49, Config +1, Other +877. Total +1323 across 14 files. Added test files: 1. 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 HistoryReview history (2 earlier review cycles)
Reviewed November 13, 2026, 10:59 AM ET / 15:59 UTC (Revision 3). |
|
CI note: the These lanes run every qa-lab e2e and changed-extension test because this PR touches |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Maintainer override: the four red jobs on This PR changes iOS Swift (DEBUG-only probe),
|
|
Landed as 858b5b0. |
…finish (#198326) ## What Problem This Solves Fixes: with the keyboard up, a long reply streams below the composer and the reader never sees it; when it finishes, the view jumps to the end or, in about half the runs, stays blank above the "Done in" line until the user scrolls. With the keyboard hidden, every reply visibly jumps up 42 pt the moment it finishes. ## User Impact Replies stay in view while they stream with the keyboard up, and the finished reply no longer jumps. The "working" status line now sits below the streaming words (where the "Done in" recap appears) instead of above them. ## Why This Change Was Made - **Follow the reply (keyboard up).** The transcript relied on `defaultScrollAnchor(.bottom, for: .sizeChanges)`, which left the scroll offset at 0 while the reply grew thousands of points below the composer; streamed words change no timeline revision, so nothing re-scrolled. The follow modifier now also pins the bottom edge (`ScrollPosition.scrollTo(edge:)`) on every content-height change while following. Edge scrolling does not depend on estimated row heights, and it runs in the modifier, outside the transcript body. - **One update for the swap.** When the saved reply lands, two things used to happen in different layout passes: the bubble hid itself in its own observation scope, and the transcript added the row. Now the transcript decides whether the bubble shows (from the live-content shape it already reads), and `replaceMessages` shows any paced words still held back so the exact-match suppression sees the same text. Before, the saved row and the bubble were on screen together for a frame (11,600 pt of content), and the bottom anchor jumped into the doubled content, which is what left the transcript blank. - **No 42 pt jump.** The working indicator sat above the streaming words and vanished when the reply finished. It now sits below them, so the final row takes the bubble's exact position. - Behavior cases: `stream-turn` and `stream-follow` become guards. `stream-follow` gates on following the reply while it streams; when a row changes height, the grader now reads motion on an edge the reader can see, since a reply taller than the screen can change height above the fold without visible motion. A row that keeps its height still counts as a whole move, so a long reply spanning the screen is still measured (re-grading the last run: `scrolled-up` holds read 0 pt drift with a spanning row in every frame). Known remaining glitch, reported by the harness rather than gated: in about one run in three, as the final row replaces the bubble, the transcript flashes to the top for one or two frames (`LazyVStack` measures the run group at ~0 for one layout pass, and the bottom anchor follows that). In about one run in three the view also ends scrolled away from the reply until the reader scrolls (main: about half). The harness reports both; tracing the finish swap is the follow-up. UI change: cc @vyctorbrzezowski for the working-indicator position. ## Evidence Keyboard up, 6 s into a 12 s reply. Before: the view stays at the top while the reply grows out of sight. After: the newest words sit above the composer. | Before | After | | --- | --- | |  |  | Keyboard hidden. The working status now sits below the streaming words (it was above the first heading), so nothing shifts when the reply finishes. | Before | After | | --- | --- | |  |  | `pnpm ios:behavior`, iPhone 17 simulator, 3 samples per case: | Case | Kind | Gates (3 samples) | | --- | --- | --- | | `stream-turn` | guard | all 3/3 | | `stream-follow` | guard | all 3/3 (reply followed while streaming) | | `scrolled-up` | guard | all 3/3 | | `keyboard` | guard | all 3/3 | | `relaunch` | guard | all 3/3 | Exit 0 with this PR's grading. Reported, not gated: in 2 of 3 `stream-follow` samples the reply ended scrolled away from view after it finished (the known finish glitch below). On `main` (with #198293) the same `stream-follow` follow gate fails in every sample (p95 ~5,600 pt hidden) and `stream-turn` drifts 42 pt in every sample. - New regression test `a durable reply retires the live bubble while pacing holds its last words` fails on the base and passes here; `ChatStreamPresentationTests` and `ChatStreamReplayTests` pass. - `test/scripts/ios-behavior-grade.test.ts`: 6 passed. tsgo, oxlint, SwiftFormat, SwiftLint, native i18n inventory: clean. Merge danger: two-way door. Revert restores the previous scroll and indicator behavior; no state, config or protocol change. Blast radius: the shared chat transcript on iOS and macOS. Co-authored-by: Ayaan Zaidi <[email protected]>
* fix(ci): keep unused dependency exports module-private The check-dependencies job reported six unused exports. Keep the five unclaimed implementation details private without changing their behavior; PR #198306 by vincentkoc covers the separate release waiver table, which remains untouched here. QA_UX_STREAM_END_MARKER and TELEPORT_PT were introduced by #198293. adoptTelegramDmTopicMessage and TELEGRAM_DM_TOPIC_ADOPT_WINDOW_SEC came from #169444; migrate their direct tests to adoptTelegramDmTopicUpdate and retain the explicit three-second accepted/four-second rejected window. ChatModelRuntimeControl came from #192137 and keeps its local renderer. Pinned formatting passes and independent P0-P2 review is clean. Named tests could not collect without runtime dependencies; scoped lint could not start with a wrapper import outside the requested sparse checkout. Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]> * fix(ci): unused exports fail the dependency check Worked on by: - @obviyus - @steipete Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 3bcacc77-7216-8f2e-9e43-4c1cf827724f --------- Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]>
…tor (openclaw#198293) ## What Problem This Solves There is no repeatable way to see whether the iOS chat transcript jumps, drifts or rebuilds rows while a reply streams, while the reader is scrolled up, when the keyboard moves, or after a relaunch. Chat jank reports could only be checked by eye. ## User Impact No user-visible change. Developers and agents get `pnpm ios:behavior`, which drives the real app on a simulator against an isolated Gateway with a scripted model and prints position and count gates per case. ## Why This Change Was Made - **Scripted model:** the QA `mock-openai` provider gains a paced reply (`UXSTREAM chunks=<n> interval=<ms>`): mixed markdown deltas written that far apart, so every run streams the same reply. - **Probe:** `ChatBehaviorProbe.swift` records, only in DEBUG builds launched with `--openclaw-behavior-probe`, the on-screen top and bottom of each tagged row, the live bubble and the composer on every frame where something moved, plus mounts, scroll phases, bubble body evaluations, sends and keyboard show/hide. Release builds compile it out; other DEBUG launches skip it. - **Runner:** `scripts/ios-behavior.mts` pairs a fresh simulator through onboarding, runs five cases three times each and deletes the simulator. Each case is a `guard` (every gate passes in every sample) or `bad` (reproduces an open bug in at least one sample); there is no majority vote. Gates are positions and counts, not wall-clock limits; times are reported for A/B comparison only. Prompts are pasted, never typed: typing through a UI driver makes iOS treat the simulator as having a hardware keyboard and hide the software one for good. - Docs: `.agents/skills/ios-e2e/BEHAVIOR.md`. Two cases are `bad` on `main` and stay that way until the fix PR flips them: - `stream-follow`: with the keyboard up, the growing reply is not followed. It streams up to ~5,700 pt below the composer, then either jumps to the end or, in about half the runs, leaves the transcript blank above the "Done in" recap until the user scrolls. The follow relies on `defaultScrollAnchor(.bottom, for: .sizeChanges)`, which does not hold a growing `LazyVStack`, and streamed words change no timeline revision, so nothing re-pins. - `stream-turn`: when a reply finishes, its final row replaces the live bubble 42 pt higher, so the reply visibly jumps up. `relaunch` also reports an intermittent jump (about 1 in 3 cold launches shows the top of history for one frame); it is a reported metric, not a gate, because it does not reproduce reliably. ## Evidence Full run on this branch (main `04a926c7ada` behavior), iPhone 17 simulator, 3 samples per case: | Case | Kind | Gates not passing in every sample | | --- | --- | --- | | `stream-turn` | bad | sent turn holds still, reply included (≤1 pt) 0/3 | | `stream-follow` | bad | no teleports 2/3; no backward motion (≤1 pt) 2/3; end in view (≤4 pt hidden) 1/3 | | `scrolled-up` | guard | all gates 3/3 | | `keyboard` | guard | all gates 3/3 | | `relaunch` | guard | all gates 3/3 | Exit 0: guards pass, both bad cases still reproduce. - `pnpm test test/scripts/ios-behavior-grade.test.ts`: 5 passed (grader boundaries: teleport and backward motion, sub-point rounding, live-bubble handoff, user-drag exclusion, remounts). - `extensions/qa-lab/src/providers/mock-openai`: 13 files, 200 tests passed. - `tsgo:scripts`, `tsgo:extensions`, oxlint, oxfmt, SwiftFormat and SwiftLint at the repo pins, iOS Debug simulator build: clean. The probe is `#if DEBUG && os(iOS)`; macOS compiles the no-op branch (left to CI). - Gap: absolute timing, hitches and hangs need a physical device; this harness reports simulator times for A/B only. No overlap with Pash/Sarah changes: the only shared file is root `package.json`, which gains one script. Merge danger: two-way door. Revert removes the script, probe and mock scenario; no state, config or published contract changes. Blast radius: DEBUG builds launched with the probe flag, and QA mock prompts containing `UXSTREAM`. Co-authored-by: Ayaan Zaidi <[email protected]>
…finish (openclaw#198326) ## What Problem This Solves Fixes: with the keyboard up, a long reply streams below the composer and the reader never sees it; when it finishes, the view jumps to the end or, in about half the runs, stays blank above the "Done in" line until the user scrolls. With the keyboard hidden, every reply visibly jumps up 42 pt the moment it finishes. ## User Impact Replies stay in view while they stream with the keyboard up, and the finished reply no longer jumps. The "working" status line now sits below the streaming words (where the "Done in" recap appears) instead of above them. ## Why This Change Was Made - **Follow the reply (keyboard up).** The transcript relied on `defaultScrollAnchor(.bottom, for: .sizeChanges)`, which left the scroll offset at 0 while the reply grew thousands of points below the composer; streamed words change no timeline revision, so nothing re-scrolled. The follow modifier now also pins the bottom edge (`ScrollPosition.scrollTo(edge:)`) on every content-height change while following. Edge scrolling does not depend on estimated row heights, and it runs in the modifier, outside the transcript body. - **One update for the swap.** When the saved reply lands, two things used to happen in different layout passes: the bubble hid itself in its own observation scope, and the transcript added the row. Now the transcript decides whether the bubble shows (from the live-content shape it already reads), and `replaceMessages` shows any paced words still held back so the exact-match suppression sees the same text. Before, the saved row and the bubble were on screen together for a frame (11,600 pt of content), and the bottom anchor jumped into the doubled content, which is what left the transcript blank. - **No 42 pt jump.** The working indicator sat above the streaming words and vanished when the reply finished. It now sits below them, so the final row takes the bubble's exact position. - Behavior cases: `stream-turn` and `stream-follow` become guards. `stream-follow` gates on following the reply while it streams; when a row changes height, the grader now reads motion on an edge the reader can see, since a reply taller than the screen can change height above the fold without visible motion. A row that keeps its height still counts as a whole move, so a long reply spanning the screen is still measured (re-grading the last run: `scrolled-up` holds read 0 pt drift with a spanning row in every frame). Known remaining glitch, reported by the harness rather than gated: in about one run in three, as the final row replaces the bubble, the transcript flashes to the top for one or two frames (`LazyVStack` measures the run group at ~0 for one layout pass, and the bottom anchor follows that). In about one run in three the view also ends scrolled away from the reply until the reader scrolls (main: about half). The harness reports both; tracing the finish swap is the follow-up. UI change: cc @vyctorbrzezowski for the working-indicator position. ## Evidence Keyboard up, 6 s into a 12 s reply. Before: the view stays at the top while the reply grows out of sight. After: the newest words sit above the composer. | Before | After | | --- | --- | |  |  | Keyboard hidden. The working status now sits below the streaming words (it was above the first heading), so nothing shifts when the reply finishes. | Before | After | | --- | --- | |  |  | `pnpm ios:behavior`, iPhone 17 simulator, 3 samples per case: | Case | Kind | Gates (3 samples) | | --- | --- | --- | | `stream-turn` | guard | all 3/3 | | `stream-follow` | guard | all 3/3 (reply followed while streaming) | | `scrolled-up` | guard | all 3/3 | | `keyboard` | guard | all 3/3 | | `relaunch` | guard | all 3/3 | Exit 0 with this PR's grading. Reported, not gated: in 2 of 3 `stream-follow` samples the reply ended scrolled away from view after it finished (the known finish glitch below). On `main` (with openclaw#198293) the same `stream-follow` follow gate fails in every sample (p95 ~5,600 pt hidden) and `stream-turn` drifts 42 pt in every sample. - New regression test `a durable reply retires the live bubble while pacing holds its last words` fails on the base and passes here; `ChatStreamPresentationTests` and `ChatStreamReplayTests` pass. - `test/scripts/ios-behavior-grade.test.ts`: 6 passed. tsgo, oxlint, SwiftFormat, SwiftLint, native i18n inventory: clean. Merge danger: two-way door. Revert restores the previous scroll and indicator behavior; no state, config or protocol change. Blast radius: the shared chat transcript on iOS and macOS. Co-authored-by: Ayaan Zaidi <[email protected]>
* fix(ci): keep unused dependency exports module-private The check-dependencies job reported six unused exports. Keep the five unclaimed implementation details private without changing their behavior; PR openclaw#198306 by vincentkoc covers the separate release waiver table, which remains untouched here. QA_UX_STREAM_END_MARKER and TELEPORT_PT were introduced by openclaw#198293. adoptTelegramDmTopicMessage and TELEGRAM_DM_TOPIC_ADOPT_WINDOW_SEC came from openclaw#169444; migrate their direct tests to adoptTelegramDmTopicUpdate and retain the explicit three-second accepted/four-second rejected window. ChatModelRuntimeControl came from openclaw#192137 and keeps its local renderer. Pinned formatting passes and independent P0-P2 review is clean. Named tests could not collect without runtime dependencies; scoped lint could not start with a wrapper import outside the requested sparse checkout. Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]> * fix(ci): unused exports fail the dependency check Worked on by: - @obviyus - @steipete Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 3bcacc77-7216-8f2e-9e43-4c1cf827724f --------- Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]>
What Problem This Solves
There is no repeatable way to see whether the iOS chat transcript jumps, drifts or rebuilds rows while a reply streams, while the reader is scrolled up, when the keyboard moves, or after a relaunch. Chat jank reports could only be checked by eye.
User Impact
No user-visible change. Developers and agents get
pnpm ios:behavior, which drives the real app on a simulator against an isolated Gateway with a scripted model and prints position and count gates per case.Why This Change Was Made
mock-openaiprovider gains a paced reply (UXSTREAM chunks=<n> interval=<ms>): mixed markdown deltas written that far apart, so every run streams the same reply.ChatBehaviorProbe.swiftrecords, only in DEBUG builds launched with--openclaw-behavior-probe, the on-screen top and bottom of each tagged row, the live bubble and the composer on every frame where something moved, plus mounts, scroll phases, bubble body evaluations, sends and keyboard show/hide. Release builds compile it out; other DEBUG launches skip it.scripts/ios-behavior.mtspairs a fresh simulator through onboarding, runs five cases three times each and deletes the simulator. Each case is aguard(every gate passes in every sample) orbad(reproduces an open bug in at least one sample); there is no majority vote. Gates are positions and counts, not wall-clock limits; times are reported for A/B comparison only. Prompts are pasted, never typed: typing through a UI driver makes iOS treat the simulator as having a hardware keyboard and hide the software one for good..agents/skills/ios-e2e/BEHAVIOR.md.Two cases are
badonmainand stay that way until the fix PR flips them:stream-follow: with the keyboard up, the growing reply is not followed. It streams up to ~5,700 pt below the composer, then either jumps to the end or, in about half the runs, leaves the transcript blank above the "Done in" recap until the user scrolls. The follow relies ondefaultScrollAnchor(.bottom, for: .sizeChanges), which does not hold a growingLazyVStack, and streamed words change no timeline revision, so nothing re-pins.stream-turn: when a reply finishes, its final row replaces the live bubble 42 pt higher, so the reply visibly jumps up.relaunchalso reports an intermittent jump (about 1 in 3 cold launches shows the top of history for one frame); it is a reported metric, not a gate, because it does not reproduce reliably.Evidence
Full run on this branch (main
f86e06de8c7behavior), iPhone 17 simulator, 3 samples per case:stream-turnstream-followscrolled-upkeyboardrelaunchExit 0: guards pass, both bad cases still reproduce.
pnpm test test/scripts/ios-behavior-grade.test.ts: 5 passed (grader boundaries: teleport and backward motion, sub-point rounding, live-bubble handoff, user-drag exclusion, remounts).extensions/qa-lab/src/providers/mock-openai: 13 files, 200 tests passed.tsgo:scripts,tsgo:extensions, oxlint, oxfmt, SwiftFormat and SwiftLint at the repo pins, iOS Debug simulator build: clean. The probe is#if DEBUG && os(iOS); macOS compiles the no-op branch (left to CI).No overlap with Pash/Sarah changes: the only shared file is root
package.json, which gains one script.Merge danger: two-way door. Revert removes the script, probe and mock scenario; no state, config or published contract changes. Blast radius: DEBUG builds launched with the probe flag, and QA mock prompts containing
UXSTREAM.