From e57c3dec517c10f434d71473040f8f34914002d4 Mon Sep 17 00:00:00 2001 From: garrettmills Date: Tue, 7 Jul 2026 21:21:47 -0500 Subject: [PATCH] Deck actions UI, consistent icon buttons, native select fix, sidebar stats - DeckView: rename/duplicate/delete deck via row-hover icon actions, with a ConfirmDialog for delete and PromptDialog (with friendly name- collision errors) for rename/duplicate. - Add a shared IconButton (plus overlay/danger variants) and replace every ad hoc close/remove button in the app with it: deck actions, remove-card-from-deck (list and tile), clear-commander, the card- preview close, and the ingest-progress dismiss. - Fix native setValue(e.target.value)} + onKeyDown={(e) => e.key === "Enter" && confirm()} + /> + + {error &&

{error}

} +
+ + +
+ + ); +} + /** * Inline editor for a card's free-text storage location (e.g. "Box 1"). * Saves on blur; used for owned cards that aren't in any deck. @@ -332,15 +526,34 @@ function ClickPreviewModal({ onFlip: () => void; }) { const { card, showBack } = state; - const src = showBack && card.back_image_uri ? card.back_image_uri : card.image_uri; + const hasBack = !!card.back_image_uri; + // Both faces are always in the DOM when the card has one; a wide-viewport + // media query shows them side by side (no flip needed), while a narrow one + // shows only the "active" face and the flip button toggles between them. return (
-
e.stopPropagation()}> - {card.name} - - {card.back_image_uri && ( +
e.stopPropagation()} + > +
+ {card.name} + {hasBack && ( + {`${card.name} + )} +
+ + + + {hasBack && ( diff --git a/src/styles.css b/src/styles.css index d44571c..ac506f8 100644 --- a/src/styles.css +++ b/src/styles.css @@ -36,6 +36,14 @@ --warn: #e0a34a; --danger: #d8503f; + /* WUBRG mana colors, shared by pips + the library color-distribution bar */ + --mtg-w: #f4efdd; + --mtg-u: #3a8fd0; + --mtg-b: #38343d; + --mtg-r: var(--accent); + --mtg-g: #479b63; + --mtg-c: #9aa0ab; + --radius: 8px; --radius-lg: 12px; --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3); @@ -133,6 +141,18 @@ button.primary:hover { button.primary:active { background: var(--accent-active); } +button.danger { + background: var(--danger); + border: none; + color: #fff; + box-shadow: var(--shadow-sm); +} +button.danger:hover { + filter: brightness(1.1); +} +button.danger:active { + filter: brightness(0.92); +} button.big { padding: 11px 22px; font-size: 15px; @@ -160,6 +180,29 @@ select:focus { box-shadow: 0 0 0 3px var(--accent-subtle); } +/* Native