From f494b1e6e8ddc17e854cf2daff2ad744b73f08ee Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Tue, 12 May 2026 14:07:06 -0600 Subject: [PATCH] perf(library-card): drop full-cover hover scrim, keep floating buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per the 2026-05-12 user call ("para localLibrary podría aceptar quitarle el overlay y solo dejar los botones, que al final son funcionalidad"), the dark `rgba(0,0,0,0.85)` overlay that filled the entire 210x210 cover on hover is gone. Each card's hover state now fades only the 3 action buttons (play + kebab) in over 120ms; the artwork stays fully visible underneath. Why this matters under CPU compositing: every pointer-traversal of a card during a mouse-wheel scroll triggered a paint of the full overlay area (44K pixels per card alpha-blended over the cover). Multiplied by ~80 cards in the pool and a continuous pointermove stream, the paint cost dominated frame time. With the scrim gone, the per-card hover paint is bounded to ~44x44 px per button backdrop — a 30x reduction. Buttons now carry their own `rgba(0,0,0,0.55)` backdrop so they stay readable on light cover art. Hover boosts that to 0.8. Same visual hierarchy as before (play primary in white, kebab outlined), just without the curtain over the artwork. cc --- .../discovery-v2/AlbumCardLibraryLite.svelte | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/lib/discovery-v2/AlbumCardLibraryLite.svelte b/src/lib/discovery-v2/AlbumCardLibraryLite.svelte index f23befc14..87ee418b7 100644 --- a/src/lib/discovery-v2/AlbumCardLibraryLite.svelte +++ b/src/lib/discovery-v2/AlbumCardLibraryLite.svelte @@ -343,14 +343,20 @@ border-radius: 10px; } - /* Dark scrim + centered action buttons. Single opacity transition, - no transform, no blur, no per-child animation. */ + /* No full-cover scrim. Earlier versions had a 210x210 + `rgba(0,0,0,0.85)` overlay with `opacity 0 → 1` on hover; that + was the single biggest scroll-time paint cost on WebKitGTK under + software compositing — every pointer-traversal of a card during + mouse-wheel scroll triggered a paint of the full overlay area. + Per the 2026-05-12 user call ("para localLibrary podría aceptar + quitarle el overlay y solo dejar los botones, que al final son + funcionalidad"), the buttons float directly on the artwork on + hover. Each button carries its own dark backdrop so they stay + readable on light covers; that's a 44x44 rect per button instead + of a 210x210 rect per card. */ .overlay { position: absolute; inset: 0; - background: rgba(10, 10, 10, 0.85); - opacity: 0; - transition: opacity 150ms ease; z-index: 2; display: flex; align-items: center; @@ -358,23 +364,26 @@ pointer-events: none; } - .card:hover .overlay { - opacity: 1; - pointer-events: auto; - } - .action-buttons { display: flex; align-items: center; gap: 12px; + opacity: 0; + transition: opacity 120ms ease; + } + + .card:hover .action-buttons { + opacity: 1; + pointer-events: auto; } .overlay-btn { width: 36px; height: 36px; border-radius: 50%; - border: 1.5px solid rgba(255, 255, 255, 0.9); - background: transparent; + border: 1.5px solid rgba(255, 255, 255, 0.95); + /* Per-button backdrop replaces the full-cover scrim. */ + background: rgba(0, 0, 0, 0.55); color: #fff; display: flex; align-items: center; @@ -384,7 +393,7 @@ } .overlay-btn:hover { - background-color: rgba(255, 255, 255, 0.15); + background-color: rgba(0, 0, 0, 0.8); } .overlay-btn.primary {