fix(overlay): keep forwarding mpv keys after a Yomitan popup closes

Decide whether the Yomitan popup is open from the popup host in the DOM
instead of the cached yomitanPopupVisible flag, which can lag a close and
kept input.conf keys from reaching mpv.

Keep the imported mpv key list in place while a refresh is in flight, so a
key pressed right after the overlay regains focus is not dropped. A failed
reload still clears the list.

At --log-level debug, log why the overlay kept an mpv-bound key
(config-loading, modal, lookup-popup, interactive-target or
no-imported-bindings) over a validated IPC channel.

Refs #331
This commit is contained in:
sudacode committed 2026-11-20 15:44:25 -08:00
1 parent 0c1865f4a6
commit 299bc3a2b9
14 files changed
+227 -23

No files matched your search

+14
View File
@@ -13,6 +13,20 @@ export interface MpvInputBindingsSnapshot {
blockedKeys: SessionKeySpec[];
}
/** Why the overlay kept a key that mpv binds instead of forwarding it. */
export type MpvKeyForwardBlock =
| 'config-loading'
| 'modal'
| 'lookup-popup'
| 'interactive-target'
| 'no-imported-bindings';
/** Debug report the overlay sends when it does not forward an mpv-bound key. */
export interface UnforwardedMpvKeyReport {
key: string;
reason: MpvKeyForwardBlock;
}
export interface SessionBindingWarning {
kind: 'unsupported' | 'conflict' | 'deprecated-config';
path: string;