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:
@@ -744,15 +744,21 @@ export function ViewToggle({
|
||||
export function CardTile({
|
||||
card,
|
||||
corner,
|
||||
cornerLeft,
|
||||
footer,
|
||||
selected,
|
||||
}: {
|
||||
card: CardRef;
|
||||
corner?: ReactNode;
|
||||
/** Rendered top-left, e.g. a selection checkbox (see `selected`). */
|
||||
cornerLeft?: ReactNode;
|
||||
footer?: ReactNode;
|
||||
/** Highlights the tile and keeps `cornerLeft` visible without hovering. */
|
||||
selected?: boolean;
|
||||
}) {
|
||||
const { open } = useClickPreview();
|
||||
return (
|
||||
<div className="tile">
|
||||
<div className={`tile ${selected ? "tile-selected" : ""}`}>
|
||||
<div className="tile-img-wrap">
|
||||
{card.image_uri ? (
|
||||
<img
|
||||
@@ -765,6 +771,7 @@ export function CardTile({
|
||||
) : (
|
||||
<div className="tile-noimg">{card.name}</div>
|
||||
)}
|
||||
{cornerLeft && <div className="tile-corner-left">{cornerLeft}</div>}
|
||||
{corner && <div className="tile-corner">{corner}</div>}
|
||||
</div>
|
||||
{footer && <div className="tile-footer">{footer}</div>}
|
||||
|
||||
Reference in New Issue
Block a user