diff --git a/src/features/ask/askService.js b/src/features/ask/askService.js index a87a095..9c9a03e 100644 --- a/src/features/ask/askService.js +++ b/src/features/ask/askService.js @@ -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; diff --git a/src/ui/ask/AskView.js b/src/ui/ask/AskView.js index 1b0b862..41c1364 100644 --- a/src/ui/ask/AskView.js +++ b/src/ui/ask/AskView.js @@ -772,8 +772,10 @@ 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(); + } }); window.api.askView.onScrollResponseUp(() => this.handleScroll('up')); @@ -781,10 +783,20 @@ export class AskView extends LitElement { window.api.askView.onAskStateUpdate((event, newState) => { this.currentResponse = newState.currentResponse; this.currentQuestion = newState.currentQuestion; - this.isLoading = newState.isLoading; - this.isStreaming = newState.isStreaming; + 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 이벤트 리스너 등록 완료'); } }