Skip to content

fix(control-ui): keep inline widgets steady on chat reload - #169304

Merged
steipete merged 7 commits into
mainfrom
steipete/coldload-transcript-inline-widgets
Oct 12, 2026
Merged

steipete merged 7 commits into
mainfrom
steipete/coldload-transcript-inline-widgets

Conversation

@steipete

@steipete steipete commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Inline widgets shift surrounding transcript messages when a signed-in operator reloads a dashboard deep link. The campaign observed the transcript at about 2.56 seconds, followed by inline-card growth around 2.7–3.6 seconds.

User Impact

Previously rendered Canvas widgets and MCP Apps reserve their measured height before lazy registration, their view response, and sandbox content arrive. Content fills the existing box. New widgets use their declared/default size; changed content or viewport widths can still resize normally.

Why This Change Was Made

Measured heights live in the existing scoped chat snapshot, bounded to 100 widgets per session and cleared with its existing session/account invalidation. Both widget hosts use that size throughout loading. The raw iframe path's separate page-wide height map is removed. The writer can bind when its first snapshot arrives and rejects a replaced backing session.

Production LOC: +103 (148 added, 45 removed across 14 production files), using git diff --stat origin/main...HEAD -- ':!*.test.ts' ':!*test-support*' ':!docs/*'. Growth implements the persisted sizing contract and its propagation to both hosts; obsolete iframe-cache machinery is deleted. This stays within the existing client cache owner.

Evidence

The synthetic mock-Gateway flow renders a real 700 px widget, verifies its persisted height, reloads with reconnect held until the cached preview appears, then connects and holds the widget response. It samples every animation frame through content arrival.

Measurement Before After
Widget height from first sampled paint 0 → 420 → 700 px 700 px throughout
End gap during delayed widget load up to 280 px 0 px
Following message top during delayed widget load 639 → 919 px transiently 639 px throughout
Sample count 77 frames 75 frames

The baseline fails the regression; the final cache-hit fixture passes locally, inside the full suite, and in Linux PR CI. All screenshots use synthetic data and were inspected before upload.

The existing snapshot startup budget can still discard a cache read when fresh history wins. The newer Solid transcript renderer also has an initial scroll-settling delay. Those are separate follow-ups: this lane checks height from the first cached frame and anchor stability across delayed widget content after initial transcript settlement.

Focused proof

  • Final widget E2E file: 3 passed, 23.04 s including bundle setup; reload scenario 2.3 s in the full run. Command: node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts ui/src/e2e/chat-widget-autosize.e2e.test.ts --maxWorkers=1.
  • pnpm test ui/src/pages/chat/session-message-cache.test.ts --maxWorkers=1: 17 passed, 2.94 s. Early writer ordering fails before its fix and passes afterward.
  • pnpm test ui/src/components/mcp-app-view.test.ts --maxWorkers=1: 27 passed, 7.40 s after shared-fixture extraction.
  • pnpm test ui/src/components/mcp-app-view-sizing.test.ts --maxWorkers=1: 1 passed, 4.97 s.
  • pnpm test ui/src/components/canvas-widget-view.test.ts --maxWorkers=1: 33 passed, 6.10 s.
  • Earlier-candidate snapshot/Canvas/MCP/widget-card/widget-mount tests passed on Blacksmith Testbox tbx_01m4p2narat2z7qcyj2xz76qpt (13.26 s wrapper). Allocation. Lease stopped. Two subsequent sync timeouts triggered the authorized local fallback.
  • Fresh isolated reviews through P2 completed without actionable findings after fixes.

Final-head full UI E2E

The full-suite results below are historical evidence from the previously reviewed head. This refresh used the lead-requested focused tests and complete PR CI; it does not relabel the old full run as proof of the rebased head.

Head 2041b3fb63cf0a5b8c2d6b8ebea37404d9275588, command node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --maxWorkers=2:

730 files passed, 13 failed, 1 skipped; 3,329 tests passed, 45 failed, 1 skipped. Vitest duration: 6,176.67 s. All widget cases passed.

Baseline replays used main source 3be41182be9b09709f3e6c038c46aeb7d633841d, individually with one worker. Multi-case files have representative-case coverage rather than a complete second suite.

