fix(smart-playlists): replace hand-drawn On Repeat cover with SVG via resvg#155
Conversation
… resvg The old `render_on_repeat_canvas` painted the indigo gradient and the two overlapping pink rings pixel-by-pixel without anti-aliasing, which left the cover visibly stair-stepped at the 640-px canvas size and worse when the Home tile scaled it down. Swap in a vector source ([on_repeat.svg]) rasterised through resvg + usvg + tiny-skia (default features disabled — the SVG is pure shape + gradient + filter, no fonts or embedded rasters, keeps the dep bloat to ~300 KB compiled). New design centres a bezier infinity loop on the canvas, strokes it with the rainbow gradient `#ff3377 → #9933ff → #33ccff` under a gaussian glow + a thin white inner rim. No `<text>` in the SVG so the locale-agnostic guarantee documented in CLAUDE.md stays intact — React keeps overlaying the eyebrow + title. `build_on_repeat_cover` already dedupes by blake3 hash, so existing installs pick up the new image on the next "Régénérer".
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughLe rendu de la couverture « On Repeat » passe d'une génération procédurale (dégradé + anneaux) à un pipeline SVG rasterisé déterministe. Les dépendances de rasterisation sont ajoutées, l'implémentation remplace l'ancien code, les erreurs sont propagées, les tests sont adaptés et la documentation est mise à jour. ChangesOn Repeat Cover — Passage au rendu SVG
sequenceDiagram
participant Caller as build_on_repeat_cover
participant Parser as usvg::Tree
participant Renderer as resvg (renderer)
participant Pixmap as tiny_skia::Pixmap
Caller->>Parser: parse(ON_REPEAT_SVG)
Parser->>Caller: Tree / parse error
Caller->>Renderer: render(Tree, scale -> 640×640)
Renderer->>Pixmap: rasterize -> Pixmap (RGBA premult)
Pixmap->>Caller: raw pixels
Caller->>Caller: RGBA→RGB conversion -> RgbImage / AppResult
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Caught while reviewing the About panel — the SQLx tile still read 0.8 after #153 landed.
Summary
The old On Repeat cover was painted pixel-by-pixel without anti-aliasing, leaving visible stair-stepping on the rings — particularly noticeable when scaled down in the Home carousel. User flagged it as «vraiment moche et pixelisé».
Swap the rasteriser for a vector source at
src-tauri/src/smart_playlists/on_repeat.svg, rendered through resvg + usvg + tiny-skia (default features disabled — the SVG is pure shape + gradient + filter, no fonts or embedded rasters, ~300 KB compiled).New design
#240c47) → near-black (#0d041a) diagonal gradient background#ff3377 → #9933ff → #33ccff)What stayed the same
metadata_artwork/<hash>.jpg<text>in the SVG → locale-agnostic guarantee preserved per CLAUDE.mdbuild_on_repeat_coverdedupes by hash → existing installs pick up the new image on the next "Régénérer"Test plan
cargo test --manifest-path src-tauri/Cargo.toml --lib smart_playlists::cover→ 8/8 passedon_repeat_canvas_renders_with_opaque_backgroundcovers: indigo gradient at top-left, near-black at bottom-right, at least one strongly pink pixel on the centred ring row.Summary by CodeRabbit
Notes de version
Mises à jour
Documentation