-
-
Notifications
You must be signed in to change notification settings - Fork 290
feat: add semantic selectors for now-playing media #1138
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
Conversation
This change adds unique class names to the elements that display the currently playing media information. This makes it easier for extension developers to parse the DOM and understand what media is playing. The following classes have been added: - `media-player`: The main player container. - `player-cover-art`: The cover art of the playing track. - `song-title`: The title of the playing track. - `song-artist`: The artist of the playing track. - `song-album`: The album of the playing track. - `player-state-playing`/`player-state-paused`: The state of the player. - `elapsed-time`: The elapsed time of the playing track. - `total-duration`: The total duration of the playing track.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
I'm not opposed to this, but adding plain classes is a bit prone to breakage if these components ever get refactored. At the very least I would say add them to an enum with comments on how they're being used, and then reference them in the components. |
|
Thanks for the feedback . I moved the selectors to consts and added a node. Would there be anything else I should change? |
This change adds unique class names to the elements that display the currently playing media information. This makes it easier for extension developers to parse the DOM and understand what media is playing.
It'll allow us to do things like web-scrobbler/web-scrobbler#5612 easier since elements will be semantically available.
The following classes have been added:
media-player: The main player container.player-cover-art: The cover art of the playing track.song-title: The title of the playing track.song-artist: The artist of the playing track.song-album: The album of the playing track.player-state-playing/player-state-paused: The state of the player.elapsed-time: The elapsed time of the playing track.total-duration: The total duration of the playing track.I did test the changes locally against the extension using the tags and it did work. However not sure if what was changed is inline with how it should be structured.