Skip to content

fix(ui): retain the reader position through history measurements - #200482

Merged
steipete merged 5 commits into
mainfrom
fix/discord-capture-ipc-fence-2518
Nov 20, 2026
Merged

steipete merged 5 commits into
mainfrom
fix/discord-capture-ipc-fence-2518

Conversation

@steipete

@steipete steipete commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Related: #200320, #200343, #199080, #202347

What Problem This Solves

Cached-history refresh can visibly move the reader while predecessor measurements and DOM commits arrive at different times. The hourly UI run 44736390881 captured a transient 22 px shift in the active-reload long-reply case.

User Impact

Readers keep their place while history settles. Explicit navigation, held touch, structural prepend admission and end-following retain their existing behavior. The accompanying mobile wizard test measures both bounds in one browser evaluation, avoiding a comparison across layout frames.

Why This Change Was Made

Relative scroll correction can run before the pending DOM update commits. This change uses the existing absolute message-anchor owner to retain the reader and restore it against committed geometry. Restoration proceeds once the DOM commits, while the target remains retained until measurement receipts settle. There is no new cache, configuration or scroll owner. The production delta is +15 lines (+40/-25).

Rebased on b084c7f9cc485591ad1607f452be4616145a5e8b, preserving main's private fields. The former Discord IPC change was dropped because #200983 already supersedes it. The separate attachment-menu 54 px offset from the hourly run is already fixed on main by #202463; its cause was layout containment introduced by #202325.

Evidence

Current reviewed head: ae5e068d3c060.

  • A deterministic held-refresh regression fails on exact main production at 22 px and passes on this change at 0 px, with the original 1 px assertion unchanged. After settlement, scrollTop changes from 499 to 477 and the retained row remains at y=1. Thanks @daniel-lxs for the regression in fix(ui): keep the reader’s place while chat refreshes #202347; this adaptation queries live rows after commit because prepared nodes can be replaced.
  • 18 prepend-owner tests and 46 reader/content/geometry browser tests pass. The final expanded geometry file passes all 33 cases; its final mechanical lint correction also passes the held-refresh case and targeted lint.
  • All 25 bundled snapshot, history-prepend and wizard E2Es pass (61.09 s). The original snapshot and attachment files pass 20/20 on current main; that confirms the existing attachment repair but does not disprove the intermittent reader defect.
  • Cumulative Codex autoreview is clean after correcting a stale retained-node assertion; the final Promise-executor cleanup is independently reviewed clean.
  • pnpm check:changed --base b084c7f9cc485 ran. Introduced line-cap and lint failures were corrected and their targeted checks pass. The remaining unused OAuthLoginCallbacks export fails identically on exact main parent b084c7f9cc485, introduced by refactor(auth): give OAuth contracts a pure type owner #202443 / e5b085abf795261d61f4bf5f72698359d85bfe54. This is an identified main regression, not a passing cumulative check; the other 23 gates passed.

The older first retention revision caused a separate 91 px activity regression by delaying restoration after DOM commit. The committed-context correction remains in this rebased patch, and the affected activity E2Es pass. Earlier CI and measurements remain historical; exact-head CI 44743187868 succeeded: 41 passed, 28 skipped, 0 failed, including all ten UI E2E shards and both real-Gateway lanes. No CI rerun or admin exception was needed. Final-head ClawSweeper review completed with zero findings and zero unchecked items.

Visual evidence

Verified before/after proof includes clean and annotated images, all four rendered and inspected on the published PR. These are the actual transcript component with synthetic rows during a held Solid action; they are bounded component timing evidence, not a natural ResizeObserver or live-Gateway recording. No user data is present.

Main: 22 px movement Candidate: 0 px movement
Before: reader moves during refresh After: reader holds its position

Measured cost

Reusing the prior lane's production-shaped synthetic experiment: 390 sessions, 80 saved messages, two history rounds, five counterbalanced comparison pairs per mode plus separate A/A controls. The interval excludes held boot/setup. CPU is renderer threadTicks; allocation samples the main isolate at 32 KiB. These are historical pre-rebase measurements, not new exact-head performance results.

Metric Baseline median Candidate median Median paired change
Elapsed ms 855.600 816.800 +22.700
Renderer task CPU ms 864.103 814.791 +10.716
Sampled allocation bytes 108,080,660 108,821,624 −388,248

A/A wall changes −5.22%/+2.41% and allocation changes −20.18%/−0.327% show substantial variability. Lower unpaired medians do not establish a speedup or allocation gain. This owner does not scan agent databases or workspaces; no Team data was accessed.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Nov 17, 2026
@clawsweeper

clawsweeper Bot commented Nov 17, 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.

@steipete
steipete marked this pull request as ready for review November 17, 2026 07:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T13:21:16.589212Z ae5e068 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 17, 2026
@clawsweeper

