From 7565112b00dfb9aa9135401374354f7cd4e43fef Mon Sep 17 00:00:00 2001 From: adnayn <167046854+uNyanda@users.noreply.github.com> Date: Tue, 13 Oct 2026 23:58:23 +0200 Subject: [PATCH] fix(search): Ctrl+P navigates the palette instead of closing it global.searchNotes is bound to Mod+P, which resolves to Ctrl+P on Linux and Windows. That is also the Emacs previous-item chord every palette handles through isPalettePreviousKey(). focusPaneHandler runs capture-phase on window, so its toggle called preventDefault() and stopImmediatePropagation() before React's delegated root listener ever saw the key. The Ctrl+P branch was unreachable while the palette was open. Ctrl+N, Ctrl+J and Ctrl+K were unaffected because none of them is a global binding, which is the whole of the asymmetry. Removes the toggle rather than guarding it. Escape, opening a note and clicking outside all still dismiss the palette, and the in-app manual already describes Mod+P as opening it rather than toggling. #510's capture-phase registration and the open path below are untouched, so Ctrl+P still opens the palette from the editor and still beats Vim's cursor-up. --- packages/app-core/src/App.tsx | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/packages/app-core/src/App.tsx b/packages/app-core/src/App.tsx index 742fa087..f94d3b0b 100644 --- a/packages/app-core/src/App.tsx +++ b/packages/app-core/src/App.tsx @@ -1029,20 +1029,12 @@ function App(): JSX.Element { !!document.querySelector('[data-prompt-modal]') || !!document.querySelector('[data-confirm-modal]') || !!document.querySelector('[data-cloud-conflict-dialog]') - // Search Notes is a toggle: its own shortcut closes the palette it - // opened (#510 moved it here from the bubble handler, which had no - // overlay guard at all). A confirm on top of the palette, such as the - // Ctrl+D trash confirmation, keeps the key to itself. - if ( - state.searchOpen && - !modalOrMenuOpen && - matchesShortcut(e, overrides, 'global.searchNotes') - ) { - e.preventDefault() - e.stopImmediatePropagation() - setSearchOpen(false) - return - } + // `global.searchNotes` is deliberately not a toggle. `Mod+P` resolves to + // `Ctrl+P` on Linux and Windows, which is also the Emacs previous-item + // chord every palette handles via `isPalettePreviousKey()`. A toggle here + // ran capture-phase and called `stopImmediatePropagation()`, making that + // branch unreachable while the palette was open (#933). Escape dismisses. + // Do not reinstate a toggle above the overlay guard. if ( state.settingsOpen || state.whatsNewOpen ||