fix(css): incorrect shape for artist profile picture#3885
Conversation
…add line-break for better compatibility
📝 WalkthroughWalkthroughThe appended CSS snippet used to patch xpui.css/xpui-snapshot.css was updated: card image wrapper border-radius changed from 6px to 50%, and card metadata rules now include a standard line-clamp:2 property alongside the existing -webkit-line-clamp:2. ChangesCSS Patch Update
Estimated code review effort: 1 (Trivial) | ~2 minutes PoemA rabbit hopped through CSS lines, 🚥 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: 1
🤖 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 `@src/preprocess/preprocess.go`:
- Line 299: The circular border-radius change is applied too broadly through
main-cardImage-imageWrapper, which affects multiple card types. Update the
styling so only artist cards get the 50% radius by targeting the existing
main-cardImage-circular marker (or another artist-specific selector) instead of
the shared wrapper class, and keep the shared card artwork styles unchanged.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6aaeed2e-1513-4e27-a5b9-8a8b2768d577
📒 Files selected for processing (1)
src/preprocess/preprocess.go
| if fileName == "xpui.css" || fileName == "xpui-snapshot.css" { | ||
| content = content + ` | ||
| .main-gridContainer-fixedWidth{grid-template-columns:repeat(auto-fill,var(--column-width));width:calc((var(--column-count) - 1) * var(--grid-gap)) + var(--column-count) * var(--column-width) )}.main-cardImage-imageWrapper{background-color:var(--card-color,#333);border-radius:6px;-webkit-box-shadow:0 8px 24px rgba(0,0,0,.5);box-shadow:0 8px 24px rgba(0,0,0,.5);padding-bottom:100%;position:relative;width:100%}.main-card-imagePlaceholder,.main-cardImage-image{height:100%;left:0;position:absolute;top:0;width:100%}.main-card-card{border-radius:8px;-webkit-box-flex:1;background:var(--spice-player);-ms-flex:1;flex:1;isolation:isolate;padding:16px;position:relative;-webkit-transition:background-color .3s;transition:background-color .3s;width:100%}.main-card-card:hover,.main-card-card[data-context-menu-open=true]{background:var(--spice-card)}.main-card-card:focus-within{background:var(--spice-card)}.main-card-card .main-card-cardLink{position:absolute;z-index:0}.RjYPjR7FsVf42b3a5Efm:before,.Z78JmW4GUvvxLXSFjb7R:not(:last-child):after{content:"•";margin:0 4px}.main-card-card a,.main-card-card button{position:relative;z-index:1}.main-card-cardLink{bottom:0;content:"";cursor:pointer;left:0;overflow:hidden;right:0;text-indent:100%;top:0;white-space:nowrap;z-index:0}.main-card-cardTitle{z-index:1}.main-card-cardTitleLink:focus,.main-card-cardTitleLink:hover{text-decoration:none}.Wmr5qZ5jui6X37XCrChA{opacity:0}.main-card-newEpisodeIndicator{margin-top:3px}.main-card-imageContainer{pointer-events:none;position:relative}.main-card-imageContainerOld,.main-card-imageContainerSkeleton{margin-bottom:16px}.main-card-cardMetadata{min-height:62px;-webkit-line-clamp:2}.main-card-DownloadStatusIndicator{bottom:12px;inset-inline-end:12px;position:absolute}.main-card-PlayButtonContainer{border-radius:500px;bottom:8px;-webkit-box-shadow:0 8px 8px rgba(var(--spice-rgb-shadow),.3);box-shadow:0 8px 8px rgba(var(--spice-rgb-shadow),.3);inset-inline-end:8px;opacity:0;pointer-events:none;position:absolute;-webkit-transform:translateY(8px);transform:translateY(8px);z-index:2}@media(pointer:coarse){.main-card-PlayButtonContainer{display:none}}@media(prefers-reduced-motion:no-preference){.main-card-PlayButtonContainer{-webkit-transition:opacity .2s ease-out,-webkit-transform .2s ease-out;transition:transform .2s ease-out,opacity .2s ease-out,-webkit-transform .2s ease-out}}.main-card-PlayButtonContainerVisible{opacity:1;pointer-events:auto;position:absolute;-webkit-transform:translateY(0);transform:translateY(0)}.main-card-cardContainer{--animation-speed:0.2s!important;white-space:normal}.main-card-card:hover .main-card-PlayButtonContainer,.main-card-cardContainer:hover .main-card-PlayButtonContainer{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.main-card-card:focus-within .main-card-PlayButtonContainer,.main-card-cardContainer:focus-within{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}@media(pointer:fine){.main-card-card .main-card-cardLink:hover{cursor:pointer}.main-card-card:hover .main-card-PlayButtonContainer,.main-card-cardContainer:hover .main-card-PlayButtonContainer{opacity:1;pointer-events:auto;position:absolute}.main-card-card:focus-within .main-card-PlayButtonContainer,.main-card-cardContainer:focus-within .main-card-PlayButtonContainer{opacity:1;pointer-events:auto;position:absolute}}.main-card-cardMetadata,.v3isO2phyJAoZRkmme0G{display:-webkit-box;-webkit-box-orient:vertical} | ||
| .main-gridContainer-fixedWidth{grid-template-columns:repeat(auto-fill,var(--column-width));width:calc((var(--column-count) - 1) * var(--grid-gap)) + var(--column-count) * var(--column-width) )}.main-cardImage-imageWrapper{background-color:var(--card-color,#333);border-radius:50%;-webkit-box-shadow:0 8px 24px rgba(0,0,0,.5);box-shadow:0 8px 24px rgba(0,0,0,.5);padding-bottom:100%;position:relative;width:100%}.main-card-imagePlaceholder,.main-cardImage-image{height:100%;left:0;position:absolute;top:0;width:100%}.main-card-card{border-radius:8px;-webkit-box-flex:1;background:var(--spice-player);-ms-flex:1;flex:1;isolation:isolate;padding:16px;position:relative;-webkit-transition:background-color .3s;transition:background-color .3s;width:100%}.main-card-card:hover,.main-card-card[data-context-menu-open=true]{background:var(--spice-card)}.main-card-card:focus-within{background:var(--spice-card)}.main-card-card .main-card-cardLink{position:absolute;z-index:0}.RjYPjR7FsVf42b3a5Efm:before,.Z78JmW4GUvvxLXSFjb7R:not(:last-child):after{content:"•";margin:0 4px}.main-card-card a,.main-card-card button{position:relative;z-index:1}.main-card-cardLink{bottom:0;content:"";cursor:pointer;left:0;overflow:hidden;right:0;text-indent:100%;top:0;white-space:nowrap;z-index:0}.main-card-cardTitle{z-index:1}.main-card-cardTitleLink:focus,.main-card-cardTitleLink:hover{text-decoration:none}.Wmr5qZ5jui6X37XCrChA{opacity:0}.main-card-newEpisodeIndicator{margin-top:3px}.main-card-imageContainer{pointer-events:none;position:relative}.main-card-imageContainerOld,.main-card-imageContainerSkeleton{margin-bottom:16px}.main-card-cardMetadata{min-height:62px;line-clamp:2;-webkit-line-clamp:2}.main-card-DownloadStatusIndicator{bottom:12px;inset-inline-end:12px;position:absolute}.main-card-PlayButtonContainer{border-radius:500px;bottom:8px;-webkit-box-shadow:0 8px 8px rgba(var(--spice-rgb-shadow),.3);box-shadow:0 8px 8px rgba(var(--spice-rgb-shadow),.3);inset-inline-end:8px;opacity:0;pointer-events:none;position:absolute;-webkit-transform:translateY(8px);transform:translateY(8px);z-index:2}@media(pointer:coarse){.main-card-PlayButtonContainer{display:none}}@media(prefers-reduced-motion:no-preference){.main-card-PlayButtonContainer{-webkit-transition:opacity .2s ease-out,-webkit-transform .2s ease-out;transition:transform .2s ease-out,opacity .2s ease-out,-webkit-transform .2s ease-out}}.main-card-PlayButtonContainerVisible{opacity:1;pointer-events:auto;position:absolute;-webkit-transform:translateY(0);transform:translateY(0)}.main-card-cardContainer{--animation-speed:0.2s!important;white-space:normal}.main-card-card:hover .main-card-PlayButtonContainer,.main-card-cardContainer:hover .main-card-PlayButtonContainer{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.main-card-card:focus-within .main-card-PlayButtonContainer,.main-card-cardContainer:focus-within{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}@media(pointer:fine){.main-card-card .main-card-cardLink:hover{cursor:pointer}.main-card-card:hover .main-card-PlayButtonContainer,.main-card-cardContainer:hover .main-card-PlayButtonContainer{opacity:1;pointer-events:auto;position:absolute}.main-card-card:focus-within .main-card-PlayButtonContainer,.main-card-cardContainer:focus-within .main-card-PlayButtonContainer{opacity:1;pointer-events:auto;position:absolute}}.main-card-cardMetadata,.v3isO2phyJAoZRkmme0G{display:-webkit-box;-webkit-box-orient:vertical} |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== File listing ==\n'
git ls-files | rg '^(src/preprocess/preprocess\.go|.*css-map\.json|.*package\.json|.*\.html|.*\.tsx?|.*\.jsx?)$' || true
printf '\n== Find relevant class names ==\n'
rg -n --hidden --no-ignore-vcs 'main-cardImage-(imageWrapper|circular)|main-card-cardMetadata|line-clamp' .
printf '\n== Inspect preprocess line region ==\n'
nl -ba src/preprocess/preprocess.go | sed -n '285,310p'
printf '\n== Inspect css-map references if present ==\n'
for f in $(git ls-files | rg 'css-map\.json$'); do
echo "--- $f"
rg -n 'main-cardImage-(imageWrapper|circular)|main-card-cardMetadata' "$f" || true
doneRepository: spicetify/cli
Length of output: 8881
🏁 Script executed:
#!/bin/bash
set -euo pipefail
pwd
git ls-files 'src/preprocess/preprocess.go' '*css-map.json'Repository: spicetify/cli
Length of output: 212
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show the exact change around the modified line and any surrounding class names.
nl -ba src/preprocess/preprocess.go | sed -n '294,302p'
# Locate the CSS map entries that mention the wrapper and circular variants.
for f in $(git ls-files | rg 'css-map\.json$'); do
echo "--- $f"
rg -n 'main-cardImage-(imageWrapper|circular)' "$f" || true
doneRepository: spicetify/cli
Length of output: 191
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Search for actual markup/DOM usage of the circular class.
rg -n --hidden --no-ignore-vcs 'main-cardImage-circular' .
# Search for the generic wrapper usage to see whether the selector is shared.
rg -n --hidden --no-ignore-vcs 'main-cardImage-imageWrapper' .Repository: spicetify/cli
Length of output: 4190
Scope the circular radius to artist cards only.
main-cardImage-imageWrapper is used by multiple card types in this repo, so changing it to border-radius:50% will make album/playlist/podcast artwork circular too. Use the dedicated main-cardImage-circular marker (or an equivalent artist-only selector) for this shape change instead.
🤖 Prompt for 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.
In `@src/preprocess/preprocess.go` at line 299, The circular border-radius change
is applied too broadly through main-cardImage-imageWrapper, which affects
multiple card types. Update the styling so only artist cards get the 50% radius
by targeting the existing main-cardImage-circular marker (or another
artist-specific selector) instead of the shared wrapper class, and keep the
shared card artwork styles unchanged.
Summary by CodeRabbit