[PR #4899] [MERGED] docs(card-css): animate opacity, not box-shadow, in the glow example #6532

Closed
opened 2026-10-23 04:11:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4899
Author: @kolacheee
Created: 8/11/2026
Status: ✅ Merged
Merged: 8/11/2026
Merged by: @kolacheee

Base: staging ← Head: docs/card-css-glow-perf


📝 Commits (2)

  • 4d117fb docs(card-css): animate opacity, not box-shadow, in the glow example (#4897)
  • f7606e4 docs(card-css): drop the bubble's static inset so it doesn't stack with the pulsing ::after glow (CodeRabbit)

📊 Changes

2 files changed (+25 additions, -4 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 docs/appearance/card-css-theming.md (+24 -4)

📄 Description

Linked issue

Related to #4897. This fixes the documented example that triggers the problem; the engine-side scoping fixes (the two reduce toggles) remain tracked in that issue.

Why this change

  • The Card CSS Theming guide's showcase example animates box-shadow (@keyframes grimoire-pulse) on every roleplay message bubble. box-shadow is a paint property, so animating it forces a full repaint and blur recomputation of the bubble on every frame. On a weak/integrated GPU this pins the card (a reporter saw ~53% GPU with fans audible, and 158 fps of continuous repaints in the DevTools FPS meter; Paint flashing lit up the whole message bubble), and any backdrop-filter panel layered over it re-blurs too.
  • Because this is the flagship "here is everything you can do" example, every creator who copies it inherits the footgun. The example should teach the performant pattern instead.

What changed

  • Reworked the grimoire-pulse glow so it animates opacity on a full-bleed ::after overlay instead of the bubble's box-shadow. Opacity is GPU-composited, so the pulse costs almost nothing.
  • The steady outer halo stays as a static box-shadow on the bubble; the pulsing inner glow rides the overlay. overflow: hidden is preserved (message content, e.g. inline GIFs, stays clipped to the rounded corners), and the overlay is pointer-events: none so it never intercepts clicks.
  • Added CSS comments explaining the paint-vs-compositor reason, so the lesson travels with the code.
  • Added a CHANGELOG entry.
  • Sanitizer-safe: checked against packages/client/src/lib/card-css.ts (blocklist model, not allowlist; opacity, pointer-events, will-change, ::after, and content: "" all pass, and the theme-token blocklist is untouched).

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Ran pnpm regression:docs locally: passed (validates doc structure across all 11 languages: en, de, es, fr, hi, ja, ko, pl, pt-br, ru, zh-hans).
  • Still needs a human render pass (I could not run the dev server here without colliding with a live install): paste the example into a card, enable Card Theming, and confirm the roleplay bubble still pulses (light + dark), the outer halo shows, and inline image/GIF corners stay clipped.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

Notes: CHANGELOG updated. A companion docs-i18n PR mirrors the identical code-block change to all 10 locale copies of card-css-theming.md (the CSS block is byte-identical across locales, so no translation is required); link added once opened.

UI evidence (if applicable)

Docs-only (an example code block). The reporter's DevTools Paint-flashing capture showed the entire message bubble repainting every frame before the fix.

Summary by CodeRabbit

  • Documentation
    • Updated the Card CSS Theming guide’s animated glow example.
    • The inner glow now animates overlay opacity while the bubble’s outer halo remains static.
    • Added a changelog entry documenting the correction.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/4899 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 8/11/2026 **Status:** ✅ Merged **Merged:** 8/11/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `docs/card-css-glow-perf` --- ### 📝 Commits (2) - [`4d117fb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4d117fb82475191a2b4ef11c9bdad996d33b86ac) docs(card-css): animate opacity, not box-shadow, in the glow example (#4897) - [`f7606e4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f7606e4214a3f8735fabaa2907551532da3641db) docs(card-css): drop the bubble's static inset so it doesn't stack with the pulsing ::after glow (CodeRabbit) ### 📊 Changes **2 files changed** (+25 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `docs/appearance/card-css-theming.md` (+24 -4) </details> ### 📄 Description ## Linked issue Related to #4897. This fixes the documented example that triggers the problem; the engine-side scoping fixes (the two reduce toggles) remain tracked in that issue. ## Why this change - The Card CSS Theming guide's showcase example animates `box-shadow` (`@keyframes grimoire-pulse`) on every roleplay message bubble. `box-shadow` is a paint property, so animating it forces a full repaint and blur recomputation of the bubble on every frame. On a weak/integrated GPU this pins the card (a reporter saw ~53% GPU with fans audible, and 158 fps of continuous repaints in the DevTools FPS meter; Paint flashing lit up the whole message bubble), and any `backdrop-filter` panel layered over it re-blurs too. - Because this is the flagship "here is everything you can do" example, every creator who copies it inherits the footgun. The example should teach the performant pattern instead. ## What changed - Reworked the `grimoire-pulse` glow so it animates `opacity` on a full-bleed `::after` overlay instead of the bubble's `box-shadow`. Opacity is GPU-composited, so the pulse costs almost nothing. - The steady outer halo stays as a static `box-shadow` on the bubble; the pulsing inner glow rides the overlay. `overflow: hidden` is preserved (message content, e.g. inline GIFs, stays clipped to the rounded corners), and the overlay is `pointer-events: none` so it never intercepts clicks. - Added CSS comments explaining the paint-vs-compositor reason, so the lesson travels with the code. - Added a CHANGELOG entry. - Sanitizer-safe: checked against `packages/client/src/lib/card-css.ts` (blocklist model, not allowlist; `opacity`, `pointer-events`, `will-change`, `::after`, and `content: ""` all pass, and the theme-token blocklist is untouched). ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Ran `pnpm regression:docs` locally: passed (validates doc structure across all 11 languages: en, de, es, fr, hi, ja, ko, pl, pt-br, ru, zh-hans). - Still needs a human render pass (I could not run the dev server here without colliding with a live install): paste the example into a card, enable Card Theming, and confirm the roleplay bubble still pulses (light + dark), the outer halo shows, and inline image/GIF corners stay clipped. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) Notes: CHANGELOG updated. A companion `docs-i18n` PR mirrors the identical code-block change to all 10 locale copies of `card-css-theming.md` (the CSS block is byte-identical across locales, so no translation is required); link added once opened. ## UI evidence (if applicable) Docs-only (an example code block). The reporter's DevTools Paint-flashing capture showed the entire message bubble repainting every frame before the fix. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Updated the Card CSS Theming guide’s animated glow example. - The inner glow now animates overlay opacity while the bubble’s outer halo remains static. - Added a changelog entry documenting the correction. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:11:20 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6532
No description provided.