Skip to content

refactor(ui): share one shimmer primitive across skeletons and text sweeps - #136153

Merged
steipete merged 3 commits into
mainfrom
steipete/css-shimmer-effect-b97171
Sep 2, 2026
Merged

steipete merged 3 commits into
mainfrom
steipete/css-shimmer-effect-b97171

Conversation

@steipete

@steipete steipete commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

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 .skeleton primitive in base.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-shimmer keyframe in base.css; their gradients, durations, easing, and prefers-reduced-motion: no-preference gating 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 .skeleton primitive, now declaration-identical to base.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.ts now extracts the @keyframes shimmer, .skeleton, and .skeleton::after blocks from both base.css and the component's shadow styles and asserts declaration equality. Mutation check: changing only the component's duration to 1.6s fails with .skeleton::after must match base.css.
  • ui/src/e2e/claude-sessions.e2e.test.ts and ui/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.ts asserts the running tool row animates with text-shimmer.
  • pnpm ui:build passes the unchanged 53.5 KiB largest-CSS guard (53.4 KiB); node scripts/check-changed.mjs green.
  • Reduced-motion resting state (ClawSweeper finding on the first revision): .skeleton::after now rests at translateX(-100%) in base.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.ts asserts the settled pseudo-element position under reducedMotion: "reduce"; without the transform the computed value is none and the assertion fails. This also fixes the pre-existing light-DOM skeletons on main.
  • Autoreview (Codex, gpt-5.6-sol, high): scoped-clean on both revisions.

…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.
@clawsweeper

clawsweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts size: L maintainer Maintainer-authored PR labels Sep 2, 2026
@steipete
steipete marked this pull request as ready for review September 2, 2026 08:17
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 2, 2026
@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 5:04 AM ET / 09:04 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: 205bf99c9f7f9b63c9ab4204c514a5726f309750

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, production-neutral refactor with the prior correctness finding addressed and no remaining blocking source defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, behavior-neutral UI refactor is exempt from the external-contributor proof gate; the supplied focused browser and component test evidence maps the changed CSS owners and caller surfaces, though no independently inspected live media was supplied.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored, behavior-neutral UI refactor is exempt from the external-contributor proof gate; the supplied focused browser and component test evidence maps the changed CSS owners and caller surfaces, though no independently inspected live media was supplied.
Evidence reviewed 6 items Shared light-DOM primitive: The exact PR head adds the shared text-shimmer keyframe and restores the skeleton highlight's offscreen resting transform, preserving the reduced-motion settled state.
Shadow-root owner boundary: The panel component retains its local skeleton declarations and reduced-motion guard because global styles do not cross its shadow boundary.
Caller and sibling coverage: Terminal and desktop panel callers render the reusable shadow-root component, and the focused browser test verifies the light-DOM reduced-motion settled transform.
Findings None None.
Security None None.

How this fits together

Global 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests +52, Docs -6. Total +46 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 4 26 26 0
Tests 3 54 2 +52
Docs 2 16 22 -6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 96 50 +46

Review metrics

Metric Value Why it matters
Production vs test delta production +26/-26 (net 0); tests +54/-2; docs +16/-22 The refactor is production-neutral after deleting duplicate keyframes; added test coverage guards the cross-shadow-root invariant.

Technical review

Best 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.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool 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: This maintainer-authored, behavior-neutral UI refactor is exempt from the external-contributor proof gate; the supplied focused browser and component test evidence maps the changed CSS owners and caller surfaces, though no independently inspected live media was supplied.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.
  • remove merge-risk: 🚨 other: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: This is a bounded Control UI maintenance change with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored, behavior-neutral UI refactor is exempt from the external-contributor proof gate; the supplied focused browser and component test evidence maps the changed CSS owners and caller surfaces, though no independently inspected live media was supplied.

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)

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 (2 earlier review cycles)
  • reviewed 2026-09-02T08:25:59.052Z sha aef59ce :: found issues before merge. :: [P2] Preserve the reduced-motion resting transform
  • reviewed 2026-09-02T08:50:30.249Z sha 477a6a2 :: found issues before merge. :: [P2] Preserve the reduced-motion resting transform

…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.
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed scripts Repository scripts size: L labels Sep 2, 2026
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.
@clawsweeper clawsweeper Bot added 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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Sep 2, 2026
@steipete
steipete merged commit c077653 into main Sep 2, 2026
203 checks passed
@steipete
steipete deleted the steipete/css-shimmer-effect-b97171 branch September 2, 2026 09:15
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
…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.
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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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