Find in a deck column; the app menu no longer closes on a passing blur

Ctrl+F pressed in a deck column (or in the shell while a deck is in front, for its focused column) opens that column's own find bar, laid over the column's header; F3 and Shift+F3 step through it. Same bar, same `tab_find`.

The app menu closed on any window blur. Taking the keyboard from a focused tab (Alt+F / F10 forwarded by the tab, then `shell_focus`) can pass through a blur on its way to the shell, which closed the menu a few milliseconds after it opened. It now closes on blur only if the focus is still away a moment later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
CRTkafa 2026-09-30 23:35:58 +07:00
parent 1356d9364a
commit eb2bc62ad4
4 changed files with 30 additions and 3 deletions

View file

@ -288,6 +288,16 @@ function runShortcut(shortcut: string, id?: string) {
if (deckId) runDeckCommand(deckId, shortcut);
return;
}
// Find in page in a deck column: that column's own find bar (the keys were pressed in it, or it is the
// focused column of the deck in front).
if (shortcut === 'find' || shortcut === 'find-next' || shortcut === 'find-previous') {
const column = id && !api.getPanel(id) ? id : id === undefined && (api.activePanel?.params as TabParams | undefined)?.kind === 'deck' ? zoomTarget() : null;
if (column && findColumnTab(column)?.column) {
if (shortcut !== 'find') stepFind(column, shortcut === 'find-next' ? 1 : -1);
else if (hasFeature('find')) openFind(column);
return;
}
}
// A browser shortcut pressed inside a deck column acts on its deck tab.
if (id && !api.getPanel(id) && findColumnTab(id)) id = deckPanelId(findColumnTab(id)!.deck.id);
const panel = id === undefined ? api.activePanel : api.getPanel(id);