fix askview focus logic

This commit is contained in:
sanio 2025-07-14 02:47:37 +09:00
parent fbe5c22aa4
commit aa14a1d0b6
2 changed files with 18 additions and 6 deletions

View File

@ -148,7 +148,7 @@ class AskService {
async toggleAskButton() {
const askWindow = getWindowPool()?.get('ask');
const hasContent = this.state.isStreaming || (this.state.currentResponse && this.state.currentResponse.length > 0);
const hasContent = this.state.isLoading || this.state.isStreaming || (this.state.currentResponse && this.state.currentResponse.length > 0);
if (askWindow && askWindow.isVisible() && hasContent) {
this.state.showTextInput = !this.state.showTextInput;

View File

@ -772,7 +772,9 @@ export class AskView extends LitElement {
console.log('📤 Show text input signal received');
if (!this.showTextInput) {
this.showTextInput = true;
this.requestUpdate();
this.updateComplete.then(() => this.focusTextInput());
} else {
this.focusTextInput();
}
});
@ -783,7 +785,17 @@ export class AskView extends LitElement {
this.currentQuestion = newState.currentQuestion;
this.isLoading = newState.isLoading;
this.isStreaming = newState.isStreaming;
const wasHidden = !this.showTextInput;
this.showTextInput = newState.showTextInput;
if (newState.showTextInput) {
if (wasHidden) {
this.updateComplete.then(() => this.focusTextInput());
} else {
this.focusTextInput();
}
}
});
console.log('✅ AskView: IPC 이벤트 리스너 등록 완료');
}