Skip to content

fix(ui): stop images reloading while scrolling - #159486

Merged
roboclaw-bot merged 4 commits into
mainfrom
openclaw/keep-images-loaded-while-scrolling
Sep 27, 2026
Merged

roboclaw-bot merged 4 commits into
mainfrom
openclaw/keep-images-loaded-while-scrolling

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: already-viewed chat screenshots flash a loading placeholder and can download again when scrolling back to a virtualized message.

User Impact

User impact: recently viewed local screenshots and generated previews return immediately while unseen images still lazy-load. Retention is bounded and remains scoped to the current connection, credentials, session, agent, policy, and valid media ticket. No configuration or migration is needed.

Why This Change Was Made

Reuse the decoded native image within the existing metadata resource cache rather than rebuilding it on every row remount. Managed previews consult their existing blob cache before viewport admission. Native nodes transfer exclusively, release their old listeners and parent, and rebind to the new row. This is a rendering-lifecycle fix, not a layout or styling change.

Evidence

Access-withdrawal follow-up: role reassignment already closes the reader connection (users.setRole → policy close 4001), and role-definition changes already invalidate the media policy epoch. The missing case was the redacted sessions.changed sharing event: it now invalidates the same preview-admission owner before roster refresh. This preserves cached pixels only while the client has not received authority invalidation; it does not claim to retract bytes already delivered or synchronously update an offline browser.

  • Expanded real Chromium app proof covers normal scrolling, session visibility/sharing withdrawal, role reassignment, and role-definition withdrawal. The sharing case fails before the follow-up; all four pass afterward (17.02s suite; 3.43–4.28s per case). After withdrawal, a MutationObserver confirms no transient cached image insertion, the final UI is unavailable, and the image-byte request count stays at the original one. Gateway WebSocket/HTTP responses are deterministic fixture inputs to the actual Control UI.

  • Actual Gateway policy tests pass for a named reader’s saved media ticket after visibility, role-assignment, and role-definition withdrawal. The users.setRole producer test also confirms policy invalidation and client disconnection before its response: 4 focused cases pass. An initial harness run overlapped isolated-fixture cleanup and was refused by the compiler input snapshot; the serialized replay passed.

  • Follow-up UI and E2E typechecks, code/style lint, formatting, and a fresh independent P0–P2 review pass.

  • The new immediate-remount regressions fail on the original implementation and pass with this fix.

  • 336 focused tests across six files pass, including scope/ticket invalidation, native reconnect without a host render, optimistic-upload handoff, galleries, and existing media lifecycle behavior. Final combined run: 5.88s Vitest / 6.69s wrapper wall; the changed admission file’s 17 cases each complete in 1–4ms.

  • Real Chromium, actual Control UI source-mode app and an 80-message virtualized transcript: the image row detaches and remounts with no loading frame, one metadata request, and exactly one image-byte request despite Cache-Control: no-cache. Browser scenario: 4.26s; suite: 5.74s.

  • UI and core-test typechecks, targeted code/style lint, tooling lint, formatting, assertion/size guards, and dead-export scans pass. The final listener adjustment was rerun through all 336 tests, the browser scenario, UI/chat-test typechecks, and lint.

  • Limitation: the isolated full bundled E2E prerequisite build was killed; the same scrolling scenario passed through the supported source-mode app. No claim of live Team deployment.

Worked on by

Work sessions


View the OpenClaw team session

roboclaw-bot and others added 2 commits September 27, 2026 06:45
Reuse loaded native images within the scoped metadata cache and bypass viewport admission for warm managed previews. Preserve ticket expiry, invalidation, and exclusive node ownership across remounts.

Co-authored-by: steipete <[email protected]>
Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 60dabc7e-feb1-44b5-84da-0f0d3137e62f
@clawsweeper

clawsweeper Bot commented Sep 27, 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 Sep 27, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 27, 2026 06:47
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 27, 2026
@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 27, 2026, 1:45 PM ET / 17:45 UTC (Revision 2).

ClawSweeper review

What this changes

The PR reuses loaded chat images across virtual row remounts and invalidates cached previews when sharing access changes.

Merge readiness

✅ Ready for maintainer review

Current main still rebuilds chat images when virtualized rows remount. The updated browser evidence addresses the prior access-withdrawal concern, and this review found no definite introduced defect.

Priority: P2
Reviewed head: 5c95513b3c8fe13f943155f30abc3caf12a37661

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The follow-up provides strong browser evidence for the earlier withdrawal gap, and the patch has no definite blocking finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR reports an after-fix run of the actual Control UI in Chromium with 80 virtualized messages and deterministic Gateway responses: reuse made one image-byte request, while sharing and role withdrawals produced no transient cached image insertion and ended unavailable. The source test contains those final-display assertions, and Gateway policy tests cover saved-ticket denial. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR reports an after-fix run of the actual Control UI in Chromium with 80 virtualized messages and deterministic Gateway responses: reuse made one image-byte request, while sharing and role withdrawals produced no transient cached image insertion and ended unavailable. The source test contains those final-display assertions, and Gateway policy tests cover saved-ticket denial. No stored-data contract changes.
Evidence reviewed 8 items Current main still rebuilds image elements: The current-main image template creates an img element on render, and its admission path has no retained-node lookup.
Scoped cache reuse: The introduced directive checks the managed blob cache or takes a retained native image before viewport admission.
Sharing invalidation: The new event handler advances the media policy epoch on a sharing notification before the session roster refresh.
Findings None None.
Security None None.

How this fits together