Failed file Failed cases Baseline evidence
claude-sessions.e2e.test.ts 3 Loading-earlier failure reproduced; all three also fail in published main CI
lazy-custom-element-recovery.e2e.test.ts 5 Same missing debug-overlay.ts built-chunk failure
board-mcp-app.e2e.test.ts 1 Same lost unsaved app-input value
chat-subagent-waiting.e2e.test.ts 1 Same focus assertion
meetings.e2e.test.ts 1 Same summary locator timeout
settings-prefs-reconnect.e2e.test.ts 1 Same request-count assertion
theme-muted-contrast.e2e.test.ts 26 Representative theme reproduces the same control-count assertion
chat-scroll.e2e.test.ts 1 Same affordance/viewport assertion
chat-history-prepend-anchor.e2e.test.ts 2 Representative case reproduces the same earlier-history locator timeout
session-owner-filter-keyboard.e2e.test.ts 1 Passed once on baseline, then reproduced the same Escape/menu failure; also fails on head
chat-follow-maintenance.e2e.test.ts 1 Same restored-anchor drift assertion
chat-history-loading.e2e.test.ts 1 Same earlier-history timeout observed; cleanup hit the local deadline
chat-collaborator-scroll.real-gateway.e2e.test.ts 1 Baseline observed 415 px pending-to-persisted offset drift; complete replay exceeded the local time cap, so full baseline result remains unfinished

CI state

Refreshed CI run 38199740772 completed SUCCESS on head 56c53038c4551eb809eaf0d63833662eb063c48b, rebased onto main 00809bf2c2a0 with Solid 2.0.0-rc.14. GitHub reports MERGEABLE.

CI class Result
Production types Passed
Test types, including core-1 through core-5 Passed; none canceled
Lint and guards Passed
UI unit shards (1–3) Passed
Selected UI E2E shards (1–3) Passed
UI performance and i18n Passed
Node changed/boundary/compact tests Passed
Docs, source contracts, package boundaries, security Passed
openclaw/ci-gate Passed

After the rebase and frozen-lockfile install, all ten focused widget/snapshot/transcript test files passed individually with one worker. The cached-widget E2E file also passed all three tests (49.71 s including setup). No red CI jobs remain, so no new main comparison or retry was needed. Platform/release lanes outside this PR's selection were skipped normally.

The lead owns landing. This ready PR remains open and is not configured to merge automatically.

Synthetic current-main comparison: fixed widget height and no movement during delayed content arrival

@clawsweeper

clawsweeper Bot commented Oct 11, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: M labels Oct 11, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR saves inline widget heights in scoped chat snapshots and reserves that space while reloaded content arrives.

Example: Reload a cached conversation containing a 700 px Canvas widget.

  • Before: The widget temporarily occupies 420 px, then grows by 280 px and moves surrounding messages.
  • After: The widget reserves 700 px throughout loading, keeping the following message steady.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused owner-level repair with inspected browser evidence, meaningful regressions, compatible snapshot extension, and successful reviewed-head CI.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected synthetic browser captures show the Control UI reserving a learned 700 px Canvas height across reload and delayed content arrival; the supplied frame trace records a stable following reply and zero end gap, with focused MCP tests supporting its loading reservation.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Reloading a cached conversation moves surrounding messages when inline widget content expands after its loading placeholder.
Reason: The repair delivers a demonstrated visual improvement within the existing cache and widget owners, whose feature history establishes author ownership.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it fixes a remaining widget reload layout bug, with inspected visual evidence and successful CI on the reviewed head; no actionable defects were found.

Priority: P2
Reviewed head: 56c53038c4551eb809eaf0d63833662eb063c48b

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI receives widget size reports from sandboxed content, stores bounded measurements with the conversation snapshot, and supplies them to Canvas and MCP App loading views.

flowchart LR
  A[Sandboxed widget] --> B[Widget host]
  B --> C[Scoped chat snapshot]
  C --> D[Browser snapshot storage]
  D --> E[Cached conversation reload]
  E --> B
  B --> F[Stable transcript layout]
Loading

Technical review

Best possible solution:

Retain measured sizing under the existing scoped snapshot owner and use it consistently through widget loading.

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

Current-main source lacks persisted widget sizing, and the supplied baseline browser capture demonstrates the resulting loading-height change.

Is this the best way to solve the issue?

