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:
@@ -57,10 +57,11 @@ export async function patchTargets(
|
||||
)
|
||||
: null;
|
||||
|
||||
const tid = toast.loading(`${label} · ${ids.length}…`);
|
||||
|
||||
const { updated, errors } = await batchEdit(ids, async (id) => {
|
||||
const p = await freshPhoto(id);
|
||||
const body = typeof patch === 'function' ? patch(p) : patch;
|
||||
// An empty body is a no-op signal — e.g. "keyword already present".
|
||||
if (Object.keys(body).length === 0) return p;
|
||||
return updatePhoto(p, body);
|
||||
});
|
||||
@@ -68,9 +69,9 @@ export async function patchTargets(
|
||||
invalidatePhotos(ids);
|
||||
|
||||
if (errors.length) {
|
||||
toast.error(`${label} · ${updated.length} ok, ${errors.length} failed`);
|
||||
toast.error(`${label} · ${updated.length} ok, ${errors.length} failed`, { id: tid });
|
||||
} else {
|
||||
toast.success(`${label} · ${ids.length}`);
|
||||
toast.success(`${label} · ${ids.length}`, { id: tid });
|
||||
}
|
||||
|
||||
if (inverses) {
|
||||
|
||||
Reference in New Issue
Block a user