feat(10-09): add global keydown handler to App.vue — /, Escape, U, N shortcuts live

- Add routeViewRef = ref(null) and bind to <router-view ref="routeViewRef">
- Add onKeydown handler: guards INPUT/TEXTAREA/SELECT/contenteditable; routes / → focusSearch, Escape → clearSearch, U/u → triggerUpload, N/n → startNewFolder
- Chain document.addEventListener on onMounted, removeEventListener on onUnmounted
- Add double optional chaining (?.) in StorageBrowser.triggerUpload and focusSearch so stubs don't throw in tests
- 9 keyboard shortcut tests GREEN; full suite 190 passing 0 failures
This commit is contained in:
curo1305
2026-06-15 20:36:52 +02:00
parent aaa0532af9
commit d7bda3c605
2 changed files with 30 additions and 5 deletions
@@ -353,8 +353,8 @@ async function submitNewFolder() {
defineExpose({
startNewFolder,
triggerUpload: () => dropZoneRef.value?.triggerInput(),
focusSearch: () => searchBarRef.value?.focus(),
triggerUpload: () => dropZoneRef.value?.triggerInput?.(),
focusSearch: () => searchBarRef.value?.focus?.(),
clearSearch: () => emit('search-change', ''),
})