fix: bulk label apply, instant archive removal, per-photo state, drop sidebar counts
Issue 1 — colors/labels not applying in bulk: - sidecar validColors only accepted 4 of the 8 UI swatches, so teal/blue/ purple/pink returned "invalid color" and rolled back the whole bulk txn. Add teal, blue, purple, pink to validColors. - Add invalidateFacets() and call it on the success path of bulk marks, patchTargets, and single-photo edits so the Colors/Ratings/Notes facet sections refresh immediately instead of waiting out staleTime. Issue 2 — archived photos linger in the grid: - Add a UI-only removedIds set to the bulkAction store; archive/delete/ restore/keep call markRemoved() on success so tiles vanish instantly, cleared once the server-reconcile refetch lands (no cache eviction). Issue 3 — per-photo progress state: - Wire startBulk/doneBulk/failBulk into all metadata applies, bulk (BulkMetadataSidebar) and single (RightSidebar), so colors/ratings/ notes/dates/keywords show the spinner -> check -> X overlay. Issue 4 — remove Left-sidebar count badges: - Drop count badges from root folder, Archive, heaps, Notes, and the folder tree, plus the now-dead count queries and unused imports. Facet drill-panel counts are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
* failBulk → tiles flash red, auto-clears after 2 s
|
||||
*/
|
||||
|
||||
import { SvelteSet } from 'svelte/reactivity';
|
||||
|
||||
interface BulkActionState {
|
||||
active: boolean;
|
||||
label: string;
|
||||
@@ -18,6 +20,23 @@ interface BulkActionState {
|
||||
export const bulkAction = $state<BulkActionState>({ active: false, label: '' });
|
||||
export const bulkPhotoStates = $state(new Map<string, 'pending' | 'done' | 'error'>());
|
||||
|
||||
/**
|
||||
* UIDs hidden from the timeline grid the instant a removing action (archive /
|
||||
* delete / restore) succeeds, so tiles vanish without waiting on the ~1s
|
||||
* server-reconcile refetch. The caller clears each id once the refetch lands.
|
||||
* This is a pure UI overlay — it never touches the query cache, so it can't
|
||||
* corrupt the facet/drill caches the way a direct cache eviction did.
|
||||
*/
|
||||
export const removedIds = $state(new SvelteSet<string>());
|
||||
|
||||
export function markRemoved(ids: string[]): void {
|
||||
for (const id of ids) removedIds.add(id);
|
||||
}
|
||||
|
||||
export function clearRemoved(ids: string[]): void {
|
||||
for (const id of ids) removedIds.delete(id);
|
||||
}
|
||||
|
||||
let doneTimer: ReturnType<typeof setTimeout> | null = null;
|
||||
|
||||
export function startBulk(label: string, ids: string[]): void {
|
||||
|
||||
Reference in New Issue
Block a user