Escape progressively unfocuses then navigates home

First Escape blurs the active input (reaching neutral state where
shortcuts work), second Escape navigates home. Allows full keyboard
navigation without touching the mouse to leave a focused field.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-04 08:20:26 -05:00
parent 3836f08007
commit 264c3664ba
+6 -4
View File
@@ -52,16 +52,18 @@ function onGlobalKeydown(e: KeyboardEvent) {
return;
}
// Escape — close shortcuts overlay OR navigate home
// Escape — progressive: close overlay → unfocus field → go home
if (e.key === "Escape") {
clearPrefix();
if (showShortcuts.value) {
closeShortcuts();
return;
}
if (!isInputActive()) {
router.push("/");
if (isInputActive()) {
(document.activeElement as HTMLElement).blur();
return;
}
router.push("/");
return;
}
@@ -173,7 +175,7 @@ onUnmounted(() => {
</div>
<div class="shortcut-row">
<kbd class="shortcut-key">Esc</kbd>
<span class="shortcut-desc">Go home (when not typing)</span>
<span class="shortcut-desc">Unfocus field go home</span>
</div>
<div class="shortcut-row">
<kbd class="shortcut-key">?</kbd>