Skip to content

perf(ui): stop loading shimmers from repainting - #128687

Merged
vyctorbrzezowski merged 3 commits into
mainfrom
brzezowski/anim-shimmer
Aug 27, 2026
Merged

vyctorbrzezowski merged 3 commits into
mainfrom
brzezowski/anim-shimmer

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Aug 24, 2026 •

Copy link
Copy Markdown
Member

Closes #128657

AI-assisted.

What Problem This Solves

Fixes an issue where users loading initial Chat history, Usage data, or a Memory Import plan would incur continuous rendering work for as long as the loading skeleton remained visible. A three-second Chromium Timeline trace recorded 360-362 Paint events and 180-181 UpdateLayoutTree events per affected surface.

Why This Change Was Made

All three affected loading states now consume the shared skeleton primitive. The primitive keeps a static base on the host and moves a fixed highlight on a clipped ::after layer using transform, so Chromium can composite the shimmer without repainting the skeleton each frame. Usage and Memory Import retain their existing 1.35 s and 1.4 s timing, while the duplicate paint-driven keyframes are removed.

Memory Overview was inspected as the invariant-sharing sibling cited by the original motion audit. It already animates only opacity and transform behind prefers-reduced-motion: no-preference, measured 0 Paint / 0 UpdateLayoutTree, and remains unchanged. The running-tool text wave is also unaffected because its gradient is clipped to glyphs rather than used as a loading skeleton.

User Impact

Chat, Usage, and Memory Import retain the same loading affordance and geometry with no continuous paint work. The existing global reduced-motion kill switch still reduces each shimmer pseudo-element to one 0.01 ms iteration.

Production LOC: +29/-34 (net -5) | Tests: +103/-0

Evidence

Reproduction and performance

Reproduced before editing on 47aea1eed43fbb6663e1d241311956a0827c3c85 with Chromium 151.0.7922.34. Each production-class fixture warmed for 500 ms, then recorded a three-second DevTools Timeline trace.

Before video: current origin/main

Playwright recordVideo against the real Control UI bundle and mocked Gateway. One player covers Chat, Usage, and Memory Import in order; each screen includes its measured three-second DevTools trace.

anim-shimmer-before.mp4

After video: PR head aef38b5266d048c33e0b0becb28f7bf017ac994c

The same Playwright flow, viewport, deferred Gateway methods, and trace window. All three loading surfaces remain visible while continuous paint falls to zero.

anim-shimmer-after.mp4
Surface Before After
Chat skeleton 360 Paint / 180 UpdateLayoutTree 0 Paint / 0 UpdateLayoutTree
Usage skeleton 362 Paint / 181 UpdateLayoutTree 0 Paint / 0-1 startup UpdateLayoutTree
Memory Import skeleton 362 Paint / 181 UpdateLayoutTree 0 Paint / 0-1 startup UpdateLayoutTree
Memory Overview sibling 0 Paint / 0 UpdateLayoutTree unchanged

The required video rerun on current origin/main measured 580 / 360 / 360 Paint events for Chat / Usage / Memory Import; the PR head measured 0 / 0 / 0. The earlier fixture measurements remain above as an independent reproduction with the same conclusion.

Chat skeleton before and after

Usage skeleton before and after

Memory Import skeleton before and after

The production Control UI bundle was run against the mocked Gateway with chat.startup, sessions.usage, usage.cost, and migrations.memory.plan deliberately deferred. Chat, Usage, and Memory Import rendered their real loading states. On the PR head all three computed hostAnimation: none, ::after animation: shimmer, and will-change: transform. Every screenshot and both complete recordings were inspected locally before upload.

Regression proof

The new browser test failed against the pre-fix CSS because the host had animation: shimmer, a gradient background, visible overflow, and no animated pseudo-element. It passes after the owner-boundary repair and also verifies reduced motion.

Focused test command on the rebased branch:

PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/home/ubuntu/.cache/ms-playwright/chromium-1234/chrome-linux/chrome \
  node scripts/run-vitest.mjs \
  ui/src/styles/shimmer.browser.test.ts \
  ui/src/pages/memory-import/view.test.ts \
  ui/src/pages/usage/view.test.ts \
  ui/src/pages/chat/chat-view.test.ts \
  ui/src/pages/config/memory-overview.test.ts

Result: Focused current-main validation: 370 unit/browser tests and 5 model-catalog Chromium E2Es passed. The dedicated unit-node project ran the shimmer test 2/2, and the browser project reported no matching file because the Node-driven exclusion is active.

Current-main integration:

  • Rebasing exposed a new Chat/New Session model-trigger skeleton that independently animated background-position. It now consumes the same transform-only shared pseudo-element through --skeleton-base, --skeleton-highlight, and --skeleton-duration; the duplicate shimmer and reduced-motion keyframes were removed.
  • ui/src/styles/shimmer.browser.test.ts is now routed through the unit-node Vitest project because it imports Node stylesheet fixtures. The browser project explicitly excludes it.
  • The Chromium regression now covers Chat, Usage, Memory Import, and model-trigger skeletons, asserts that the real keyframes animate only transform, preserves each duration, and proves reduced motion has no continuing animation. Usage and Memory Import renderer tests protect their production skeleton hooks.