clawsweeper Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR retains the visible message through pending history measurements, restores its position after DOM commit, and makes mobile wizard test measurements atomic.

Example: A prepared predecessor measures 98 px instead of its estimated 120 px while a history refresh holds the displayed transcript.

  • Before: The controlled regression reports 22 px of reader displacement.
  • After: The supplied component comparison reports 0 px displacement, with scrollTop settling from 499 to 477.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused repair with useful controlled browser evidence and no concrete finding, limited by incomplete shipped-entry-point proof.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Readers briefly lose their place when predecessor measurements arrive while refreshed transcript DOM remains pending.
Reason: Stable reading position is an existing contract, and the maintainer-authored direction repairs a demonstrated timing defect without adding configuration or another scroll owner.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: current main retains the reader-position timing gap, and the patch repairs it through the existing anchor owner without a concrete introduced correctness defect.

Priority: P2
Reviewed head: ae5e068d3c060b666bb7fa55c2c0925a14bfe893

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Show the held-refresh reader correction through the built Control UI with natural measurement delivery; the supplied component regression reports base-red/head-green behavior but does not exercise that shipped entry point.
Agent review details

How this fits together

The Control UI transcript combines virtual row measurements, native scrolling, and Solid DOM commits; its existing reader and message anchors translate changing geometry into a stable visible reading position.

flowchart TD
  A[Row measurements] --> B[Transcript virtualizer]
  B --> C[Reader anchor]
  C --> D[Retained message anchor]
  B --> E[Solid DOM commit]
  E --> D
  D --> F[Native scroll position]
Loading

Technical review

Best possible solution:

Use the existing message-anchor owner to retain the reader until measurements settle and restore only against committed geometry, selecting one repair for the canonical report.

Do we have a high-confidence way to reproduce the issue?

The source and supplied red/green component regression establish the controlled held-refresh failure, but a high-confidence natural product trigger has not been demonstrated; this review ran no target code.

Is this the best way to solve the issue?

The patch addresses premature compensation at the existing owners, preserves relative fallback and touch handling, and adds distinct retention, settlement, and pending-frame coverage without unnecessary production machinery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 238160cf99b2.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 113d624 adds ui/src/pages/chat/components/chat-transcript-reader-anchor.ts:489 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 113d6243f360; files: ui/src/pages/chat/components/chat-transcript-reader-anchor.ts)
  • Daniel: Raw commit 97dd78c adds ui/src/pages/chat/components/chat-transcript-reader-anchor.ts:483 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 97dd78cc2cbd; files: ui/src/pages/chat/components/chat-transcript-reader-anchor.ts)
  • Josh Lehman: Raw commit d70f835 adds ui/src/pages/chat/components/chat-transcript-prepend-anchor.ts:25 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d70f83517220; files: ui/src/pages/chat/components/chat-transcript-prepend-anchor.ts)
  • RoboClaw: Raw commit 0d67d5e adds ui/src/pages/chat/components/chat-transcript-prepend-anchor.ts:53 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 0d67d5e156b1; files: ui/src/pages/chat/components/chat-transcript-prepend-anchor.ts)

PR surface

Source +15, Tests +131. Total +146 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 40 25 +15
Tests 5 144 13 +131
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 184 38 +146

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.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #202344
Summary: The canonical report and both candidate PRs share the controlled predecessor-measurement versus held-DOM timing failure.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: Transient displacement disrupts reading older chat history without established message loss or a blocked core workflow.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 (4 earlier review cycles)
  • reviewed 2026-11-17T07:52:25.464Z sha e817bf5 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-17T08:51:46.351Z sha 9757321 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-17T12:23:11.531Z sha c4fbf9a :: needs maintainer review before merge. :: none
  • reviewed 2026-11-17T14:15:39.309Z sha ef9b9b2 :: needs maintainer review before merge. :: none

Reviewed November 20, 2026, 8:25 AM ET / 13:25 UTC (Revision 5).

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Nov 17, 2026
@steipete steipete changed the title fix: keep Discord capture checks working with broker IPC fix: keep Discord capture and mobile setup CI checks accurate Nov 17, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

The correction is now at 9757321d64cb5442b5c095ce21809a8ce47f2da1. The cumulative diff preserves the four-line Discord IPC fix and adds the reviewed wizard geometry correction: both right edges and the mobile viewport are read in one browser evaluation, with the original containment inequality and lifecycle assertions intact.

The PR body now includes the controlled resize failure, full corrected wizard pass, cumulative Codex review and its resolved normalization concern, and the actual local check/targeted-lint outcomes. Prior-head CI and review are identified as historical; new-head CI remains required. The previous ClawSweeper report had no open items.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete steipete changed the title fix: keep Discord capture and mobile setup CI checks accurate fix(ui): retain the reader position through history measurements Nov 17, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review the cumulative correction at c4fbf9a37160b7de09fd8ee06c26f2bf554fc68d. The branch and PR body now include the reader-retention fix, its six inspected synthetic frames, all 14 cost pairs, and the retained Discord IPC and atomic wizard fixture repairs.

