refactor: fix review comments
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simon 2026-05-08 12:45:57 +02:00
parent 93e1ec7414
commit b1740e3435
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
10 changed files with 63 additions and 199 deletions

View file

@ -1022,7 +1022,6 @@ defmodule MvWeb.CoreComponents do
id={@row_id && @row_id.(row)}
class={[
table_row_tr_class(
@row_click,
table_row_selected?(assigns, row),
@sticky_first_col
)
@ -1142,17 +1141,8 @@ defmodule MvWeb.CoreComponents do
# Returns CSS classes for table row selection styles.
# Hover/focus row highlighting is CSS-driven via [data-row-interactive] selectors in app.css.
# Sticky-first-column zebra tables use CSS accents and omit selected row ring classes.
defp table_row_tr_class(_row_click, selected?, sticky_first_col) do
base = []
# Sticky-first-col tables: selection/hover accents are CSS-only (orange bar + fills).
base =
if selected? and not sticky_first_col,
do: base ++ ["ring-2", "ring-inset", "ring-primary"],
else: base
Enum.join(base, " ")
end
defp table_row_tr_class(true, false), do: "ring-2 ring-inset ring-primary"
defp table_row_tr_class(_, _), do: ""
defp table_th_aria_sort(col, sort_field, sort_order) do
col_sort = Map.get(col, :sort_field)