Repository navigation
fix(ui): stop images reloading while scrolling - #159486
Conversation
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
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 27, 2026, 1:45 PM ET / 17:45 UTC (Revision 2). ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherThe 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
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +142, Tests +177, Docs 0, Other -1. Total +318 across 9 files. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
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
|
Addressed the access-withdrawal finding in current head 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 |
|
🦞👀 Re-review progress:
|
|
Merged via squash auto-merge.
|
* 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]>
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 redactedsessions.changedsharing 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.setRoleproducer 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