Repository navigation
fix(control-ui): stop hiding settled chat rows on reload - #170662
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a415cf38b
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| this.lifecycle.afterCommit(() => { | ||
| // Nested row islands finish their commits before initial geometry is read. | ||
| queueMicrotask(() => { |
There was a problem hiding this comment.
Preserve the transcript's layout-settlement phase
Using queueMicrotask here runs initial-position reconciliation before the browser’s layout/ResizeObserver phase. When a row’s geometry settles during that phase—for example after content-visibility, font, image, or custom-element layout—the intrinsic-size comparison can validate the previously written virtual size, clear visibility, and then let the observer correction move the visible transcript. Keep the separate layout-settlement phase, or gate visibility on post-layout geometry rather than commit-time inline styles; the scoped Solid lifecycle guidance explicitly requires that phase.
AGENTS.md reference: ui/AGENTS.md:L5-L7
Useful? React with 👍 / 👎.
3a415cf to
d6f83ea
Compare
## What Problem This Solves Offscreen reply navigation and position-rail jumps can freeze the Control UI renderer. When the target bubble is not mounted, `completeMessageReveal()` scrolls toward its virtual row and unconditionally requests another render. Commit `010435d1635247f39a6a14a05dbe5a8b342da101` (#170662) moved layout completion from a browser frame to a microtask, allowing this loop to starve the native scroll notification needed to advance the virtual range. Remove that redundant render request. The initial reveal still requests an update for folded-work expansion; native scroll notifications, mounted rows, and deferred projection settlement own subsequent progress. Target highlighting, cancellation, and reader-scroll behavior are unchanged. The fast initial-display path remains intact. Accepted edge case: an absent target waits for an actual scroll, row mount, or projection event instead of polling unchanged DOM. No security or data-authority check is removed. ## Evidence - Scheduled baseline: [run 38359584345](https://github.com/openclaw/openclaw/actions/runs/38359584345), source `0348a2526c561d8ccce61bfd23931024a6b8f13e`. UI2/job 115170476315 fails the deep standalone-work reply reveal; UI8/job 115170476361 fails both dark/light position-rail navigation cases and reply-source navigation after reconnect. Diagnostics show a connected, uncrashed browser whose renderer does not respond. - Candidate `5ed8e6c21f2dba67cb0f33d2562b08e099e5e059`: all four original cases pass in [focused hosted run 38364929226/job 115187670047](https://github.com/openclaw/openclaw/actions/runs/38364929226/job/115187670047): dark/light position rail 22.973/22.448 seconds, deep earlier reveal 2.985 seconds, reconnect source navigation 3.574 seconds. Three files, four passed, seven unrelated cases filtered; total Vitest time 83.06 seconds. Source verification confirms the owner and all three test files are unchanged. No assertions, timeouts, retries, or screenshot behavior are weakened. - Changed-file oxfmt, oxlint, and `git diff --check`: passed. No local suite, build, or dependency installation was run. - Codex autoreview: scoped-clean; no actionable P0–P2 findings. Normal commit hooks passed. Focused candidate command (ordinary PR CI omitted these four original cases): ```sh OPENCLAW_UI_E2E_SKIP_REAL_GATEWAY=1 node scripts/run-vitest.mjs run \ --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner --maxWorkers=1 \ ui/src/e2e/chat-collapsed-reply-reveal.e2e.test.ts \ ui/src/e2e/chat-position-rail.e2e.test.ts \ ui/src/e2e/chat-reply-preview-recovery.e2e.test.ts \ -t 'reveals the deep earlier message in standalone work|tracks reader position and keyboard jumps|refreshes the page-carried original after reconnect and keeps source navigation working' \ --reporter=verbose ``` Scope: one file, +2/-1 lines. No SQL or database-worker/T1 call paths change; no SQL harness measurement applies. Ordinary candidate CI [38363444022](https://github.com/openclaw/openclaw/actions/runs/38363444022) passed all 28 selected jobs; 26 were skipped. Required, security, types, lint, architecture and static gates passed. Ratchets remain T1 454 to 454, compatibility calls 9 to 9, all dialect groups 0 to 0. The initial PR-context check required these body headings and was corrected; replacement run 38363572076 passed.
…0662) * perf(control-ui): reveal settled transcript rows without an extra frame * test(control-ui): await committed reply reveal geometry
…w#170789) ## What Problem This Solves Offscreen reply navigation and position-rail jumps can freeze the Control UI renderer. When the target bubble is not mounted, `completeMessageReveal()` scrolls toward its virtual row and unconditionally requests another render. Commit `f17d27e18ccba603bab078885201bd7cf3162fb3` (openclaw#170662) moved layout completion from a browser frame to a microtask, allowing this loop to starve the native scroll notification needed to advance the virtual range. Remove that redundant render request. The initial reveal still requests an update for folded-work expansion; native scroll notifications, mounted rows, and deferred projection settlement own subsequent progress. Target highlighting, cancellation, and reader-scroll behavior are unchanged. The fast initial-display path remains intact. Accepted edge case: an absent target waits for an actual scroll, row mount, or projection event instead of polling unchanged DOM. No security or data-authority check is removed. ## Evidence - Scheduled baseline: [run 38359584345](https://github.com/openclaw/openclaw/actions/runs/38359584345), source `116f0502239e7f1cd4a85f57331f986f616e8939`. UI2/job 115170476315 fails the deep standalone-work reply reveal; UI8/job 115170476361 fails both dark/light position-rail navigation cases and reply-source navigation after reconnect. Diagnostics show a connected, uncrashed browser whose renderer does not respond. - Candidate `5ed8e6c21f2dba67cb0f33d2562b08e099e5e059`: all four original cases pass in [focused hosted run 38364929226/job 115187670047](https://github.com/openclaw/openclaw/actions/runs/38364929226/job/115187670047): dark/light position rail 22.973/22.448 seconds, deep earlier reveal 2.985 seconds, reconnect source navigation 3.574 seconds. Three files, four passed, seven unrelated cases filtered; total Vitest time 83.06 seconds. Source verification confirms the owner and all three test files are unchanged. No assertions, timeouts, retries, or screenshot behavior are weakened. - Changed-file oxfmt, oxlint, and `git diff --check`: passed. No local suite, build, or dependency installation was run. - Codex autoreview: scoped-clean; no actionable P0–P2 findings. Normal commit hooks passed. Focused candidate command (ordinary PR CI omitted these four original cases): ```sh OPENCLAW_UI_E2E_SKIP_REAL_GATEWAY=1 node scripts/run-vitest.mjs run \ --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner --maxWorkers=1 \ ui/src/e2e/chat-collapsed-reply-reveal.e2e.test.ts \ ui/src/e2e/chat-position-rail.e2e.test.ts \ ui/src/e2e/chat-reply-preview-recovery.e2e.test.ts \ -t 'reveals the deep earlier message in standalone work|tracks reader position and keyboard jumps|refreshes the page-carried original after reconnect and keeps source navigation working' \ --reporter=verbose ``` Scope: one file, +2/-1 lines. No SQL or database-worker/T1 call paths change; no SQL harness measurement applies. Ordinary candidate CI [38363444022](https://github.com/openclaw/openclaw/actions/runs/38363444022) passed all 28 selected jobs; 26 were skipped. Required, security, types, lint, architecture and static gates passed. Ratchets remain T1 454 to 454, compatibility calls 9 to 9, all dialect groups 0 to 0. The initial PR-context check required these body headings and was corrected; replacement run 38363572076 passed.
PR browser selection follows declared owner modules and their direct runtime imports. The transcript-navigation tests only declared the chat route, so #170662 changed the virtualizer, Solid layout, and render lifecycle without selecting them, and the renderer freeze first failed on main. Declare the transcript controller, Solid layout, and virtualizer host as owners of chat-position-rail, chat-collapsed-reply-reveal, and chat-reply-preview-recovery. Their direct imports reach message reveal and the Solid render lifecycle. Real-checkout selector cases replay the #170662 diff.
#171826) PR browser selection follows declared owner modules and their direct runtime imports. The transcript-navigation tests only declared the chat route, so #170662 changed the virtualizer, Solid layout, and render lifecycle without selecting them, and the renderer freeze first failed on main. Declare the transcript controller, Solid layout, and virtualizer host as owners of chat-position-rail, chat-collapsed-reply-reveal, and chat-reply-preview-recovery. Their direct imports reach message reveal and the Solid render lifecycle. Real-checkout selector cases replay the #170662 diff.
openclaw#171826) PR browser selection follows declared owner modules and their direct runtime imports. The transcript-navigation tests only declared the chat route, so openclaw#170662 changed the virtualizer, Solid layout, and render lifecycle without selecting them, and the renderer freeze first failed on main. Declare the transcript controller, Solid layout, and virtualizer host as owners of chat-position-rail, chat-collapsed-reply-reveal, and chat-reply-preview-recovery. Their direct imports reach message reveal and the Solid render lifecycle. Real-checkout selector cases replay the openclaw#170662 diff.
…#190589) A warm reload of a dashboard deep link no longer keeps the measured, end-anchored conversation invisible after its rows settle. The transcript reveal owner (measured range plus reading-edge placement, #170662) was ready on time, but the desktop side region declared `@starting-style { opacity: 0 }` (added with the resizable panel frame in #176356). Every newly mounted side surface, including the dashboard's saved conversation pane, therefore replayed a 280 ms entrance fade over content that was already placed. Delete that four-line `@starting-style` block. Initially mounted desktop side surfaces show their placed content immediately; geometry, opacity and display transitions remain for open/close changes, and the transcript reveal guard is unchanged. A side surface that goes from hidden to shown now appears without the 280 ms fade. No persisted facts, protocol, schema or config change. The warm-reload proof rig gains a native tall-row dashboard fixture with bundled Workboard plus synthetic theme/board plugin modules on both plugin asset routes, and per-frame visibility probes (scripts/perf only). Proof (final head, 11 interleaved AWS pairs per route plus A/A, real Gateway, three-viewer preparation check intact): dashboard visible transcript 701.6 -> 508.1 ms median, paired -200.1 ms, 11/11 better with separated IQRs; post-row hold 175.7 -> 0 ms; reading position and row height final in 11/11 on both routes, 0 px movement, 0% snapshot growth; chat mixed (paired -34 ms, not claimed) and no secondary regressions. Runtime -4 LOC. Exact-head CI green; full UI 891 pass / 2 fail, both reproduce on the exact main base. Release-note context: Control UI dashboard warm reloads show the saved conversation pane immediately instead of fading it in.
…openclaw#190589) A warm reload of a dashboard deep link no longer keeps the measured, end-anchored conversation invisible after its rows settle. The transcript reveal owner (measured range plus reading-edge placement, openclaw#170662) was ready on time, but the desktop side region declared `@starting-style { opacity: 0 }` (added with the resizable panel frame in openclaw#176356). Every newly mounted side surface, including the dashboard's saved conversation pane, therefore replayed a 280 ms entrance fade over content that was already placed. Delete that four-line `@starting-style` block. Initially mounted desktop side surfaces show their placed content immediately; geometry, opacity and display transitions remain for open/close changes, and the transcript reveal guard is unchanged. A side surface that goes from hidden to shown now appears without the 280 ms fade. No persisted facts, protocol, schema or config change. The warm-reload proof rig gains a native tall-row dashboard fixture with bundled Workboard plus synthetic theme/board plugin modules on both plugin asset routes, and per-frame visibility probes (scripts/perf only). Proof (final head, 11 interleaved AWS pairs per route plus A/A, real Gateway, three-viewer preparation check intact): dashboard visible transcript 701.6 -> 508.1 ms median, paired -200.1 ms, 11/11 better with separated IQRs; post-row hold 175.7 -> 0 ms; reading position and row height final in 11/11 on both routes, 0 px movement, 0% snapshot growth; chat mixed (paired -34 ms, not claimed) and no secondary regressions. Runtime -4 LOC. Exact-head CI green; full UI 891 pass / 2 fail, both reproduce on the exact main base. Release-note context: Control UI dashboard warm reloads show the saved conversation pane immediately instead of fading it in.
What Problem This Solves
Fixes a blank transcript center when a signed-in operator reloads a chat or dashboard deep link. The cold-load investigation measured 14 intermediate states; its synthetic revision comparison showed transcript content around +436 ms in
d3601e62147b, versus +1,042 ms in2bd6ca195418despite earlier cached sidebar restoration.User Impact
Measured transcript rows can paint with the cached sidebar instead of remaining hidden through another browser frame. Saved reading positions, tail anchoring, reply metadata, and progress remain intact. There are no config, schema, or cache-format changes.
Why This Change Was Made
The Solid transcript port (
4e3818bab0fe, #168887) scheduled positioning after another animation frame. The subsequent visibility gate (68d586924cd3, #169334) correctly hid unpositioned rows, but made that scheduling delay visible as a blank center. Three-run historical probes narrowed the regression to this gate; the fixed timing threshold became unreliable as shared-host load changed, so the adjacent source comparison and regression test supply the causal evidence.The transcript owner now finishes positioning after nested row commits and reveals only when the selected virtual rows are connected and their committed intrinsic sizes match the measured sizes. Simply removing the frame wait caused a 402 px cached-tail jump and was rejected. The geometry condition preserves that protection and removes the unused generic
afterLayoutphase.Evidence
Five interleaved runs per revision on final pushed head
d6f83eabba6aused the synthetic Team-scale dashboard fixture and immutable production bundles. First visible transcript means the first native trace screenshot after first paint containing the fixture's user-bubble color and text in the center; this excludes the previous document and sidebar-only paints. All timings are noisy shared-host observations.d3601e62147b8f84b2166dd4d6f83eabba6aThe final same-base median improves 150 ms (18%). The deterministic regression reveals committed rows without flushing an animation frame. Four of five fixed runs show transcript content in the initial contentful frame, versus zero of five for the unchanged base and four of five for the older build. The final cohort meets the older-build median target (678 vs 704 ms), but earlier batches changed old/fixed ordering as host load shifted. This supports removal of the blank-center regression; it is not a reliable quiet-host latency guarantee or completion of the broader cold-load campaign. One fixed run still has a 319 ms contentful-paint-to-transcript gap; the lead should recheck that remaining startup path on a quieter host.
Earlier five-triplet comparisons on
a07acefb6abbimproved same-base first transcript 1,129→797 ms and first-contentful-frame transcript 0/5→4/5. The older build measured 689 ms then. A second five-pair old/fixed comparison gave 1,178→955 ms. Both batches are retained in the lane evidence; shifting host load makes cross-batch timing comparisons unsuitable.Validation:
pnpm test ui/src/pages/chat/components/chat-transcript-controller.test.ts --maxWorkers=1: 34/34 passed; Vitest 52.20 s, harness 63.35 s. The added regression fails on original production code (visibility: hidden).pnpm test ui/src/pages/chat/solid-render-lifecycle.test.tsx --maxWorkers=1: 6/6 passed; Vitest 7.26 s, harness 13.97 s.node scripts/run-vitest.mjs ui/src/e2e/chat-cold-load-anchor.e2e.test.ts --maxWorkers=1: 3/3 passed; Vitest 25.47 s, harness 29.80 s, including the UI build.node scripts/run-vitest.mjs ui/src/e2e/chat-history-stale-geometry.e2e.test.ts --maxWorkers=1: 1/1 passed; Vitest 21.30 s, harness 25.62 s.node scripts/run-vitest.mjs ui/src/e2e/session-transcript-search.e2e.test.ts --maxWorkers=1: 4/4 passed; Vitest 22.43 s, harness 30.31 s.node scripts/run-vitest.mjs ui/src/e2e/team-scale-cold-load.e2e.test.ts --maxWorkers=1: 1/1 passed; Vitest 33.92 s, harness 47.38 s.git diff --checkpassed. Fresh independent review: scoped-clean, no actionable P0–P2 findings.38350229823found four failures in reply-reveal tests across two unit shards. They reproduced locally; their frame-only helpers now await nested commit microtasks, with all flash-lifetime and interruption assertions retained.chat-transcript-message-reveal.test.tsis 7/7 (11.17 s Vitest, 15.86 s harness), andchat-transcript-replies.test.tsis 27/27 (11.26 s, 15.22 s). The adjustment had a fresh clean review. Final headd6f83eabba6a: CI run 38351856292 andopenclaw/ci-gateare green. All three UI unit shards pass (328/346/305 s wall time, including unrelated files); selected UI e2e passes (116 s). Performance, types, lint, and docs checks also pass. No workflow rerun was used; the second run follows the committed test-helper repair.Runtime production LOC delta: −6 (+38/−44). The requested stat filter also includes
.test.tsxand the UI README: +64/−134, net −70. Tests and docs account for that difference. Release-note context: chat reloads reveal positioned, measured transcript rows sooner while retaining scroll-anchor stability.The attached before/after filmstrips use only synthetic fixture data. The before filmstrip shows the transcript still hidden at the initial contentful paint; the after filmstrip shows transcript content at that paint. No private captures were uploaded.
Review note: initial completion calls
presentation.measureRows()before the intrinsic-size check. That owner reads current computed row heights, withdata-measuring-rowsdisabling content visibility, and retries when any measured size changes. The inline-size check then verifies those measured sizes reached the committed DOM. Later image/font/widget resizing keeps the existing native observer and reader-follow ownership. Restoring an unconditional frame phase is therefore declined; the cached-tail and stale-width browser proofs cover the initial geometry boundary.