fix: more cleanup of liveview

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-26 06:34:07 +02:00
parent 9fd8cb9e1d
commit ad8d13cb69
4 changed files with 64 additions and 10 deletions

View File

@@ -112,19 +112,36 @@
<% else %>
<div class="tab-bar-tabs">
<%= for tab <- @workbench.tabs do %>
<button
<div
class={["tab", if(@workbench.active_tab == {tab.type, tab.id}, do: "active"), if(tab.is_transient, do: "transient")]}
data-tab-type={tab.type}
data-tab-id={tab.id}
type="button"
phx-click="select_tab"
phx-value-type={tab.type}
phx-value-id={tab.id}
>
<span class="tab-icon"><%= raw(ShellData.activity_icon(tab_icon_id(tab))) %></span>
<span class="tab-title"><%= tab_title(tab, @tab_meta) %></span>
<span class="tab-close" aria-hidden="true">×</span>
</button>
<button
class="tab-select"
type="button"
phx-click="select_tab"
phx-value-type={tab.type}
phx-value-id={tab.id}
>
<span class="tab-icon"><%= raw(ShellData.activity_icon(tab_icon_id(tab))) %></span>
<span class="tab-title"><%= tab_title(tab, @tab_meta) %></span>
</button>
<button
class="tab-close"
data-testid="tab-close"
data-tab-type={tab.type}
data-tab-id={tab.id}
type="button"
phx-click="close_tab"
phx-value-type={tab.type}
phx-value-id={tab.id}
aria-label={translated("Close tab")}
title={translated("Close tab")}
>
×
</button>
</div>
<% end %>
</div>
<% end %>