refactor(ui): extract shared IconButton from duplicated .icon-btn copies #15

Closed
fabi wants to merge 1 commits from refactor/shared-icon-button into main

1 Commits

Author SHA1 Message Date
MechaCat02
129cb0241d refactor(ui): extract shared IconButton from duplicated .icon-btn copies
All checks were successful
deploy / test-frontend (pull_request) Successful in 10m21s
deploy / test-backend (pull_request) Successful in 28m26s
deploy / build-and-push (pull_request) Has been skipped
deploy / deploy (pull_request) Has been skipped
Five files hand-rolled a near-identical 32px `.icon-btn` (same size, hover,
and primary/danger variants). Extract a single IconButton.svelte component
so the treatment lives in one place. Converts the four sites with the
standard 32px form: collections detail, manga edit, upload, and the
chapter-pages editor.

The component takes a `variant` (plain/primary/danger) and spreads any
button attributes (onclick, disabled, aria-label, title, data-testid)
straight through; `type="button"` defaults but a caller can override. The
rendered button keeps the same class, styles, and DOM position, so layout
and behaviour are unchanged — no version bump.

Three icon-button sites are intentionally left out:
- The header (+layout) and home search button are 36px / different radius —
  size outliers that need a size/radius prop before folding in.
- profile/history's copy is being removed in the shared-HistoryList change;
  touching it here would just conflict.

A component (not a global class) avoids colliding with those remaining
local `.icon-btn` definitions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 19:37:08 +02:00