feat: loading toasts for all photo actions

Add loading→success/error toast transition to every bulk operation
(archive, restore, delete, approve, add-to-heap, metadata patch).
Also wires gridKeyNav + CauseGroupCard into the bulkAction store so
keyboard-triggered actions show the same per-tile pending/done/error
feedback as BulkActionBar buttons.
This commit is contained in:
2026-06-07 21:40:18 +02:00
parent da63ad769a
commit 5da1022ed1
7 changed files with 88 additions and 80 deletions

View File

@@ -714,6 +714,7 @@
return;
}
emptyingArchive = true;
const tid = toast.loading("Emptying archive…");
let total = 0;
try {
while (true) {
@@ -729,9 +730,9 @@
await batchDelete(uids);
total += uids.length;
}
toast.success(total === 0 ? "Archive already empty" : `Deleted ${total}`);
toast.success(total === 0 ? "Archive already empty" : `Deleted ${total}`, { id: tid });
} catch (err) {
toast.error(err instanceof Error ? err.message : "Empty archive failed");
toast.error(err instanceof Error ? err.message : "Empty archive failed", { id: tid });
} finally {
emptyingArchive = false;
void qc.invalidateQueries({ queryKey: ["photos"] });