The change fixes the sizing owner directly, preserves existing bounds and invalidation, and removes the competing page-wide cache.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Raw iframe height retention keeps the original intent (52c11da: Preserve measured height across rerenders and capability URL rotation without resetting interactive content.)
  • Canvas and MCP host lifecycle keeps the original intent (91fd61d: Move widget renderers to Solid while retaining frame identity, sizing, and awaited retirement.)
  • Scoped cached transcript projection keeps the original intent (cc7bd7b: Restore a settled cached transcript before reconnect and preserve display facts during live reconciliation.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +103, Tests +270, Docs +2. Total +375 across 20 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 14 148 45 +103
Tests 5 289 19 +270
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 20 439 64 +375

Review metrics

Metric Value Why it matters
Production versus test growth Production +103 LOC; tests and test support +270 LOC Production growth carries bounded sizing through the existing owner while removing the separate height map; tests cover reload geometry, snapshot lifecycle, and MCP loading.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The bug causes visible transcript movement during cached widget reloads without blocking chat or losing messages.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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 (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-11T20:03:56.051Z sha 7cf5dc4cc53525233e2d1bad94b60af38341beca :: needs changes before merge. :: [P2] Repair the bundled reload regression's zero-offset first sample
  • reviewed 2026-10-11T20:37:17.992Z sha c1fa6b38ea780e0b8d175e47ac155a5d8a196616 :: needs changes before merge. :: [P2] Repair the bundled reload scenario's height mismatch
  • reviewed 2026-10-11T21:10:11.775Z sha 61025e5 :: needs changes before merge. :: [P2] Repair the bundled reload scenario's height mismatch
  • reviewed 2026-10-11T22:21:12.522Z sha efc041ff58ac0902418f43b4d392fe1ca3443aad :: needs changes before merge. :: [P2] Repair the bundled cached-reload scenario
  • reviewed 2026-10-11T22:37:17.120Z sha 2041b3f :: needs maintainer review before merge. :: none
  • reviewed 2026-10-11T23:20:45.592Z sha 2041b3f :: needs maintainer review before merge. :: none
  • reviewed 2026-10-12T02:21:45.022Z sha 2041b3f :: needs maintainer review before merge. :: none
  • reviewed 2026-10-12T03:37:57.933Z sha 56c5303 :: needs maintainer review before merge. :: none

Reviewed October 11, 2026, 11:57 PM ET / October 12, 2026, 03:57 UTC (Revision 10).

@steipete steipete closed this Oct 11, 2026
@steipete
steipete force-pushed the steipete/coldload-transcript-inline-widgets branch from bdde74d to 0619074 Compare October 11, 2026 19:37
@steipete steipete reopened this Oct 11, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 11, 2026
@steipete
steipete force-pushed the steipete/coldload-transcript-inline-widgets branch 4 times, most recently from efc041f to 2041b3f Compare October 11, 2026 22:30
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and 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 Oct 11, 2026
obviyus added a commit that referenced this pull request Oct 11, 2026
## What Problem This Solves

Fixes `check-test-types-core-2` failures inherited by PRs after the MCP App tests switched from Lit to Solid.

## User Impact

No user-visible change. This restores typechecking for the existing MCP App lifecycle and context-update regressions without weakening their assertions.

## Why This Change Was Made

The fixture migration in #169387 left a raw Solid memo accessor as a component return value and awaited Lit's `updateComplete` on a plain Solid-rendered context-strip element.

Render the memo through a JSX fragment in a `.test.tsx` fixture, and wait for the context strip's observable item/empty state with the existing `waitForSolid` helper. All teardown, retained-node, and context assertions remain intact.

Checked existing work first: #169247 does not change these tests and its `check-test-types-core-2` job is red; #169304 changes different parts of the MCP App tests and does not repair these errors.

## Evidence

Baseline: current `origin/main` at `5889e62f4902b8f3fa4b6eb2cecbbd26f5b8ceb0`, installed with `pnpm install --frozen-lockfile`.

Before, `pnpm run tsgo:test:ui` exited 2:

```text
ui/src/components/mcp-app-unmount.test.ts(40,5): error TS2345: Argument of type '() => SourceAccessor<Node[]>' is not assignable to parameter of type '() => Element'.
ui/src/components/mcp-app-view.test.ts(801,19): error TS2339: Property 'updateComplete' does not exist on type 'Element'.
ui/src/components/mcp-app-view.test.ts(804,19): error TS2339: Property 'updateComplete' does not exist on type 'Element'.
ui/src/components/mcp-app-view.test.ts(815,19): error TS2339: Property 'updateComplete' does not exist on type 'Element'.
[tsgo:ui-components] failed (exit 2)
```

After:

- `pnpm run tsgo:test:ui`: all eight graphs passed, including `ui-components`.
- `node scripts/run-vitest.mjs ui/src/components/mcp-app-unmount.test.tsx ui/src/components/mcp-app-view.test.ts --maxWorkers=1`: 31 tests passed across the regular and isolated UI projects. Test time: 71 ms for unmount and approximately 5.9 s for view (4.6 s is the existing embedded Apps page scenario).
- Changed-file `oxfmt --write` and `oxlint`: passed.
- `node --import ./scripts/tsx.mjs scripts/check-line-cap-ratchet.mts --base origin/main`: passed, no new violations or over-cap growth.

The existing embedded Apps page scenario emits Lit/reactivity and jsdom CSS warnings; it passes without suppressions or retry changes.
- Independent autoreview: scoped clean through P2; no actionable findings.

Co-authored-by: Ayaan Zaidi <[email protected]>
@steipete
steipete force-pushed the steipete/coldload-transcript-inline-widgets branch from 2041b3f to 56c5303 Compare October 12, 2026 03:26
@steipete
steipete merged commit 5a5a608 into main Oct 12, 2026
91 checks passed
@steipete
steipete deleted the steipete/coldload-transcript-inline-widgets branch October 12, 2026 04:21
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
## What Problem This Solves

Fixes `check-test-types-core-2` failures inherited by PRs after the MCP App tests switched from Lit to Solid.

## User Impact

No user-visible change. This restores typechecking for the existing MCP App lifecycle and context-update regressions without weakening their assertions.

## Why This Change Was Made

The fixture migration in openclaw#169387 left a raw Solid memo accessor as a component return value and awaited Lit's `updateComplete` on a plain Solid-rendered context-strip element.

Render the memo through a JSX fragment in a `.test.tsx` fixture, and wait for the context strip's observable item/empty state with the existing `waitForSolid` helper. All teardown, retained-node, and context assertions remain intact.

Checked existing work first: openclaw#169247 does not change these tests and its `check-test-types-core-2` job is red; openclaw#169304 changes different parts of the MCP App tests and does not repair these errors.

## Evidence

Baseline: current `origin/main` at `11f576b23cf70615ca4504eb12fdba93591b9c8f`, installed with `pnpm install --frozen-lockfile`.

Before, `pnpm run tsgo:test:ui` exited 2:

```text
ui/src/components/mcp-app-unmount.test.ts(40,5): error TS2345: Argument of type '() => SourceAccessor<Node[]>' is not assignable to parameter of type '() => Element'.
ui/src/components/mcp-app-view.test.ts(801,19): error TS2339: Property 'updateComplete' does not exist on type 'Element'.
ui/src/components/mcp-app-view.test.ts(804,19): error TS2339: Property 'updateComplete' does not exist on type 'Element'.
ui/src/components/mcp-app-view.test.ts(815,19): error TS2339: Property 'updateComplete' does not exist on type 'Element'.
[tsgo:ui-components] failed (exit 2)
```

After:

- `pnpm run tsgo:test:ui`: all eight graphs passed, including `ui-components`.
- `node scripts/run-vitest.mjs ui/src/components/mcp-app-unmount.test.tsx ui/src/components/mcp-app-view.test.ts --maxWorkers=1`: 31 tests passed across the regular and isolated UI projects. Test time: 71 ms for unmount and approximately 5.9 s for view (4.6 s is the existing embedded Apps page scenario).
- Changed-file `oxfmt --write` and `oxlint`: passed.
- `node --import ./scripts/tsx.mjs scripts/check-line-cap-ratchet.mts --base origin/main`: passed, no new violations or over-cap growth.

The existing embedded Apps page scenario emits Lit/reactivity and jsdom CSS warnings; it passes without suppressions or retry changes.
- Independent autoreview: scoped clean through P2; no actionable findings.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
…169304)

* perf(control-ui): reserve inline widget height on reload

Persist measured Canvas and MCP App heights in the scoped chat snapshot and reserve them before lazy widget content loads. Keep transcript end anchoring stable while delayed content fills in place; retire the separate page-wide iframe height map.

* fix(control-ui): release temporary widget size reservation

* style(control-ui): resolve widget reload lint violations

* test(control-ui): isolate delayed widget anchor stability

* fix(control-ui): bind widget sizes after the first snapshot arrives

* test(control-ui): prove cached widget reload before fresh history

* test(control-ui): hold reconnect until cached widget paint
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 docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: L 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