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 <select> (Group by, Format, In deck): only color/border were
  overridden, leaving native OS chrome (height, arrow, popup) in place.
  Drop appearance and draw a custom chevron so they match text inputs.
- Click-to-preview: show both faces of a double-faced card side by side
  on wide viewports instead of requiring Flip, and size the preview
  images larger overall.
- Sidebar footer: replace the plain "N cards" line with a "Your library"
  panel (unique/copies/decks tiles + a WUBRG color-distribution bar),
  polling get_library_stats while card data is loaded.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-07 21:21:47 -05:00
parent 3e41c9d055
commit e57c3dec51
7 changed files with 760 additions and 94 deletions

View File

@@ -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 <select> chrome (height, arrow, popup panel) ignores color/border
overrides unless its OS-drawn appearance is dropped first. */
select {
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
padding-right: 30px;
cursor: pointer;
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9ea8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
background-repeat: no-repeat;
background-position: right 9px center;
background-size: 14px;
}
select:hover {
border-color: var(--bg-elev);
}
/* The dropdown's own option list stays OS-native (no cross-browser hook to
restyle it), but at least match its swatch to the app's dark theme. */
select option {
background: var(--bg-panel);
color: var(--text);
}
/* ============================================================
App shell: nav rail + main
============================================================ */
@@ -248,18 +291,32 @@ select:focus {
}
.nav-foot {
margin-top: auto;
padding: 14px 10px 10px;
border-top: 1px solid var(--border-soft);
position: relative;
}
.nav-foot::before {
/* A faint accent hairline atop the divider, echoing the active-tab bar. */
content: "";
position: absolute;
top: -1px;
left: 10px;
right: 10px;
height: 1px;
background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
}
.nav-foot-simple {
display: flex;
align-items: center;
gap: 8px;
padding: 12px 10px 6px;
font-size: 12px;
color: var(--muted);
border-top: 1px solid var(--border-soft);
}
.status-dot {
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
}
.status-dot.on {
background: var(--success);
@@ -269,6 +326,84 @@ select:focus {
background: var(--faint);
}
/* Sidebar "your library" summary panel. */
.lib-stats-head {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 10px;
}
.lib-stats-title {
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.07em;
color: var(--faint);
}
.lib-stats-loading {
font-size: 11px;
color: var(--faint);
padding-bottom: 10px;
}
.lib-stats-numbers {
display: flex;
gap: 6px;
margin-bottom: 10px;
}
.lib-stat {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
padding: 8px 2px;
background: var(--bg-panel);
border: 1px solid var(--border-soft);
border-radius: var(--radius);
transition: border-color 0.15s, transform 0.15s;
}
.lib-stat:hover {
border-color: var(--accent-glow);
transform: translateY(-1px);
}
.lib-stat-value {
font-size: 16px;
font-weight: 800;
color: var(--text-strong);
font-variant-numeric: tabular-nums;
text-shadow: 0 0 14px var(--accent-glow);
}
.lib-stat-label {
font-size: 9px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--faint);
}
.lib-color-bar {
display: flex;
height: 8px;
border-radius: 999px;
overflow: hidden;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
margin-bottom: 9px;
}
.lib-color-seg {
min-width: 3px;
transition: flex-grow 0.4s ease;
}
.lib-color-seg.W { background: var(--mtg-w); }
.lib-color-seg.U { background: var(--mtg-u); }
.lib-color-seg.B { background: var(--mtg-b); }
.lib-color-seg.R { background: var(--mtg-r); }
.lib-color-seg.G { background: var(--mtg-g); }
.lib-color-seg.C { background: var(--mtg-c); }
.lib-stats-sub {
font-size: 10px;
color: var(--faint);
}
.main {
flex: 1;
min-width: 0;
@@ -334,19 +469,6 @@ select:focus {
color: var(--danger);
border-color: var(--danger);
}
.ingest-bar-dismiss {
flex-shrink: 0;
background: none;
border: none;
color: var(--faint);
cursor: pointer;
padding: 2px 6px;
font-size: 13px;
}
.ingest-bar-dismiss:hover {
color: var(--text);
}
.ingest-segments {
display: flex;
gap: 4px;
@@ -580,6 +702,130 @@ h4 {
background: rgba(0, 0, 0, 0.12);
}
/* ============================================================
Icon buttons: rename, duplicate, delete, dismiss, close — one
consistent look used everywhere a bare icon-only action appears.
============================================================ */
.icon-btn {
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 28px;
height: 28px;
padding: 0;
border-radius: 999px;
background: var(--bg-input);
border: 1px solid var(--border);
color: var(--muted);
}
.icon-btn:hover:not(:disabled) {
background: var(--bg-hover);
color: var(--text);
border-color: var(--bg-elev);
}
.icon-btn:active:not(:disabled) {
transform: translateY(1px);
}
.icon-btn:disabled {
opacity: 0.35;
}
.icon-btn.icon-btn-danger:hover:not(:disabled) {
background: rgba(216, 80, 63, 0.15);
color: var(--danger);
border-color: var(--danger);
}
/* Overlay variant: dark translucent, for sitting on top of card art. */
.icon-btn-overlay {
width: 26px;
height: 26px;
background: rgba(0, 0, 0, 0.78);
border: none;
color: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(2px);
}
.icon-btn-overlay:hover:not(:disabled) {
background: rgba(255, 255, 255, 0.18);
color: #fff;
}
.icon-btn-overlay.icon-btn-danger:hover:not(:disabled) {
background: var(--danger);
color: #fff;
}
/* Row-level action icons (e.g. rename/duplicate/delete a deck): hidden until
* the row is hovered/focused, so the collapsed list stays uncluttered. */
.row-actions {
display: flex;
gap: 4px;
flex-shrink: 0;
opacity: 0;
transition: opacity 0.12s;
}
li:hover .row-actions,
li:focus-within .row-actions {
opacity: 1;
}
/* ============================================================
Dialogs: confirm (delete) / prompt (rename, duplicate-as)
============================================================ */
.dialog-backdrop {
position: fixed;
inset: 0;
z-index: 400;
display: flex;
align-items: center;
justify-content: center;
background: rgba(10, 10, 12, 0.72);
backdrop-filter: blur(2px);
animation: preview-fade-in 0.12s ease;
}
.dialog {
width: min(380px, 90vw);
background: var(--bg-panel);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 20px;
box-shadow: var(--shadow-lg);
}
.dialog-title {
margin: 0 0 10px;
font-size: 15px;
font-weight: 600;
text-transform: none;
letter-spacing: normal;
color: var(--text-strong);
border-bottom: none;
padding-bottom: 0;
}
.dialog-message {
margin: 0 0 18px;
color: var(--muted);
font-size: 13px;
line-height: 1.5;
}
.dialog-field {
display: flex;
flex-direction: column;
gap: 6px;
margin-bottom: 14px;
}
.dialog-field input {
width: 100%;
}
.dialog-error {
margin: -6px 0 14px;
color: var(--danger);
font-size: 12px;
}
.dialog-actions {
display: flex;
justify-content: flex-end;
gap: 8px;
}
/* ============================================================
Lists (search results, deck list)
============================================================ */
@@ -636,12 +882,12 @@ h4 {
justify-content: center;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.pip.W { background: #f4efdd; color: #4a3f2a; }
.pip.U { background: #3a8fd0; color: #fff; }
.pip.B { background: #38343d; color: #cbc3d4; }
.pip.R { background: var(--accent); color: #fff; }
.pip.G { background: #479b63; color: #fff; }
.pip.C { background: #9aa0ab; color: #23242a; }
.pip.W { background: var(--mtg-w); color: #4a3f2a; }
.pip.U { background: var(--mtg-u); color: #fff; }
.pip.B { background: var(--mtg-b); color: #cbc3d4; }
.pip.R { background: var(--mtg-r); color: #fff; }
.pip.G { background: var(--mtg-g); color: #fff; }
.pip.C { background: var(--mtg-c); color: #23242a; }
.color-toggles {
display: flex;
@@ -801,34 +1047,45 @@ tbody tr:hover {
position: relative;
cursor: default;
}
.preview-modal-faces {
position: relative;
}
.preview-modal-img {
display: block;
max-width: min(560px, 84vw);
max-height: 84vh;
display: none;
max-width: min(720px, 90vw);
max-height: 90vh;
border-radius: 18px;
box-shadow: var(--shadow-lg);
border: 1px solid rgba(255, 255, 255, 0.08);
}
.preview-modal-img.active {
display: block;
}
/* Wide enough to show a double-faced card's front and back side by side —
no flip needed. */
@media (min-width: 860px) {
.preview-modal-dfc .preview-modal-faces {
display: flex;
gap: 20px;
}
.preview-modal-dfc .preview-modal-img {
display: block;
max-width: min(430px, 43vw);
}
.preview-modal-dfc .preview-modal-flip {
display: none;
}
}
.preview-modal-close {
position: absolute;
top: -14px;
right: -14px;
width: 32px;
height: 32px;
padding: 0;
border-radius: 999px;
background: var(--bg-elev);
color: var(--text);
border: 1px solid var(--border);
font-size: 14px;
display: flex;
align-items: center;
justify-content: center;
}
.preview-modal-close .icon-btn {
box-shadow: var(--shadow-md);
}
.preview-modal-close:hover {
.preview-modal-close .icon-btn:hover {
background: var(--danger);
border-color: var(--danger);
color: #fff;
}
.preview-modal-flip {
@@ -908,20 +1165,6 @@ tbody tr:hover {
background: var(--warn);
color: #241700;
}
.tile-remove {
background: rgba(0, 0, 0, 0.78);
border: none;
color: #fff;
border-radius: 50%;
width: 24px;
height: 24px;
padding: 0;
line-height: 1;
font-size: 13px;
}
.tile-remove:hover {
background: var(--danger);
}
.tile-footer {
display: flex;
flex-wrap: wrap;