-
-
Notifications
You must be signed in to change notification settings - Fork 930
feat(css-map): added newer mappings for progress bar #3720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+14
−0
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid introducing a third public progress-bar namespace.
css-map.jsonvalues become the final class names emitted during preprocessing insrc/preprocess/preprocess.go:262-277. This file already exposes progress bar selectors underprogress-bar*andx-progressBar-*(seecss-map.json:1612-1618andcss-map.json:1844-1852), so addingprogressBar-*here makes themes/plugins branch on Spotify version again. Please normalize these new hashes onto the existing stable aliases instead of publishing a new naming scheme.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why
x-progressBar-*as an 'x' though, and I get that there are already selectors underprogress-bar*but I would make more sense to doprogressBar-*since dashes would separate sub-classes from the main category they belong to and then use camelCase for the restThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Adrien5902, great question — thex-prefix in the existingx-progressBar-*(andx-toggle-*,x-settings-*,x-filterBox-*, etc.) appears to be Spotify's own internal namespace convention for shared/cross-platform UI primitives, not something Spicetify invented. So thex-is already baked into the original class name Spotify used for those older progress-bar atoms.For the newer
progressBar-*names you're adding here: if this is literally what Spotify is now shipping in their JS bundle (following their updated naming, as the commit message says), thenprogressBar-*is the correct mapping to use, and your naming rationale (dash separates module from element, camelCase within) is perfectly consistent with how other module-level names work incss-map.json(e.g.main-*,artist-*,playlist-*).My original concern is less about the style of the new names and more about three co-existing namespaces for what is conceptually the same UI component:
progress-bar*playback-progressbar,progress-bar__sliderx-progressBar-*x-progressBar-fillColor,x-progressBar-sliderAreaprogressBar-*(new)progressBar-wrapper,progressBar-foregroundTheme and plugin authors currently write selectors targeting
progress-bar__sliderorx-progressBar-fillColor. If Spotify has migrated these to a fully new component with genuinely different hashes, adding the new mappings is the right call — but it would be helpful to document (e.g. in a comment or PR description) thatprogressBar-*replaces the older two families on newer Spotify versions, so theme authors know which to target for which version.If the intent is that the old hashes are now obsolete (Spotify removed those elements), the old entries could even be removed to avoid confusion — though that would be a breaking change for themes targeting older clients.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see so I guess going with
x-progressBar-*would make sense hereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Adrien5902, that makes sense! Renaming the new entries to follow the existingx-progressBar-*convention keeps all progress bar primitives under one consistent namespace for theme authors. Here's the corrected block to replace what's in the diff:None of the new sub-names (
wrapper,enabled,foreground,middleground,handle, etc.) conflict with the existingx-progressBar-fillColor,x-progressBar-progressBarBg, orx-progressBar-sliderAreaentries, so this is a clean addition.(◕ᴥ◕)