diff --git a/frontend/src/lib/components/layout/SelectionBar.svelte b/frontend/src/lib/components/layout/SelectionBar.svelte
index a47b181..f760109 100644
--- a/frontend/src/lib/components/layout/SelectionBar.svelte
+++ b/frontend/src/lib/components/layout/SelectionBar.svelte
@@ -8,14 +8,8 @@
}
let { onEditTags, onAddToPool, onDelete }: Props = $props();
-
- function handleKeydown(e: KeyboardEvent) {
- if (e.key === 'Escape') selectionStore.exit();
- }
-
-
diff --git a/frontend/src/routes/files/+page.svelte b/frontend/src/routes/files/+page.svelte
index 0698679..646d3f5 100644
--- a/frontend/src/routes/files/+page.svelte
+++ b/frontend/src/routes/files/+page.svelte
@@ -27,6 +27,18 @@
// ---- Bulk tag editor ----
let tagEditorOpen = $state(false);
+ // Escape dismisses one layer at a time: an open overlay (tag editor / pool
+ // picker / delete confirm) first, then the selection. The file viewer owns
+ // its own Escape, so we bail out while it's up.
+ function handleEscape(e: KeyboardEvent) {
+ if (e.key !== 'Escape') return;
+ if (tagEditorOpen) tagEditorOpen = false;
+ else if (poolPickerOpen) poolPickerOpen = false;
+ else if (confirmDeleteFiles) confirmDeleteFiles = false;
+ else if (activeFileId) return;
+ else if ($selectionActive) selectionStore.exit();
+ }
+
// ---- Add to pool picker ----
let poolPickerOpen = $state(false);
let pools = $state
([]);
@@ -455,6 +467,8 @@
});
+
+
Files | Tanabata