fix askview focus logic
This commit is contained in:
parent
fbe5c22aa4
commit
aa14a1d0b6
@ -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;
|
||||
|
@ -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 이벤트 리스너 등록 완료');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user