Truncate long entries in tables to prevent height changes

This commit is contained in:
Rafael Epplée 2025-12-02 16:16:33 +01:00
parent 06ba50f05d
commit eedd24b93c
No known key found for this signature in database
GPG key ID: B4EFE6DC59FAE118

View file

@ -79,7 +79,7 @@ defmodule MvWeb.CoreComponents do
<p>{msg}</p> <p>{msg}</p>
</div> </div>
<div class="flex-1" /> <div class="flex-1" />
<button type="button" class="group self-start cursor-pointer" aria-label={gettext("close")}> <button type="button" class="self-start cursor-pointer group" aria-label={gettext("close")}>
<.icon name="hero-x-mark" class="size-5 opacity-40 group-hover:opacity-70" /> <.icon name="hero-x-mark" class="size-5 opacity-40 group-hover:opacity-70" />
</button> </button>
</div> </div>
@ -392,14 +392,14 @@ defmodule MvWeb.CoreComponents do
<td <td
:for={col <- @col} :for={col <- @col}
phx-click={@row_click && @row_click.(row)} phx-click={@row_click && @row_click.(row)}
class={@row_click && "hover:cursor-pointer"} class={["max-w-xs truncate", @row_click && "hover:cursor-pointer"]}
> >
{render_slot(col, @row_item.(row))} {render_slot(col, @row_item.(row))}
</td> </td>
<td <td
:for={dyn_col <- @dynamic_cols} :for={dyn_col <- @dynamic_cols}
phx-click={@row_click && @row_click.(row)} phx-click={@row_click && @row_click.(row)}
class={@row_click && "hover:cursor-pointer"} class={["max-w-xs truncate", @row_click && "hover:cursor-pointer"]}
> >
{if dyn_col[:render] do {if dyn_col[:render] do
rendered = dyn_col[:render].(@row_item.(row)) rendered = dyn_col[:render].(@row_item.(row))