Add Lucide icon picker with custom MA device icons for player settings#1779
Add Lucide icon picker with custom MA device icons for player settings#1779dmoo500 wants to merge 15 commits into
Conversation
|
Satisfies Music Assistant Project Board (view) |
|
So we are slowly switching everything to lucide icons. @MarvinSchenkel, do you think this make sense or it would be preferable to directly update it with an icon picker with lucide icons ? |
If the effort is low the change the icons in the picker to lucide icons, I would suggest to go for lucide 👍 |
|
@MarvinSchenkel hmmm, i don't think it's low coz we have to do a new component (even if i think there is already examples online so that's ok) but the main problem is that everyone who's already using custom mdi icons will not have it anymore. So either we chose a default icon if they were using a mdi icon and we let them modify with lucide for others or we stay with mdi for now (but we will modify it at some point) |
|
We want to switch to lucide icons anyways and we also want to have some custom player specific icons, like an outline of a homepod mini etc. So maybe we should start working on that ? Then backend can already set a good default based on the player type/model. For instance, I would also love to see some icons for specific areas in your house, such as a kitchen etc. Idea: what if we support both for now so it remains backwards compatible ? alternative is that we do a one time migration in the backend to migrate well-known mdi icons to our curated list and reset the ones we cant match to default |
|
@marcelveldt This PR has been updated to address your feedback: What is implemented:
|
|
|
||
| <!-- icon list items --> | ||
| <template #item="{ item, props: itemProps }"> | ||
| <v-list-item v-bind="itemProps" :title="item.raw.value"> |
| @@ -0,0 +1,112 @@ | |||
| <template> | |||
| <v-autocomplete | |||
|
For the vuetify component, maybe you have no choice for the v-autocomplete since it's for the settings elements that didn't get refactored yet. You can let it like this because using a shadcn autocomplete will defer from other settings |
… lazy-load Lucide
stvncode
left a comment
There was a problem hiding this comment.
Regarding the dynamic import, the goal is not really met. So the clean move is to import it synchronously, which both removes the hazard and simplifies the code. I'll try to improve it later
|
I hope I've implemented this correctly. One more question/thought: Would it make sense to create a separate icon repository later? |
Summary
Replaces the MDI-only icon picker with a searchable Lucide icon picker. Adds custom MA device icons and a unified
PlayerIconcomponent used consistently throughout the UI.Icon picker
mdi-*values continue to work (backward compat viaPlayerIcon)Custom MA device icons
Four new device-specific icons ship in
src/components/ma-icons/:homepod-minisonosmacapple-tvCustom icons implement the same
sizeprop interface as Lucide icons and usecurrentColor— they work identically everywhere a Lucide icon is used.Adding a new icon in future: create
src/components/ma-icons/<name>.ts, add it toindex.tsregistry. One file, ~10 lines.PlayerIcon component
New
PlayerIcon.vuereplaces all direct<v-icon :icon="player.icon">usages:mdi-*) via<v-icon>for backward compat<component :is>Speakericon when no icon is set