Skip to content

chore(ios): measure chat scroll and streaming stability on the simulator - #198293

Merged
obviyus merged 5 commits into
mainfrom
ios-ux-harness
Nov 13, 2026
Merged

obviyus merged 5 commits into
mainfrom
ios-ux-harness

Conversation

@obviyus

@obviyus obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

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 f86e06de8c7 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.

@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Nov 13, 2026
@obviyus
obviyus marked this pull request as ready for review November 13, 2026 13:56
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 13, 2026
@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Adds 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.

  • Before: Developers assess the jump by eye.
  • After: The stream-turn case measures the displacement and reports the stationary-turn gate failing.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful tooling with real simulator exercise, focused independent grader coverage, and all prior findings addressed.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied pnpm ios:behavior run exercises the real simulator app through an isolated Gateway and paced QA provider, reporting the expected known failures and passing guards; inspected images corroborate the scenarios rather than the grader's numerical results.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Developers cannot repeatably quantify native chat jumps, drift, and remounts across streaming and keyboard transitions.
Reason: The maintainer-authored direction has concrete value demonstrated by two measured failures and the separate runtime repair that consumes the harness.

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
Reviewed head: e410bff30144c3c64a019e6b0b9bf1c480c4e5fb

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 32527d0 adds .agents/skills/ios-e2e/SKILL.md:8 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 32527d0af043; files: .agents/skills/ios-e2e/SKILL.md)

PR surface

Source +310, Tests +86, Docs +49, Config +1, Other +877. Total +1323 across 14 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 8 317 7 +310
Tests 1 86 0 +86
Docs 2 50 1 +49
Config 1 1 0 +1
Generated 0 0 0 0
Other 2 877 0 +877
Total 14 1331 8 +1323

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Repeatable native chat measurements provide useful regression coverage without changing normal app behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-11-13T14:15:11.056Z sha 9a8c2db :: needs changes before merge. :: [P2] Carry the frame at the window boundary into motion grading | [P2] Preserve prior mounts when counting remounts during the hold | [P2] Keep probe identifiers out of native string discovery
  • reviewed 2026-11-13T15:45:08.543Z sha 6cc0a6a :: needs changes before merge. :: [P2] Cite the incident behind the new keyboard-input rule

Reviewed November 13, 2026, 10:59 AM ET / 15:59 UTC (Revision 3).

@clawsweeper clawsweeper Bot removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 13, 2026
@obviyus

obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

CI note: the checks-node-changed-17, -23, -extensions-bundle-36 and -4-3 failures are not from this change.

These lanes run every qa-lab e2e and changed-extension test because this PR touches extensions/qa-lab. Locally, test/e2e/qa-lab/runtime/gateway-timeout-recovery-subagent.e2e.test.ts fails the same way (expected [ …(2) ] to deeply equal [ …(2) ]) with this PR's mock-openai files reverted to the base f86e06de8c7. The other failures are a missing built module (prepared-model-runtime-), a Codex worker readiness test and a browser doctor deep probe, none of which reach the mock's UXSTREAM path (the only behavior this PR adds to the mock).

@obviyus

obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 13, 2026
@obviyus

obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Nov 13, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 13, 2026
@obviyus

obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

Maintainer override: the four red jobs on e410bff come from main, not this PR. Ayaan approved landing past them once that was shown.

This PR changes iOS Swift (DEBUG-only probe), scripts/ios-behavior*, docs, and one new prompt branch in the QA mock-openai provider (UXSTREAM; other prompts dispatch as before).

Job Failing test Evidence
checks-node-changed-23 test/e2e/qa-lab/runtime/gateway-timeout-recovery-subagent.e2e.test.ts Fails on a clean main checkout (af10e5594d3) with the same expected [ …(2) ] to deeply equal [ …(2) ]; also fails on this branch with the mock files reverted to the base.
checks-node-changed-17 test/e2e/qa-lab/runtime/telegram-model-picker-prepared-gateway.e2e.test.ts Fails on clean main (af10e5594d3) with the same Could not resolve built prepared-model-runtime- module.
checks-node-changed-compact-small-10 src/gateway/server.auth.identity-scopes.test.ts Fails 2/2 on clean main (af10e5594d3) with the same assertion; passes 2/2 on this PR's own commit (based on the older f86e06de8c7). CI tests the PR merged into the newer main.
checks-node-changed-extensions-bundle-36 extensions/codex/src/node-app-server.runtime.test.ts Fails 3/3 on clean main (708c37827f8) in a linux/amd64 node:24.22.1 container with CI=true, with the same assertion as CI (exitCode 1 and empty stdout instead of worker-command-proof). It also fails 3/3 on this PR merged into that main, and passes on macOS for both, so the difference is the Linux runner, not this PR. The test imports nothing this PR changes.

@obviyus
obviyus merged commit 858b5b0 into main Nov 13, 2026
251 of 257 checks passed
@obviyus
obviyus deleted the ios-ux-harness branch November 13, 2026 17:13
@obviyus

obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as 858b5b0. pnpm ios:behavior now measures how the iOS chat transcript moves (streaming, scrolled up, keyboard, relaunch) against a scripted model on the simulator; stream-turn and stream-follow stay bad cases until #198326 fixes them. Proof: 3-sample simulator runs (guards pass in every sample), grader tests red on the old grader, and the four red CI jobs reproduced on clean main (override comment above).

obviyus added a commit that referenced this pull request Nov 13, 2026
…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 |
| --- | --- |
| ![Before: keyboard up, reply streams out of view](https://github.com/user-attachments/assets/f813c40b-f18c-4207-958a-6c9ac9c5e4ca) | ![After: keyboard up, reply followed](https://github.com/user-attachments/assets/d4df82b4-ae9c-4820-9107-a5f304f8ec37) |

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 |
| --- | --- |
| ![Before: keyboard hidden, status above the reply](https://github.com/user-attachments/assets/22d22a60-3175-4767-9c43-e6a6eac42c38) | ![After: keyboard hidden, status below the reply](https://github.com/user-attachments/assets/c13ee33d-96ff-427f-a0cd-fbf6f0fba347) |

`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]>
roboclaw-bot added a commit that referenced this pull request Nov 14, 2026
* 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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 14, 2026
…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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 14, 2026
…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 |
| --- | --- |
| ![Before: keyboard up, reply streams out of view](https://github.com/user-attachments/assets/f813c40b-f18c-4207-958a-6c9ac9c5e4ca) | ![After: keyboard up, reply followed](https://github.com/user-attachments/assets/d4df82b4-ae9c-4820-9107-a5f304f8ec37) |

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 |
| --- | --- |
| ![Before: keyboard hidden, status above the reply](https://github.com/user-attachments/assets/22d22a60-3175-4767-9c43-e6a6eac42c38) | ![After: keyboard hidden, status below the reply](https://github.com/user-attachments/assets/c13ee33d-96ff-427f-a0cd-fbf6f0fba347) |

`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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 14, 2026
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant