fix: A2UI now behaves better
This commit is contained in:
@@ -352,7 +352,7 @@ defmodule BDS.Desktop.ShellLive.ChatEditor do
|
||||
@spec chat_surface(term()) :: term()
|
||||
def chat_surface(assigns) do
|
||||
~H"""
|
||||
<details id={@surface.id} class={["chat-inline-surface", "chat-inline-surface-#{@surface.type}"]} data-testid="chat-inline-surface" data-expanded={Map.get(@surface, :expanded?, false)} open={Map.get(@surface, :expanded?, false)}>
|
||||
<details id={@surface.id} class={["chat-inline-surface", "chat-inline-surface-#{@surface.type}"]} data-testid="chat-inline-surface" data-expanded={surface_expanded_attr(@surface)} open={Map.get(@surface, :expanded?, false)}>
|
||||
<summary class="chat-inline-surface-header">
|
||||
<span class="chat-inline-surface-icon"><%= surface_icon(@surface.type) %></span>
|
||||
<span class="chat-inline-surface-title"><%= surface_title(@surface) %></span>
|
||||
@@ -566,6 +566,10 @@ defmodule BDS.Desktop.ShellLive.ChatEditor do
|
||||
defp surface_icon("tabs"), do: "▧"
|
||||
defp surface_icon(_type), do: "■"
|
||||
|
||||
defp surface_expanded_attr(surface) do
|
||||
if Map.get(surface, :expanded?, false), do: "true", else: "false"
|
||||
end
|
||||
|
||||
defp surface_title(surface) do
|
||||
cond do
|
||||
present?(Map.get(surface, :title)) -> Map.get(surface, :title)
|
||||
|
||||
Reference in New Issue
Block a user