Enable chat for artists

This commit is contained in:
Claudio Ortolina
2026-02-22 15:31:09 +00:00
parent b9ee7a6ce9
commit 60d81e14de
10 changed files with 156 additions and 51 deletions
@@ -21,6 +21,18 @@
data-slot="icon"
/>
</.button>
<.button
variant="soft"
phx-click={MusicLibraryWeb.Components.Chat.open("artist-chat-sheet")}
>
<span class="sr-only">{gettext("Chat about artist")}</span>
<.icon
name="hero-chat-bubble-left-right"
class="h-5 w-5"
aria-hidden="true"
data-slot="icon"
/>
</.button>
<.dropdown id={"actions-#{@artist.musicbrainz_id}"} placement="bottom-end">
<:toggle>
<.button variant="soft">
@@ -332,6 +344,17 @@
musicbrainz_id={@artist.musicbrainz_id}
/>
<.live_component
id="artist-chat"
sheet_id="artist-chat-sheet"
module={MusicLibraryWeb.Components.Chat}
title={@artist.name}
chat_module={MusicLibrary.ArtistChat}
chat_context={{@artist, @artist_info}}
placeholder={gettext("Ask about this artist...")}
empty_prompt={gettext("Ask anything about this artist")}
/>
<.structured_modal
:if={@live_action == :edit}
id="artist-info-modal"
@@ -28,7 +28,7 @@
</.button>
<.button
variant="soft"
phx-click={MusicLibraryWeb.Components.RecordChat.open("record-chat-sheet")}
phx-click={MusicLibraryWeb.Components.Chat.open("record-chat-sheet")}
>
<span class="sr-only">{gettext("Chat about album")}</span>
<.icon
@@ -342,9 +342,12 @@
<.live_component
id="record-chat"
sheet_id="record-chat-sheet"
module={MusicLibraryWeb.Components.RecordChat}
record={@record}
embedding_text={@embedding_text}
module={MusicLibraryWeb.Components.Chat}
title={@record.title}
chat_module={MusicLibrary.RecordChat}
chat_context={{@record, @embedding_text}}
placeholder={gettext("Ask about this album...")}
empty_prompt={gettext("Ask anything about this album")}
/>
<.structured_modal
@@ -16,7 +16,7 @@
<.button_group>
<.button
variant="soft"
phx-click={MusicLibraryWeb.Components.RecordChat.open("record-chat-sheet")}
phx-click={MusicLibraryWeb.Components.Chat.open("record-chat-sheet")}
>
<span class="sr-only">{gettext("Chat about album")}</span>
<.icon
@@ -307,9 +307,12 @@
<.live_component
id="record-chat"
sheet_id="record-chat-sheet"
module={MusicLibraryWeb.Components.RecordChat}
record={@record}
embedding_text={@embedding_text}
module={MusicLibraryWeb.Components.Chat}
title={@record.title}
chat_module={MusicLibrary.RecordChat}
chat_context={{@record, @embedding_text}}
placeholder={gettext("Ask about this album...")}
empty_prompt={gettext("Ask anything about this album")}
/>
<.structured_modal