The existing absolute anchor now separates reader retention from history admission. The measurement caller retains real geometry while preserving relative correction when no target exists. No new state or scheduling policy is introduced. The original all-frame test and probe remain unchanged; 37 final-source focused tests pass, and fresh cumulative Codex review completed two passes without actionable findings.

The body records the observed correctness cost, including median active-interval elapsed 724.4→807.4 ms and renderer task CPU 729.318→802.303 ms, mixed allocation pairs, and bounded native-frame limitations. #199080 introduced the ordinary prepared-row trigger; its historical comparison remained stable, so exact failure onset is unestablished.

The required local aggregate remains exit 1: formatting was corrected by its exact leaf, and the remaining complete 3-production/1-full-tree export set matches the qualified exact parent. This is not a hosted-CI waiver. New-head CI and this final-head review remain landing gates; the prior 975 review applies only to that older source.

@clawsweeper

clawsweeper Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Nov 17, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review final head ef9b9b23a8334b3eedfa52d86d0afa871f91cbfa. The committed-geometry correction and parked-row fixture move are published, and the PR body now records the current proof, measured cost and unresolved media-delivery limitation.

@clawsweeper

clawsweeper Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Nov 17, 2026
@steipete

steipete commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Fresh visual evidence for the rebased reader fix. These are the real transcript component with synthetic rows, using the held-refresh regression adapted from #202347 (@daniel-lxs). The test delivers a measured predecessor height while a Solid action holds the displayed window; it does not reproduce natural ResizeObserver scheduling. The unchanged 1 px assertion fails on main with 22 px movement and passes with the candidate at 0 px. After settlement, scrollTop changes from 499 to 477 and the retained row stays at y=1.

Before: main b084c7f9cc485. After: production source 74f1ee6ca3075. The new regression queries the live predecessor after commit because the old element can be replaced. All 33 geometry cases and the separate 25 bundled snapshot/prepend/wizard E2Es pass. These component captures are bounded timing evidence, not a live-Gateway recording.

Clean comparison

Before After
Before: retained text moves 22 px After: retained text stays in place

Annotated comparison

Before After
Before: measured reader displacement After: no measured displacement

steipete and others added 2 commits November 20, 2026 05:12
Add the deterministic 22px predecessor-measurement regression from #202347,
using live row lookup after commit so replacement DOM does not become a stale
assertion target. Main fails the unchanged 1px limit; retained-reader handling
passes the pending and settled geometry checks.

Co-authored-by: daniel-lxs <[email protected]>
@steipete
steipete force-pushed the fix/discord-capture-ipc-fence-2518 branch from ef9b9b2 to ae5e068 Compare November 20, 2026 13:18
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Rebased and reviewed head ae5e068d3c060. The previous review has zero open items. The new held-refresh regression reproduces the 22 px reader shift on exact main parent b084c7f9cc485 and passes at 0 px here; no tolerance was loosened. All 33 geometry cases and the 25 bundled snapshot/prepend/wizard E2Es pass. Fresh clean/annotated images now render on this PR, resolving the old media blocker. The body records the separate exact-parent OAuth dead-export regression and historical measurement limits.

@clawsweeper

clawsweeper Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Nov 20, 2026
@steipete
steipete enabled auto-merge (squash) November 20, 2026 13:31
@steipete
steipete merged commit e44a7e3 into main Nov 20, 2026
114 of 117 checks passed
@steipete
steipete deleted the fix/discord-capture-ipc-fence-2518 branch November 20, 2026 13:40
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

roboclaw-bot added a commit that referenced this pull request Nov 21, 2026
Merge main ce30eda to include the existing cached-reader repair e44a7e3 (#200482) for the named checks-ui-e2e (1/4) failure. This changes the failed gate input rather than retrying its old red job.

Resolve the workerStarted conflict by retaining main's pool-diagnostic arguments and unconditional SQLite admission exit tracking. The PR-only delta remains the original two-file Code Mode cleanup repair.

Co-authored-by: vincentkoc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 21, 2026
…nclaw#200482)

* test(ui): measure mobile wizard containment atomically

* fix(ui): retain the reader through pending history measurements

* fix(ui): restore retained reader geometry after commit

* test(ui): prove reader retention across held history refresh

Add the deterministic 22px predecessor-measurement regression from openclaw#202347,
using live row lookup after commit so replacement DOM does not become a stale
assertion target. Main fails the unchanged 1px limit; retained-reader handling
passes the pending and settled geometry checks.

Co-authored-by: daniel-lxs <[email protected]>

* test(ui): avoid returning the animation handle from promise executor

---------

Co-authored-by: daniel-lxs <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M 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