From 30d2b0533684ed4dbb58e84cc5d9f4612ac84c2e Mon Sep 17 00:00:00 2001 From: Alex Lion Date: Wed, 29 Apr 2026 18:37:14 +0200 Subject: [PATCH] feat: enhance transcription features with global indicators and improved UI elements --- .../live/event_live/manage.html.heex | 37 +++++++++- .../manage_interaction_list_component.ex | 67 ++++++++++++++----- lib/claper_web/live/event_live/show.html.heex | 26 +++---- .../form_component.html.heex | 5 +- 4 files changed, 100 insertions(+), 35 deletions(-) diff --git a/lib/claper_web/live/event_live/manage.html.heex b/lib/claper_web/live/event_live/manage.html.heex index 213c863..d80bffb 100644 --- a/lib/claper_web/live/event_live/manage.html.heex +++ b/lib/claper_web/live/event_live/manage.html.heex @@ -179,6 +179,7 @@
  • -

    {gettext("Transcription")}

    +
    +

    {gettext("Transcription")}

    + + {gettext("Global")} + +

    {gettext("Add real-time subtitles from your microphone.")}

    +
    +
    + + + +
    +
    +
    +

    {gettext("Transcription")}

    + + {gettext("Global")} + +
    +

    + {gettext("Already added to this presentation.")} +

    +
    +
  • <% end %> diff --git a/lib/claper_web/live/event_live/manage_interaction_list_component.ex b/lib/claper_web/live/event_live/manage_interaction_list_component.ex index 124963e..2df6bd3 100644 --- a/lib/claper_web/live/event_live/manage_interaction_list_component.ex +++ b/lib/claper_web/live/event_live/manage_interaction_list_component.ex @@ -230,12 +230,14 @@ defmodule ClaperWeb.EventLive.ManageInteractionListComponent do <.popup_item :if={@transcription_globally_enabled} patch={transcription_patch(@event_code, @transcription_config)} - title={ + disabled={transcription_persisted?(@transcription_config)} + badge={gettext("Global")} + title={gettext("Transcription")} + description={ if transcription_persisted?(@transcription_config), - do: gettext("Edit transcription"), - else: gettext("Add transcription") + do: gettext("Already added to this presentation."), + else: gettext("Live transcribe presenter audio for your audience.") } - description={gettext("Live transcribe presenter audio for your audience.")} >
    -

    - {gettext("Transcription")} -

    +
    +

    + {gettext("Transcription")} +

    + {gettext("Global")} +

    {transcription_subtitle(@transcription_config)}

    @@ -574,19 +579,45 @@ defmodule ClaperWeb.EventLive.ManageInteractionListComponent do end defp popup_item(assigns) do + assigns = + assigns + |> assign_new(:disabled, fn -> false end) + |> assign_new(:badge, fn -> nil end) + ~H""" - <.link - patch={@patch} - class="flex items-center gap-3 p-2 rounded-xl transition-colors hover:bg-primary-50" - > -
    - {render_slot(@inner_block)} + <%= if @disabled do %> +
    +
    + {render_slot(@inner_block)} +
    +
    +
    +

    {@title}

    + {@badge} +
    +

    {@description}

    +
    -
    -

    {@title}

    -

    {@description}

    -
    - + <% else %> + <.link + patch={@patch} + class="flex items-center gap-3 p-2 rounded-xl transition-colors hover:bg-primary-50" + > +
    + {render_slot(@inner_block)} +
    +
    +
    +

    {@title}

    + {@badge} +
    +

    {@description}

    +
    + + <% end %> """ end end diff --git a/lib/claper_web/live/event_live/show.html.heex b/lib/claper_web/live/event_live/show.html.heex index 26549dc..12f115f 100644 --- a/lib/claper_web/live/event_live/show.html.heex +++ b/lib/claper_web/live/event_live/show.html.heex @@ -256,7 +256,19 @@
    -
    if @state.message_reaction_enabled, do: "bottom-12", else: "bottom-3"}> +
    if @state.message_reaction_enabled, do: "bottom-12", else: "bottom-3"}> +
    +
    +

    {@transcription_text}

    +
    +
    + <%= if @state.chat_enabled do %> <%= if !@state.anonymous_chat_enabled && (@nickname && @nickname == "") do %> <.form @@ -414,18 +426,6 @@
    - -
    -
    -

    {@transcription_text}

    -
    -
    <% else %>
    diff --git a/lib/claper_web/live/transcription_live/form_component.html.heex b/lib/claper_web/live/transcription_live/form_component.html.heex index 3f5d501..db7135c 100644 --- a/lib/claper_web/live/transcription_live/form_component.html.heex +++ b/lib/claper_web/live/transcription_live/form_component.html.heex @@ -52,7 +52,7 @@