Other validation:

  • node scripts/check-changed.mjs -- <six changed files> passed the complete changed-file gate, including formatting, typechecks, lint, stylelint, dependency guards, dead exports, and Control UI i18n.
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main reported no accepted/actionable findings, confidence 0.99.
  • git diff --check passed.

Branch audit after rebasing:

  • git log --name-only origin/main..HEAD contains one shimmer commit and six ui/src/** files.
  • git diff --exit-code origin/main..HEAD -- .github passed; no workflow or .github/** changes are present.

Provenance and blast radius

@clawsweeper

clawsweeper Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Evidence updated in the PR body with inspected Playwright recordings for every touched loading surface: Chat, Usage, and Memory Import. Both recordings include the three-second DevTools rendering trace on-screen.

Before (origin/main):

anim-shimmer-before.mp4

After (aef38b5266d048c33e0b0becb28f7bf017ac994c):

anim-shimmer-after.mp4

@clawsweeper

clawsweeper Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 24, 2026, 7:48 AM ET / 11:48 UTC.

ClawSweeper review

What this changes

The PR replaces animated loading-gradient backgrounds with a shared transform-animated pseudo-element and applies it to Chat, Usage, and Memory Import skeletons.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking correctness finding: the shared stylesheet is the right owner for the repeated shimmer behavior, and current main still has the paint-driven variants. This member-authored draft is protected for explicit Control UI maintainer review rather than automated closure or landing.

Priority: P2
Reviewed head: aef38b5266d048c33e0b0becb28f7bf017ac994c
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative production repair with detailed before/after performance evidence and no discrete correctness finding.
Proof confidence 🦞 diamond lobster (5/6) Not applicable: The contributor-proof gate does not apply to this MEMBER-authored PR; its body nevertheless links before/after Chromium recordings and trace results for the affected loading states.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The contributor-proof gate does not apply to this MEMBER-authored PR; its body nevertheless links before/after Chromium recordings and trace results for the affected loading states.
Evidence reviewed 6 items Current-main defect surface: Current main still animates the shared skeleton with background-position, the paint-driven property this PR removes.
Owner-boundary repair: The PR moves animation to a clipped ::after layer and leaves Usage and Memory Import with only their surface-specific timing overrides.
Caller coverage: The Usage and Memory Import loading renderers now opt into the shared primitive; Chat already used it, and all discovered .skeleton call sites are empty placeholders.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs ui/src/styles/shimmer.browser.test.ts

Result: FAIL (failed) — execution before step 1 run: sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.22.0.tgz

sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.22.0.tgz

Assertions:

  • FAIL expect_output: Control UI shimmer

How this fits together

Control UI renders empty loading placeholders while Chat history, usage data, or a memory-import plan is pending. The page-specific loading views feed a shared stylesheet primitive, which supplies the visible shimmer and honors the global reduced-motion rule.

flowchart LR
  A[Chat history loading] --> D[Shared skeleton primitive]
  B[Usage data loading] --> D
  C[Memory import planning] --> D
  D --> E[Clipped highlight layer]
  E --> F[Transform animation]
  F --> G[Visible loading shimmer]
  H[Reduced motion preference] --> D
Loading

Decision needed

Question Recommendation
Should the Control UI owner move this member-authored draft into normal landing review with the shared shimmer design? Review and ready the PR: Accept the shared transform-based primitive and let exact-head checks gate the normal landing flow.

Why: The PR is member-authored, labeled maintainer, and still a draft, so automated review should not decide its landing state.

Before merge

  • Complete next step (P2) - No mechanical repair remains; explicit Control UI maintainer judgment is required before this member-authored draft can proceed.
Agent review details

Security

None.

PR surface

Source -5, Tests +103. Total +98 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 5 29 34 -5
Tests 1 103 0 +103
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 132 34 +98

Review metrics

Metric Value Why it matters
Production versus regression-test LOC production -5, tests +103 The repair consolidates three painted shimmer variants into one shared primitive while adding focused browser coverage.

Stored data model

Persistent data-model change detected: vector/embedding metadata: ui/src/styles/memory-import.css. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #128657
Summary: This PR is the open candidate repair for the concrete Control UI shimmer repaint report.

Members:

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

Technical review

Best possible solution:

Keep one shared compositor-friendly skeleton primitive, with page styles limited to geometry and intentional timing differences.

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

Yes — current main visibly animates background-position in the shared, Usage, and Memory Import skeleton rules, and the PR supplies a focused Chromium trace path for those loading states.

Is this the best way to solve the issue?

Yes — centralizing the animation at the shared skeleton owner removes duplicate paint-driven keyframes while preserving page-owned durations and reduced-motion behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0d840c0fce11.

Labels

Label changes:

  • add P2: This is a bounded Control UI performance repair affecting loading placeholders without a crash, data, auth, or delivery failure.
  • add proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The contributor-proof gate does not apply to this MEMBER-authored PR; its body nevertheless links before/after Chromium recordings and trace results for the affected loading states.
  • 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. Not applicable: The contributor-proof gate does not apply to this MEMBER-authored PR; its body nevertheless links before/after Chromium recordings and trace results for the affected loading states.

Label justifications:

  • P2: This is a bounded Control UI performance repair affecting loading placeholders without a crash, data, auth, or delivery failure.
  • 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. Not applicable: The contributor-proof gate does not apply to this MEMBER-authored PR; its body nevertheless links before/after Chromium recordings and trace results for the affected loading states.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The contributor-proof gate does not apply to this MEMBER-authored PR; its body nevertheless links before/after Chromium recordings and trace results for the affected loading states.

Evidence

What I checked:

  • Current-main defect surface: Current main still animates the shared skeleton with background-position, the paint-driven property this PR removes. (ui/src/styles/base.css:1289, 0d840c0fce11)
  • Owner-boundary repair: The PR moves animation to a clipped ::after layer and leaves Usage and Memory Import with only their surface-specific timing overrides. (ui/src/styles/base.css:1299, aef38b5266d0)
  • Caller coverage: The Usage and Memory Import loading renderers now opt into the shared primitive; Chat already used it, and all discovered .skeleton call sites are empty placeholders. (ui/src/pages/usage/view.ts:118, aef38b5266d0)
  • Focused regression coverage: The added browser test checks all three affected CSS variants, including the global reduced-motion behavior. (ui/src/styles/shimmer.browser.test.ts:25, aef38b5266d0)
  • Feature provenance: Blame ties the current main paint-driven shared, Usage, and Memory Import declarations to the recent Control UI maintenance commit by steipete; the PR is a targeted replacement of those exact declarations. (ui/src/styles/base.css:1289, 68ba1ef641e5)
  • Current-main comparison: The base-to-current-main delta changes only file-transfer paths, not any touched UI file, so current main retains the reviewed loading implementation. (0d840c0fce11)

Likely related people:

  • steipete: Current-main blame attributes the shared and page-specific paint-driven declarations to this recent Control UI maintenance commit; this person also merged the Memory Import surface. (role: recent Control UI contributor; confidence: high; commits: 68ba1ef641e5, 4319ddbe8cb0; files: ui/src/styles/base.css, ui/src/styles/usage.css, ui/src/styles/memory-import.css)
  • BunsDev: The merged dashboard-v2 view refactor is part of the Chat loading-skeleton lineage cited by the PR history. (role: historical Control UI view contributor; confidence: medium; commits: f76a3c5225bb; files: ui/src/pages/chat/components/chat-thread.ts, ui/src/pages/usage/view.ts)

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-08-24T11:05:52.031Z sha aef38b5 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. 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. labels Aug 24, 2026
@vyctorbrzezowski vyctorbrzezowski self-assigned this Aug 24, 2026
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review August 27, 2026 19:26
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Landing evidence for exact head 2b238b3be9b63ac25d535090fa4cec094401a41c:

  • Rebased integration preserved the shared transform-only skeleton and absorbed the current model-trigger loading skeleton through the same owner; duplicate background-position and reduced-motion keyframes were removed.
  • shimmer.browser.test.ts now runs in the Node-driven UI project, and the browser project explicitly excludes it.
  • Focused proof: 370 UI unit/browser tests and 5 model-catalog Chromium E2Es passed; the dedicated shimmer test passed 2/2 and verifies transform-only keyframes, all four consumers, preserved durations, and settled reduced motion.
  • Full UI package matrix passed 794 files / 11,585 tests during routing verification.
  • Fresh Codex Sol/high autoreview through P2: no findings, confidence 0.93.
  • ClawSweeper exact-head artifact from run https://github.com/openclaw/clawsweeper/actions/runs/33108593181 reports patch correct, confidence 0.9, zero findings, security cleared, rating A, and no Rank-up moves. The explicit maintainer landing authorization resolves its remaining manual acceptance decision.
  • Exact-head CI https://github.com/openclaw/openclaw/actions/runs/33108468634 completed successfully.
  • Later main drift does not touch any of the ten changed UI files; GitHub reports CLEAN and MERGEABLE.

Production: +38/-68 (net -30). Tests: +152/-0. Test routing: +1/-0.

@vyctorbrzezowski
vyctorbrzezowski merged commit 5eb62b7 into main Aug 27, 2026
165 checks passed
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/anim-shimmer branch August 27, 2026 19:54
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 28, 2026
* perf(ui): move loading shimmer off paint

* perf(ui): keep model loading shimmer off 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 maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

[Bug]: Control UI loading shimmers repaint every frame

1 participant