Skip to content

Commit aea0891

Browse files
committed
Delay chat input focus on response preview finish
- once response preview is accepted, focus on prompt field should be set (change focus key with tiny delay) ├── apps │ └── editor │ └── src │ ├── commands │ │ └── apply-response-command │ │ ├── apply-response-command.ts │ │ └── utils │ │ ├── preview │ │ │ └── preview.ts │ │ └── preview-handler.ts │ ├── constants │ │ └── values.ts │ └── views │ └── prompt │ ├── backend │ │ ├── message-handlers │ │ │ └── handle-response-preview.ts │ │ └── prompt-view-provider.ts │ ├── frontend │ │ ├── Main │ │ │ ├── Main.tsx │ │ │ └── MainView │ │ │ └── MainView.tsx │ │ ├── Prompt.tsx │ │ └── hooks │ │ ├── use-preview-manager.ts │ │ └── use-prompt │ │ └── use-prompt.ts │ └── types │ └── messages.ts └── packages └── ui └── src └── components └── editor └── common └── prompts └── PromptField ├── PromptField.tsx └── index.ts
1 parent 1834758 commit aea0891

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • apps/editor/src/views/prompt/frontend/hooks/use-prompt

‎apps/editor/src/views/prompt/frontend/hooks/use-prompt/use-prompt.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ export const use_prompt = (vscode: any) => {
196196
} else if (message.command === 'API_CONFIGURATIONS') {
197197
set_api_configurations((message as any).configurations)
198198
} else if (message.command === 'RESPONSE_PREVIEW_FINISHED') {
199-
set_chat_input_focus_key((k) => k + 1)
199+
setTimeout(() => {
200+
set_chat_input_focus_key((k) => k + 1)
201+
}, 100)
200202
}
201203
}
202204
window.addEventListener('message', handle_message)

0 commit comments

Comments
 (0)