feat(snippets): add Hide Playlist Ads snippet - #1204
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds a “Hide Playlist Ads” snippet to ChangesPlaylist ad hiding
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@resources/snippets.json`:
- Line 557: Update the `.main-entityHeader-headerText` selector to target an
ad-specific discriminator rather than any `a[target="_blank"]`; use the
available ad-specific href, data-testid, or class, and retain a separate
fallback selector only when it is independently ad-specific. Ensure legitimate
owner or metadata links do not cause the entire header row to be hidden.
- Line 557: Update the sponsor-card selectors near
section[aria-label="Advertisement"] to include a locale-independent stable
anchor from the card DOM, such as its testid, class, or distinctive structure,
while preserving the existing hostname selectors. Add localized fixture coverage
confirming the new selector hides the sponsor card when the aria-label is not
English and no servedby./flashtalking link is present.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d5c3a81f-5098-4b6d-bbb2-229f047f7f2e
⛔ Files ignored due to path filters (1)
resources/assets/snippets/hide-playlist-ads.pngis excluded by!**/*.png
📒 Files selected for processing (1)
resources/snippets.json
|
Good catches, both addressed.
On localized fixtures: snippets in this repo are CSS strings in snippets.json with no test harness, so there's nowhere to add them. Happy to include the markup I tested against in the PR description if that's useful. |
|
Marketplace snippets are not a place to do ad-hiding functionality |
Hides sponsored content in playlist and Now Playing headers: the video ad, the "Limited ads • Presented by X" row in both places, and the sponsor card section.
Every selector anchors on data-testid, href, or css-map class names rather than Spotify's hashed classes. Each target has two independent anchors so a single rename doesn't disable the rule.
Summary by CodeRabbit