feat(frontend): keyboard control for the add-to-pool dialog

The file viewer could only open the pool picker via its top-right button —
there was no `p` shortcut there (only the grid had one), so pressing `p`
on the view page did nothing. Add `p` to open the picker from the viewer,
and give the picker itself full keyboard control: `/` focuses the search
box, arrows move a highlight through the pool list, Enter adds to the
highlighted pool, and Escape clears the search first, then closes.

Both the viewer and the grid now yield the keyboard entirely to the open
picker (the picker owns Escape via its own window handler) so the
clear-then-close behaviour isn't pre-empted by the host's own Escape.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-17 17:15:12 +03:00
parent b8d08925a2
commit c9b7f0701b
3 changed files with 83 additions and 15 deletions
+1 -1
View File
@@ -148,7 +148,7 @@
function handleKey(e: KeyboardEvent) {
if (e.key === 'Escape') {
if (tagEditorOpen) tagEditorOpen = false;
else if (poolPickerOpen) poolPickerOpen = false;
else if (poolPickerOpen) return; // PoolPicker owns Escape (clear search, then close)
else if (confirmDeleteFiles) confirmDeleteFiles = false;
else if (activeFileId) return;
else if ($selectionActive) selectionStore.exit();