add screen only ask, retrieve loading dot

This commit is contained in:
sanio 2025-07-14 03:16:29 +09:00
parent aa14a1d0b6
commit bcc8a59882
4 changed files with 24 additions and 10 deletions

View File

@ -145,9 +145,16 @@ class AskService {
} }
} }
async toggleAskButton() { async toggleAskButton(inputScreenOnly = false) {
const askWindow = getWindowPool()?.get('ask'); const askWindow = getWindowPool()?.get('ask');
let shouldSendScreenOnly = false;
if (inputScreenOnly && this.state.showTextInput && askWindow && askWindow.isVisible()) {
shouldSendScreenOnly = true;
await this.sendMessage('', []);
return;
}
const hasContent = this.state.isLoading || 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) { if (askWindow && askWindow.isVisible() && hasContent) {
@ -218,10 +225,12 @@ class AskService {
this.abortController = new AbortController(); this.abortController = new AbortController();
const { signal } = this.abortController; const { signal } = this.abortController;
if (!userPrompt || userPrompt.trim().length === 0) {
console.warn('[AskService] Cannot process empty message'); // if (!userPrompt || userPrompt.trim().length === 0) {
return { success: false, error: 'Empty message' }; // console.warn('[AskService] Cannot process empty message');
} // return { success: false, error: 'Empty message' };
// }
let sessionId; let sessionId;

View File

@ -211,7 +211,7 @@ class ShortcutsService {
callback = () => this.toggleAllWindowsVisibility(this.windowPool); callback = () => this.toggleAllWindowsVisibility(this.windowPool);
break; break;
case 'nextStep': case 'nextStep':
callback = () => askService.toggleAskButton(); callback = () => askService.toggleAskButton(true);
break; break;
case 'scrollUp': case 'scrollUp':
callback = () => { callback = () => {

View File

@ -136,7 +136,7 @@ contextBridge.exposeInMainWorld('api', {
// Listeners // Listeners
onAskStateUpdate: (callback) => ipcRenderer.on('ask:stateUpdate', callback), onAskStateUpdate: (callback) => ipcRenderer.on('ask:stateUpdate', callback),
removeOnAskStateUpdate: (callback) => ipcRenderer.removeListener('ask:stateUpdate', callback), removeOnAskStateUpdate: (callback) => ipcRenderer.removeListener('ask:stateUpdate', callback),
onAskStreamError: (callback) => ipcRenderer.on('ask-response-stream-error', callback), onAskStreamError: (callback) => ipcRenderer.on('ask-response-stream-error', callback),
removeOnAskStreamError: (callback) => ipcRenderer.removeListener('ask-response-stream-error', callback), removeOnAskStreamError: (callback) => ipcRenderer.removeListener('ask-response-stream-error', callback),

View File

@ -987,9 +987,14 @@ export class AskView extends LitElement {
// ✨ 로딩 상태를 먼저 확인 // ✨ 로딩 상태를 먼저 확인
if (this.isLoading) { if (this.isLoading) {
responseContainer.innerHTML = `<div class="loading-dots">...</div>`; responseContainer.innerHTML = `
<div class="loading-dots">
<div class="loading-dot"></div>
<div class="loading-dot"></div>
<div class="loading-dot"></div>
</div>`;
return; return;
} }
// ✨ 응답이 없을 때의 처리 // ✨ 응답이 없을 때의 처리
if (!this.currentResponse) { if (!this.currentResponse) {
@ -1232,7 +1237,7 @@ export class AskView extends LitElement {
async handleSendText(e, overridingText = '') { async handleSendText(e, overridingText = '') {
const textInput = this.shadowRoot?.getElementById('textInput'); const textInput = this.shadowRoot?.getElementById('textInput');
const text = (overridingText || textInput?.value || '').trim(); const text = (overridingText || textInput?.value || '').trim();
if (!text) return; // if (!text) return;
textInput.value = ''; textInput.value = '';