8000 refactor(ui): extend <.button> with danger/ghost variants and migrate primary action sites by mwoods79 · Pull Request #155 · huddlz-hq/huddlz · GitHub
[go: up one dir, main page]

Skip to content

refactor(ui): extend <.button> with danger/ghost variants and migrate primary action sites - #155

Merged
mwoods79 merged 1 commit into
mainfrom
refactor/migrate-raw-buttons
May 2, 2026
Merged

mwoods79 merged 1 commit into
mainfrom
refactor/migrate-raw-buttons

Conversation

@mwoods79
@mwoods79 mwoods79 commented May 1, 2026
Copy link
Copy Markdown
Contributor

Summary

Extends `<.button>` and migrates the most prominent raw `` tags. Closes the highest-leverage portion of #150 and splits the rest off into #154.

`<.button>` additions

  • `:class` attr — callsites can append classes (e.g., `class="h-12 px-6"` for a button matching an adjacent search input height).
  • `variant="danger"` — filled red, for destructive primary actions like "Delete Huddl".
  • `variant="ghost"` — text-link style (no border, no uppercase, no font-display, hover underline) for inline actions like "Clear all" or "Generate Random Name".
  • `size="sm"` / `size="md"` — compact vs default; ghost ignores horizontal padding so it stays inline-flush.

Migrated callsites (7)

  • `admin_live.ex` — Search, Clear, Update (3 buttons)
  • `huddl_live.ex` — Search, Clear all (2 buttons)
  • `huddl_live/show.ex` — Delete Huddl (1 button)
  • `auth_live/register.ex` — Generate Random Name (1 button)

Out of scope (intentional)

  • Tab-style buttons in `group_live/show.ex:150,163` — different pattern (border-b active indicator), not a button.
  • Icon-only cancel/edit buttons across upload widgets (~13 sites) — split into Component standardization: extract <.icon_button> for repeated cancel/edit icons #154 as `<.icon_button>` extraction.
  • Full-width menu/list-row items in `location_autocomplete.ex`, `saved_location_picker.ex`, `profile_live.ex` avatar menu — different pattern (selectable rows), would become `<.menu_item>` if extracted.
  • Cancel RSVP in `huddl_live/show.ex:85` and Save/Cancel in `group_live/locations.ex:114,120` — one-off subtle styles that don't match any current variant; left raw rather than introducing single-use variants.

Refs #150 (kept open for further migration as patterns extract).

Test plan

  • `/admin` — search, clear, role update buttons render and trigger correctly
  • `/huddlz` — search button matches input height; "Clear all" filter pill renders inline
  • `/groups//huddlz/` as huddl owner — "Delete Huddl" button is filled red
  • `/register` — "Generate Random Name" link-style button still triggers the action
  • All variants render with sharp corners, no daisyUI fallbacks

… primary action sites

Extend <.button> so it can replace the most prominent raw <button>
tags without needing inline class strings:
- Add a :class attr that callsites can append to the variant defaults.
- Add variant="danger" for filled destructive actions (red bg).
- Add variant="ghost" for inline text-link style buttons (no border,
  hover underline, no uppercase font-display).
- Add a :size attr ("sm" or "md") for compact buttons in tables and
  inline groups.

Migrate seven raw <button> tags that fit the extended component:
- admin_live.ex Search / Clear / Update (3 buttons)
- huddl_live.ex Search / Clear all (2 buttons)
- huddl_live/show.ex Delete Huddl (1 button)
- auth_live/register.ex Generate Random Name (1 button)

The remaining raw <button> tags fall into three categories that are
not a fit for <.button>:
- Tab-style buttons in group_live/show.ex (border-b active indicator).
- Icon-only cancel/edit buttons across upload widgets (tracked in #154).
- Full-width menu/list-row items in pickers and dropdowns.

Refs #150
@mwoods79
mwoods79 force-pushed the refactor/migrate-raw-buttons branch from 923f610 to cd9c2b0 Compare May 2, 2026 02:39
@mwoods79
mwoods79 merged commit 9373e02 into main May 2, 2026
1 check passed
@mwoods79
mwoods79 deleted the refactor/migrate-raw-buttons branch May 2, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? S 5E8C ign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0