feat(web): add chevron affordance and scope-badge slot to dropdown triggers

Dropdown openers were visually indistinguishable from ordinary buttons. A
trailing chevron now marks every dropdown trigger — both the shared
dropdown_menu component and the bespoke member-filter trigger — and an
optional badge slot lets a trigger show a status indicator beside its label.
This commit is contained in:
Simon 2026-06-04 16:40:05 +02:00
parent d51dcb1ac3
commit 8e5dd7e4c6
5 changed files with 45 additions and 4 deletions

View file

@ -464,6 +464,9 @@ defmodule MvWeb.CoreComponents do
slot :inner_block, doc: "Custom content for the dropdown menu (e.g., forms)"
slot :trigger_badge,
doc: "Optional badge rendered in the trigger after the label (e.g. a scope badge)"
def dropdown_menu(assigns) do
menu_testid = assigns.menu_testid || "#{assigns.testid}-menu"
@ -498,6 +501,8 @@ defmodule MvWeb.CoreComponents do
<.icon name={@icon} />
<% end %>
<span>{@button_label}</span>
{render_slot(@trigger_badge)}
<.icon name="hero-chevron-down" class="size-4" />
</button>
<ul