Add multi-select and bulk actions to the Library tab

- Checkboxes on every row/tile plus a "Select all" (filtered-set-aware,
  indeterminate-aware) toggle in the toolbar.
- A bulk-action bar appears once anything's selected: add to a deck
  ("Add 1" sets each selected card to 1 copy, "Add All" sets it to
  however many you own — the latter is the one-click fix for bulk-adding
  a stack of basic lands), set location, and adjust owned quantity by a
  configurable delta. All reuse the same per-card commands the
  single-card UI already calls, so behavior stays consistent (including
  the existing grace-period undo on quantity_owned hitting 0).
- CardTile gains a `cornerLeft` slot and `selected` prop (ring highlight,
  keeps the checkbox visible without hovering) to support this in tile
  view without disturbing the existing top-right qty-stepper corner.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-08 08:20:09 -05:00
parent d8a9787ecd
commit 2581b1fb24
3 changed files with 271 additions and 4 deletions

View File

@@ -203,6 +203,13 @@ select option {
color: var(--text);
}
input[type="checkbox"] {
width: 15px;
height: 15px;
accent-color: var(--accent);
cursor: pointer;
}
/* ============================================================
App shell: nav rail + main
============================================================ */
@@ -950,6 +957,39 @@ tbody tr:hover {
margin-right: 4px;
}
/* ============================================================
Bulk-selection action bar (Library tab)
============================================================ */
.bulk-bar {
display: flex;
align-items: center;
gap: 16px;
flex-wrap: wrap;
background: var(--accent-subtle);
border: 1px solid var(--accent-glow);
border-radius: var(--radius-lg);
padding: 10px 16px;
margin-bottom: 16px;
}
.bulk-bar-count {
font-weight: 700;
font-size: 13px;
color: var(--accent-hover);
white-space: nowrap;
}
.bulk-bar-actions {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
}
.bulk-bar-delta {
width: 48px;
text-align: center;
padding: 8px 4px;
}
/* ============================================================
Filters panel
============================================================ */
@@ -1158,6 +1198,34 @@ tbody tr:hover {
.tile:focus-within .tile-corner {
opacity: 1;
}
.tile-corner-left {
position: absolute;
top: 8px;
left: 8px;
/* Same reasoning as .tile-corner: don't cover the card name unless the
tile is being interacted with — except once selected, where the
checkbox should stay visible so the selection is visible at a glance. */
opacity: 0;
transition: opacity 0.12s;
}
.tile:hover .tile-corner-left,
.tile:focus-within .tile-corner-left,
.tile-selected .tile-corner-left {
opacity: 1;
}
.tile-selected .tile-img {
box-shadow: 0 0 0 3px var(--accent), var(--shadow-md);
}
.tile-select {
display: flex;
align-items: center;
justify-content: center;
width: 26px;
height: 26px;
border-radius: 999px;
background: rgba(0, 0, 0, 0.78);
backdrop-filter: blur(2px);
}
.tile-badge {
background: rgba(0, 0, 0, 0.78);
color: #fff;