diff --git a/frontend/src/lib/components/PhotoGrid.svelte b/frontend/src/lib/components/PhotoGrid.svelte
index 09ad607..be42372 100644
--- a/frontend/src/lib/components/PhotoGrid.svelte
+++ b/frontend/src/lib/components/PhotoGrid.svelte
@@ -6,16 +6,31 @@
interface Props {
photos: Photo[];
selectedIds?: string[];
+ cursorIndex?: number | null;
+ cursorVisible?: boolean;
onSelect?: (index: number, event: MouseEvent) => void;
onOpen?: (index: number) => void;
onDragStart?: (index: number, event: DragEvent) => void;
onContextMenu?: (index: number, event: MouseEvent) => void;
+ onCursorFocus?: (index: number) => void;
}
- let { photos, selectedIds = [], onSelect, onOpen, onDragStart, onContextMenu }: Props =
- $props();
+ let {
+ photos,
+ selectedIds = [],
+ cursorIndex = null,
+ cursorVisible = false,
+ onSelect,
+ onOpen,
+ onDragStart,
+ onContextMenu,
+ onCursorFocus
+ }: Props = $props();
const isSelected = (id: string) => selectedIds.includes(id);
+ const isCursor = (i: number) => cursorIndex === i;
+ const tabIndexFor = (i: number) =>
+ cursorIndex == null ? (i === 0 ? 0 : -1) : isCursor(i) ? 0 : -1;
{#if photos.length === 0}
@@ -29,13 +44,18 @@