The Control UI renders chat history in virtualized rows. Image previews use Gateway media checks and a browser cache before appearing in a row.

flowchart LR
A[Virtual chat rows] --> B[Image preview]
B --> C{Scoped cache valid?}
C -->|Yes| D[Reuse loaded image]
C -->|No| E[Gateway media check]
D --> F[Visible preview]
E --> F
G[Sharing and role changes] --> C
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +142, Tests +177, Docs 0, Other -1. Total +318 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 5 164 22 +142
Tests 2 260 83 +177
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 9 425 107 +318

Review metrics

Metric Value Why it matters
Production and test growth production +142 net lines; tests +177 net lines The growth is localized to image lifecycle and withdrawal coverage, with the reuse and cache-scope rationale stated in the PR body.

Technical review

Best possible solution:

Preserve immediate scroll reuse while requiring fresh media admission after relevant access or connection changes.

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

Yes. Current-main source rebuilds the image on remount, and the PR reports a Chromium scenario that failed before the fix; this reviewer did not rerun it.

Is this the best way to solve the issue?

Yes. The patch reuses the existing scoped media cache and invalidates it through the existing policy epoch instead of creating another cache owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6652f7eac8d9.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR reports an after-fix run of the actual Control UI in Chromium with 80 virtualized messages and deterministic Gateway responses: reuse made one image-byte request, while sharing and role withdrawals produced no transient cached image insertion and ended unavailable. The source test contains those final-display assertions, and Gateway policy tests cover saved-ticket denial. No stored-data contract changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR reports an after-fix run of the actual Control UI in Chromium with 80 virtualized messages and deterministic Gateway responses: reuse made one image-byte request, while sharing and role withdrawals produced no transient cached image insertion and ended unavailable. The source test contains those final-display assertions, and Gateway policy tests cover saved-ticket denial. No stored-data contract changes.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: The fix addresses repeated downloads and loading flashes in a limited Control UI workflow.
  • merge-risk: 🚨 security-boundary: Reusing decoded pixels makes access-change invalidation a merge-sensitive boundary, covered here by browser denial scenarios and Gateway ticket checks.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR reports an after-fix run of the actual Control UI in Chromium with 80 virtualized messages and deterministic Gateway responses: reuse made one image-byte request, while sharing and role withdrawals produced no transient cached image insertion and ended unavailable. The source test contains those final-display assertions, and Gateway policy tests cover saved-ticket denial. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR reports an after-fix run of the actual Control UI in Chromium with 80 virtualized messages and deterministic Gateway responses: reuse made one image-byte request, while sharing and role withdrawals produced no transient cached image insertion and ended unavailable. The source test contains those final-display assertions, and Gateway policy tests cover saved-ticket denial. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vyctorbrzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-27T06:54:26.355Z sha 7c81fa0 :: needs real behavior proof before merge. :: none

roboclaw-bot and others added 2 commits September 27, 2026 17:37
Invalidate the existing media policy epoch on redacted sharing notifications before the roster refresh. Prove normal scroll reuse and final denial after visibility, role assignment, and role definition withdrawal in Chromium.

Co-authored-by: steipete <[email protected]>

Co-authored-by: vyctorbrzezowski <[email protected]>
Worked on by:
- @steipete
- @vyctorbrzezowski

Co-authored-by: steipete <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 0f6560b1-3b05-40a0-9d04-8e6965c6ea7d
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Addressed the access-withdrawal finding in current head 5c95513b3c8fe13f943155f30abc3caf12a37661. The actual role-assignment producer already disconnects the named reader (4001), and role-definition changes already invalidate the policy epoch. The missing redacted sharing notification now invalidates that same preview-admission owner before roster refresh.

The expanded Chromium app regression fails on the sharing case before the repair and passes all four cases afterward: normal reuse, visibility/sharing withdrawal, role reassignment, and role-definition withdrawal. It observes the final unavailable state and rejects even transient cached-IMG reinsertion after withdrawal; the image-byte count stays at one. These are production UI paths with deterministic Gateway event/HTTP fixtures. Separately, the actual Gateway named-reader ticket tests and users.setRole invalidation/disconnect ordering pass. Updated proof, timings and limits are in the PR body.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 27, 2026
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) September 27, 2026 17:48
@roboclaw-bot
roboclaw-bot merged commit 6a723ed into main Sep 27, 2026
138 of 140 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/keep-images-loaded-while-scrolling branch September 27, 2026 17:55
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 28, 2026
* fix(ui): stop images reloading while scrolling

Reuse loaded native images within the scoped metadata cache and bypass viewport admission for warm managed previews. Preserve ticket expiry, invalidation, and exclusive node ownership across remounts.

Co-authored-by: steipete <[email protected]>

* fix(ui): stop images reloading while scrolling

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 60dabc7e-feb1-44b5-84da-0f0d3137e62f

* fix(ui): retire cached images when sharing access changes

Invalidate the existing media policy epoch on redacted sharing notifications before the roster refresh. Prove normal scroll reuse and final denial after visibility, role assignment, and role definition withdrawal in Chromium.

Co-authored-by: steipete <[email protected]>

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(ui): stop images reloading while scrolling

Worked on by:
- @steipete
- @vyctorbrzezowski

Co-authored-by: steipete <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 0f6560b1-3b05-40a0-9d04-8e6965c6ea7d

---------

Co-authored-by: steipete <[email protected]>
Co-authored-by: vyctorbrzezowski <[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 docs Improvements or additions to documentation merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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. 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