Repository navigation
refactor(ui): share one shimmer primitive across skeletons and text sweeps - #136153
Conversation
…weeps The panel loading skeleton re-declared the `.skeleton` shimmer (gradient overlay, keyframes, reduced-motion guard) inside shadow DOM because the global rules and the reduced-motion gate cannot reach a shadow root. Move it to light DOM via OpenClawLightDomElement with a namespaced stylesheet so it rides the compositor-only `.skeleton::after` transform from base.css and the global reduced-motion gate, like every other loading surface. Two text shimmers (running tool-row verb, dictation listening phase) carried identical keyframes under different names; they now share `text-shimmer` in base.css. Gradients, durations, easing, and media gating are unchanged. The motion and accessibility docs described a reduced-motion guard style that no longer exists; they now document the real gate and inventory the text shimmers. Moving the skeleton styles from boot JS to boot CSS put the boot stylesheet 365 B over the largest-CSS ceiling that main already fills to 99.9%; the ceiling moves 53.5 -> 54 KiB with operator approval (net startup bytes down). Proof: shimmer.browser.test.ts covers the panel skeleton on the shared primitive; before/after skeleton screenshots from the mocked dev server are pixel-identical (231 of 4.6M subpixels differ); pnpm ui:build passes the performance guard; check-changed green.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 5:04 AM ET / 09:04 UTC. ClawSweeper reviewWhat this changesThe PR centralizes the Control UI text-sweep keyframe, aligns panel skeleton shimmer declarations across light and shadow DOM, and updates focused tests and motion documentation. Merge readiness✅ Ready for maintainer review Keep open. The exact head resolves the prior reduced-motion resting-state finding, while current main still has the three separate shimmer definitions; this PR remains a useful, bounded UI cleanup. No blocking correctness or security finding was identified, and the maintainer label prevents automated cleanup closure. Priority: P2 Review scores
Verification
How this fits togetherGlobal Control UI styles animate light-DOM skeletons and chat text, while the reusable panel-loading component renders its own styles inside shadow roots. The shared primitives control loading and active-work visuals and their reduced-motion behavior. flowchart LR
A[Loading and activity state] --> B[Global light-DOM styles]
A --> C[Panel shadow-root styles]
B --> D[Shared shimmer keyframes]
C --> D
D --> E[Reduced-motion behavior]
E --> F[Visible Control UI indicators]
F --> G[Focused browser and component tests]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0, Tests +52, Docs -6. Total +46 across 9 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the one shared light-DOM keyframe while retaining the declaration-aligned shadow-root copy and its reduced-motion protection. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is a behavior-preserving refactor, not a report of a separately reproducible user bug. Focused source and test coverage identify the affected UI paths. Is this the best way to solve the issue? Yes. A global keyframe is the canonical light-DOM owner, while CSS shadow encapsulation requires the panel component to retain an equivalent local primitive; the drift test is a maintainable safeguard. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a359864ed5cc. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles) |
…M hosts Panel loading skeleton hosts span shadow roots and light DOM. Global stylesheets do not cross shadow boundaries, leaving terminal, desktop, and browser loading placeholders unstyled after the light-DOM conversion in PR #136153. Restore the shadow-DOM component and its local reduced-motion guard. Keep the shimmer primitive declaration-identical to base.css and drift-guarded by a unit test comparing the three CSS blocks. Remove the global panel stylesheet, restore shadow-root queries, and correct the motion docs. Revert the CSS budget bump because the component styles return to boot JS. The original 53.5 KiB ceiling passes with largest CSS at 53.4 KiB gzip.
The `.skeleton::after` highlight had no resting transform, so under prefers-reduced-motion the collapsed one-iteration animation left the gradient band settled over every skeleton block as a static stripe. The panel loading skeleton's old shadow copy avoided this with a resting `translateX(-100%)`; aligning it to base.css dropped that. Give the canonical primitive in base.css the resting transform (the drift guard carries it into the shadow copy) and assert the settled pseudo-element position in the reduced-motion browser test: without the transform the computed value is `none` and the assertion fails. Addresses the ClawSweeper finding on #136153.
|
Merged via squash.
|
…weeps (openclaw#136153) * refactor(ui): share one shimmer primitive across skeletons and text sweeps The panel loading skeleton re-declared the `.skeleton` shimmer (gradient overlay, keyframes, reduced-motion guard) inside shadow DOM because the global rules and the reduced-motion gate cannot reach a shadow root. Move it to light DOM via OpenClawLightDomElement with a namespaced stylesheet so it rides the compositor-only `.skeleton::after` transform from base.css and the global reduced-motion gate, like every other loading surface. Two text shimmers (running tool-row verb, dictation listening phase) carried identical keyframes under different names; they now share `text-shimmer` in base.css. Gradients, durations, easing, and media gating are unchanged. The motion and accessibility docs described a reduced-motion guard style that no longer exists; they now document the real gate and inventory the text shimmers. Moving the skeleton styles from boot JS to boot CSS put the boot stylesheet 365 B over the largest-CSS ceiling that main already fills to 99.9%; the ceiling moves 53.5 -> 54 KiB with operator approval (net startup bytes down). Proof: shimmer.browser.test.ts covers the panel skeleton on the shared primitive; before/after skeleton screenshots from the mocked dev server are pixel-identical (231 of 4.6M subpixels differ); pnpm ui:build passes the performance guard; check-changed green. * fix(ui): keep the panel loading skeleton self-contained for shadow-DOM hosts Panel loading skeleton hosts span shadow roots and light DOM. Global stylesheets do not cross shadow boundaries, leaving terminal, desktop, and browser loading placeholders unstyled after the light-DOM conversion in PR openclaw#136153. Restore the shadow-DOM component and its local reduced-motion guard. Keep the shimmer primitive declaration-identical to base.css and drift-guarded by a unit test comparing the three CSS blocks. Remove the global panel stylesheet, restore shadow-root queries, and correct the motion docs. Revert the CSS budget bump because the component styles return to boot JS. The original 53.5 KiB ceiling passes with largest CSS at 53.4 KiB gzip. * fix(ui): park the skeleton highlight offscreen when motion is reduced The `.skeleton::after` highlight had no resting transform, so under prefers-reduced-motion the collapsed one-iteration animation left the gradient band settled over every skeleton block as a static stripe. The panel loading skeleton's old shadow copy avoided this with a resting `translateX(-100%)`; aligning it to base.css dropped that. Give the canonical primitive in base.css the resting transform (the drift guard carries it into the shadow copy) and assert the settled pseudo-element position in the reduced-motion browser test: without the transform the computed value is `none` and the assertion fails. Addresses the ClawSweeper finding on openclaw#136153.
What Problem This Solves
The Control UI had three copies of the same shimmer idea. The panel loading skeleton (files, chat, terminal, review, browser, desktop, tasks, discussion panels) carried a variant of the skeleton shimmer with a different keyframe shape and name and nothing keeping it aligned with the
.skeletonprimitive inbase.css. The running tool-row verb and the dictation listening text each carried identical text-sweep keyframes under different names. The motion and accessibility design docs described a reduced-motion guard style (animation: none) that nothing in the codebase uses.Why This Change Was Made
One shimmer contract, stated once and enforced. The two text sweeps now share a single
text-shimmerkeyframe inbase.css; their gradients, durations, easing, andprefers-reduced-motion: no-preferencegating are unchanged. The compaction shimmer keeps its own hold-frame keyframes because its timing differs.The panel loading skeleton stays a self-contained shadow-DOM component: its hosts span shadow roots (the terminal, desktop, and browser panels) and light DOM (chat rails, diff panel), and global stylesheets never cross a shadow boundary. The repo's precedent for that boundary is a per-shadow-root copy (
ui/src/lit/scrollbar-styles.ts), so the skeleton keeps its copy of the.skeletonprimitive, now declaration-identical tobase.css(same keyframe name and shape, same declarations, same reduced-motion values) and guarded by a unit test that fails if either side drifts. A first revision of this PR moved the skeleton to light DOM; exact-head CI caught the shadow-host case (terminal and desktop "Connecting…" skeletons went unstyled), and the second commit restores shadow DOM with the drift guard.Docs now describe the real reduced-motion gate (global for light DOM, local copy for shadow roots), and the animation inventory lists the text shimmers.
User Impact
No visible change. Skeletons, tool-row text, and dictation text animate exactly as before. Production LOC net −9: 23 lines of duplicate keyframes deleted, 15 lines of shared keyframe, resting transform, and comments added, 6 lines in the skeleton component for the aligned primitive and its comment. Tests +53 (drift guard, settled-state assertion), docs −6.
Evidence
ui/src/components/panel-loading-skeleton.test.tsnow extracts the@keyframes shimmer,.skeleton, and.skeleton::afterblocks from bothbase.cssand the component's shadow styles and asserts declaration equality. Mutation check: changing only the component's duration to1.6sfails with.skeleton::after must match base.css.ui/src/e2e/claude-sessions.e2e.test.tsandui/src/e2e/desktop-panel.e2e.test.ts(the two shards that failed on the first revision) pass on the second commit, along with the panel skeleton unit test,shimmer.browser.test.ts, terminal readiness/reconnect, browser panel, embedded panels, background tasks, and workspace rail tests: 104 tests green.ui/src/e2e/chat-tool-turn-outcome.e2e.test.tsasserts the running tool row animates withtext-shimmer.pnpm ui:buildpasses the unchanged 53.5 KiB largest-CSS guard (53.4 KiB);node scripts/check-changed.mjsgreen..skeleton::afternow rests attranslateX(-100%)inbase.css(and, via the drift guard, in the skeleton's shadow copy), so the collapsed one-iteration animation parks the highlight offscreen instead of leaving a static band over the block.shimmer.browser.test.tsasserts the settled pseudo-element position underreducedMotion: "reduce"; without the transform the computed value isnoneand the assertion fails. This also fixes the pre-existing light-DOM skeletons onmain.gpt-5.6-sol, high): scoped-clean on both revisions.