From d2951f9fef99a1a3e411dd6b2a2adbd23e5e903f Mon Sep 17 00:00:00 2001 From: CarlosCommits <41172581+CarlosCommits@users.noreply.github.com> Date: Mon, 7 Jul 2025 08:22:08 -0400 Subject: [PATCH 1/2] Resolves an intermittent issue where the text input in the "Ask" window would not auto-focus on Windows (#41) --- src/features/ask/AskView.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/features/ask/AskView.js b/src/features/ask/AskView.js index 9565194..ca2a294 100644 --- a/src/features/ask/AskView.js +++ b/src/features/ask/AskView.js @@ -857,12 +857,7 @@ export class AskView extends LitElement { ipcRenderer.on('window-blur', this.handleWindowBlur); ipcRenderer.on('window-did-show', () => { if (!this.currentResponse && !this.isLoading && !this.isStreaming) { - setTimeout(() => { - const textInput = this.shadowRoot?.getElementById('textInput'); - if (textInput) { - textInput.focus(); - } - }, 100); + this.focusTextInput(); } }); @@ -1291,6 +1286,19 @@ export class AskView extends LitElement { if (changedProperties.has('showTextInput') || changedProperties.has('isLoading')) { this.adjustWindowHeightThrottled(); } + + if (changedProperties.has('showTeextInput') && this.showTextInput) { + this.focusTextInput(); + } + } + + focusTextInput(){ + requestAnimationFrame(() => { + const textInput = this.shadowRoot?.getElementById('textInput'); + if (textInput){ + textInput.focus(); + } + }); } firstUpdated() { From 2f7fa36f452bfda7663bc4c7cc2d471103f4e3dc Mon Sep 17 00:00:00 2001 From: samtiz Date: Mon, 7 Jul 2025 21:23:52 +0900 Subject: [PATCH 2/2] fix typo & build err --- electron-builder.yml | 1 - src/features/ask/AskView.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/electron-builder.yml b/electron-builder.yml index 153f3b5..35e6ed5 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -43,7 +43,6 @@ win: arch: x64 - target: portable arch: x64 - publisherName: Pickle Team requestedExecutionLevel: asInvoker # NSIS installer configuration for Windows diff --git a/src/features/ask/AskView.js b/src/features/ask/AskView.js index ca2a294..33cb43c 100644 --- a/src/features/ask/AskView.js +++ b/src/features/ask/AskView.js @@ -1287,7 +1287,7 @@ export class AskView extends LitElement { this.adjustWindowHeightThrottled(); } - if (changedProperties.has('showTeextInput') && this.showTextInput) { + if (changedProperties.has('showTextInput') && this.showTextInput) { this.focusTextInput(); } }