Hide focus panel when no attendee content

This commit is contained in:
Alex Lion
2026-08-04 22:21:28 +07:00
parent b63c4c5214
commit 0234ee654e
12 changed files with 22 additions and 67 deletions

View File

@@ -132,6 +132,7 @@
</header>
<section
:if={focus_content?}
id="focus-slot"
phx-hook="AttendeeFocus"
data-focus-key={focus_key(@current_interaction, @state.position)}
@@ -139,9 +140,8 @@
data-interaction-mode={to_string(interaction_mode?)}
class={[
"relative z-10 min-h-0 overflow-hidden border-y border-white/10 bg-gray-950 transition-[height] duration-300",
focus_content? && interaction_mode? && "h-auto max-h-[40dvh]",
focus_content? && !interaction_mode? && "h-[40dvh] min-h-40 max-h-[26rem]",
!focus_content? && "h-12"
interaction_mode? && "h-auto max-h-[40dvh]",
!interaction_mode? && "h-[40dvh] min-h-40 max-h-[26rem]"
]}
>
<div
@@ -206,20 +206,13 @@
/>
</div>
<% _ -> %>
<%= if @current_slide_url do %>
<div id="focus-media" class="relative h-full w-full bg-black">
<img
src={@current_slide_url}
alt={gettext("Current presentation slide")}
class="h-full w-full object-contain"
/>
</div>
<% else %>
<div class="flex h-full items-center justify-between gap-3 px-4 text-sm text-gray-400">
<span>{gettext("Waiting for content")}</span>
<span class="h-2 w-2 animate-pulse rounded-full bg-primary-400"></span>
</div>
<% end %>
<div id="focus-media" class="relative h-full w-full bg-black">
<img
src={@current_slide_url}
alt={gettext("Current presentation slide")}
class="h-full w-full object-contain"
/>
</div>
<% end %>
<button

View File

@@ -3279,11 +3279,6 @@ msgstr "Spitznamen wählen"
msgid "Set your nickname to participate"
msgstr "Spitznamen wählen, um teilzunehmen"
#: lib/claper_web/live/event_live/show.html.heex:219
#, elixir-autogen, elixir-format
msgid "Waiting for content"
msgstr "Warten auf Inhalt"
#: lib/claper_web/live/event_live/show.html.heex:394
#, elixir-autogen, elixir-format
msgid "new messages"

View File

@@ -3281,11 +3281,6 @@ msgstr ""
msgid "Set your nickname to participate"
msgstr ""
#: lib/claper_web/live/event_live/show.html.heex:219
#, elixir-autogen, elixir-format
msgid "Waiting for content"
msgstr ""
#: lib/claper_web/live/event_live/show.html.heex:394
#, elixir-autogen, elixir-format
msgid "new messages"

View File

@@ -3279,11 +3279,6 @@ msgstr ""
msgid "Set your nickname to participate"
msgstr ""
#: lib/claper_web/live/event_live/show.html.heex:219
#, elixir-autogen, elixir-format
msgid "Waiting for content"
msgstr ""
#: lib/claper_web/live/event_live/show.html.heex:394
#, elixir-autogen, elixir-format, fuzzy
msgid "new messages"

View File

@@ -3279,11 +3279,6 @@ msgstr "Elige un apodo"
msgid "Set your nickname to participate"
msgstr "Elige un apodo para participar"
#: lib/claper_web/live/event_live/show.html.heex:219
#, elixir-autogen, elixir-format
msgid "Waiting for content"
msgstr "Esperando contenido"
#: lib/claper_web/live/event_live/show.html.heex:394
#, elixir-autogen, elixir-format
msgid "new messages"

View File

@@ -3283,11 +3283,6 @@ msgstr "Choisir un pseudo"
msgid "Set your nickname to participate"
msgstr "Choisir un pseudo pour participer"
#: lib/claper_web/live/event_live/show.html.heex:219
#, elixir-autogen, elixir-format
msgid "Waiting for content"
msgstr "En attente de contenu"
#: lib/claper_web/live/event_live/show.html.heex:394
#, elixir-autogen, elixir-format
msgid "new messages"

View File

@@ -3279,11 +3279,6 @@ msgstr "Becenév megadása"
msgid "Set your nickname to participate"
msgstr "Becenév megadása a részvételhez"
#: lib/claper_web/live/event_live/show.html.heex:219
#, elixir-autogen, elixir-format
msgid "Waiting for content"
msgstr "Várakozás a tartalomra"
#: lib/claper_web/live/event_live/show.html.heex:394
#, elixir-autogen, elixir-format
msgid "new messages"

View File

@@ -3280,11 +3280,6 @@ msgstr "Scegli un nickname"
msgid "Set your nickname to participate"
msgstr "Scegli un nickname per partecipare"
#: lib/claper_web/live/event_live/show.html.heex:219
#, elixir-autogen, elixir-format
msgid "Waiting for content"
msgstr "In attesa di contenuti"
#: lib/claper_web/live/event_live/show.html.heex:394
#, elixir-autogen, elixir-format
msgid "new messages"

View File

@@ -3283,11 +3283,6 @@ msgstr "Izvēlieties segvārdu"
msgid "Set your nickname to participate"
msgstr "Izvēlieties segvārdu, lai piedalītos"
#: lib/claper_web/live/event_live/show.html.heex:219
#, elixir-autogen, elixir-format
msgid "Waiting for content"
msgstr "Gaida saturu"
#: lib/claper_web/live/event_live/show.html.heex:394
#, elixir-autogen, elixir-format
msgid "new messages"

View File

@@ -3281,11 +3281,6 @@ msgstr "Kies een bijnaam"
msgid "Set your nickname to participate"
msgstr "Kies een bijnaam om deel te nemen"
#: lib/claper_web/live/event_live/show.html.heex:219
#, elixir-autogen, elixir-format
msgid "Waiting for content"
msgstr "Wachten op inhoud"
#: lib/claper_web/live/event_live/show.html.heex:394
#, elixir-autogen, elixir-format
msgid "new messages"

View File

@@ -3315,11 +3315,6 @@ msgstr "Välj smeknamn"
msgid "Set your nickname to participate"
msgstr "Välj smeknamn för att delta"
#: lib/claper_web/live/event_live/show.html.heex:219
#, elixir-autogen, elixir-format
msgid "Waiting for content"
msgstr "Väntar på innehåll"
#: lib/claper_web/live/event_live/show.html.heex:394
#, elixir-autogen, elixir-format
msgid "new messages"

View File

@@ -62,6 +62,18 @@ defmodule ClaperWeb.EventLive.ShowTest do
assert render(view) =~ "data-message-reaction-trigger"
end
test "does not render the focus panel without attendee content", %{conn: conn, user: user} do
presentation_file = presentation_file_fixture(%{user: user, length: 0}, [:event])
presentation_state_fixture(%{presentation_file: presentation_file})
{:ok, _view, html} = live(conn, ~p"/e/#{presentation_file.event.code}")
document = Floki.parse_document!(html)
assert Floki.find(document, "#focus-slot") == []
refute html =~ "Waiting for content"
end
test "renders attendee captions as a collapsible panel that cannot be disabled", %{
conn: conn,
user: user