feat(snippets): hide all images across Spotify#1039
feat(snippets): hide all images across Spotify#1039yacksonn wants to merge 2 commits intospicetify:mainfrom
Conversation
WalkthroughA single new snippet entry, "Hide All Images", was added to Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
resources/snippets.json (1)
536-541: Refactor CSS for clarity, remove dead code, and reduce selector overlap.The CSS has several issues that should be addressed:
- Dead code (line 539):
.Root__main-view, .main-view-container, .os-content {}— empty selector block serves no purpose.- Redundant properties:
display: none !important; visibility: hidden !important;— onlydisplay: noneis needed.- Overly broad catch-all selector at the end:
[style*='background-image'], [style*='background:url'], [style*='image-set(']overlaps with earlier, more specific rules and makes the CSS inefficient.- Potentially unmatched class names:
.artist-image,.card-imageappear generic and may not correspond to actual Spotify UI elements. Verify these exist in the DOM.- Formatting: The minified single-line CSS is difficult to maintain. Consider formatting it with line breaks for readability.
Additionally, the universal
imgselector hides all images globally without scoping. If other UI elements rely on images for layout or icons, this could cause unintended side effects.Consider applying this refactor:
- "code": ".Root__main-view, .main-view-container, .os-content {} .Root__main-view [style*='background-image']:not([class*='Icon']):not([class*='icon']), .Root__main-view [style*='background:url']:not([class*='Icon']):not([class*='icon']), .Root__main-view [style*='image-set(']:not([class*='Icon']):not([class*='icon']) { background: none !important; } img, .cover-art-image, .artist-image, .card-image, .main-nowPlayingWidget-coverArt { display: none !important; visibility: hidden !important; } [aria-label*='Now Playing'] [style*='background-image'], [aria-label*='Now playing'] [style*='background-image'], [aria-label*='Now Playing'] [style*='image-set('], [aria-label*='Now playing'] [style*='image-set('], [aria-label*='Now Playing'] [style*='url('], [aria-label*='Now playing'] [style*='url('], [class^='main-nowPlayingView'] [style*='background-image'], [class^='main-nowPlayingView'] [style*='image-set('], [class^='main-nowPlayingView'] [style*='url('] { background: none !important; -webkit-mask-image: none !important; mask-image: none !important; } [style*='background-image'], [style*='background:url'], [style*='image-set('] { background: none !important; -webkit-mask-image: none !important; mask-image: none !important; }", + "code": ".Root__main-view [style*='background-image']:not([class*='Icon']):not([class*='icon']),\n.Root__main-view [style*='background:url']:not([class*='Icon']):not([class*='icon']),\n.Root__main-view [style*='image-set(']:not([class*='Icon']):not([class*='icon']),\nimg,\n.cover-art-image,\n.main-nowPlayingWidget-coverArt {\n display: none !important;\n}\n\n[aria-label*='Now Playing'] [style*='background-image'],\n[aria-label*='now playing'] [style*='background-image'],\n[class^='main-nowPlayingView'] [style*='background-image'] {\n background: none !important;\n -webkit-mask-image: none !important;\n mask-image: none !important;\n}",The refactored version:
- Removes the empty selector block
- Removes redundant
visibility: hidden- Consolidates overlapping selectors and removes the catch-all at the end
- Normalizes aria-label matching to lowercase
- Formats for readability and maintainability
Verify that
.artist-imageand.card-imageare actual Spotify classes before removing them.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
resources/assets/snippets/Blank-PNG-Pic.pngis excluded by!**/*.png
📒 Files selected for processing (1)
resources/snippets.json(1 hunks)
|
@rxri Can I get a review when you get a chance |
This is different from Spicetify-HideImages-Extension. This provides comprehensive blocking of spotify images including:
Summary by CodeRabbit