fix(auth): routed smart paste into focused prompts
- Intercepted the configured smart-paste shortcut while a paste-capable modal owns focus. - Added regression coverage for Ctrl+V API-key entry and documented the fix. Fixes #6057
This commit is contained in:
@@ -172,6 +172,7 @@ export class InputController {
|
||||
|
||||
#enhancedPaste?: EnhancedPasteController;
|
||||
#focusedLeftTapListenerInstalled = false;
|
||||
#focusedPasteListenerInstalled = false;
|
||||
#btwBranchListenerInstalled = false;
|
||||
#btwCopyListenerInstalled = false;
|
||||
// Tap counter for the double-← gesture; reset whenever a quiet gap
|
||||
@@ -265,6 +266,16 @@ export class InputController {
|
||||
return { consume: true };
|
||||
});
|
||||
}
|
||||
if (!this.#focusedPasteListenerInstalled) {
|
||||
this.#focusedPasteListenerInstalled = true;
|
||||
this.ctx.ui.addInputListener(data => {
|
||||
const focused = this.ctx.ui.getFocused();
|
||||
if (!focused || focused === this.ctx.editor || !hasPasteText(focused)) return undefined;
|
||||
if (!this.ctx.keybindings.matches(data, "app.clipboard.pasteImage")) return undefined;
|
||||
void this.handleImagePaste();
|
||||
return { consume: true };
|
||||
});
|
||||
}
|
||||
this.ctx.editor.onEscape = () => {
|
||||
// Side-channel panels are the topmost view. Esc dismisses them before
|
||||
// touching loop mode, maintenance, or the underlying main turn.
|
||||
|
||||
Reference in New Issue
Block a user