Skip to content

Commit 0380866

Browse files
committed
Focus and select chat input when navigating from home to main view
- when opening main view (web, api , cli), should select text in the prompt field ├── apps │ └── editor │ └── src │ ├── commands │ │ ├── generate-commit-message-commands │ │ │ ├── actions │ │ │ │ └── run-generate-action.ts │ │ │ └── utils │ │ │ └── get-commit-message-config.ts │ │ └── reference-in-prompt-command.ts │ ├── utils │ │ ├── get-api-configuration.ts │ │ └── show-configurations-quick-pick.ts │ └── views │ └── prompt │ ├── backend │ │ ├── message-handlers │ │ │ ├── handle-at-sign-quick-pick.ts │ │ │ ├── handle-autofill.ts │ │ │ ├── handle-focus-on-file-in-preview.ts │ │ │ ├── handle-hash-sign-quick-pick │ │ │ │ └── handle-hash-sign-quick-pick.ts │ │ │ ├── handle-make-api-call.ts │ │ │ ├── handle-save-completed-tasks.ts │ │ │ └── handle-template-quick-pick.ts │ │ └── prompt-view-provider.ts │ ├── frontend │ │ ├── App.tsx │ │ ├── Main │ │ │ ├── Main.tsx │ │ │ └── MainView │ │ │ └── MainView.tsx │ │ ├── Prompt.tsx │ │ └── hooks │ │ └── use-prompt │ │ └── use-prompt.ts │ └── types │ └── messages.ts └── packages └── ui └── src └── components └── editor ├── common │ └── prompts │ └── PromptField │ ├── PromptField.tsx │ ├── hooks │ │ ├── use-ghost-text.ts │ │ └── use-handlers │ │ └── use-handlers.ts │ └── index.ts └── prompt-view ├── ResponsePreview │ ├── ResponsePreview.stories.tsx │ └── ResponsePreview.tsx └── Tasks ├── Tasks.tsx └── hooks └── use-auto-focus-new-task.ts
1 parent f5b79a0 commit 0380866

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎apps/editor/src/views/prompt/frontend/Prompt.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export const Prompt = () => {
5353
chat_input_focus_key,
5454
set_chat_input_focus_key,
5555
chat_input_focus_and_select_key,
56+
set_chat_input_focus_and_select_key,
5657
can_undo,
5758
send_with_shift_enter,
5859
handle_instructions_change,
@@ -406,19 +407,19 @@ export const Prompt = () => {
406407
set_active_view('main')
407408
set_main_view_scroll_reset_key((k) => k + 1)
408409
handle_target_change('WEB')
409-
set_chat_input_focus_key((k) => k + 1)
410+
set_chat_input_focus_and_select_key((k) => k + 1)
410411
}}
411412
on_api_calls_click={() => {
412413
set_active_view('main')
413414
set_main_view_scroll_reset_key((k) => k + 1)
414415
handle_target_change('API')
415-
set_chat_input_focus_key((k) => k + 1)
416+
set_chat_input_focus_and_select_key((k) => k + 1)
416417
}}
417418
on_cli_calls_click={() => {
418419
set_active_view('main')
419420
set_main_view_scroll_reset_key((k) => k + 1)
420421
handle_target_change('CLI')
421-
set_chat_input_focus_key((k) => k + 1)
422+
set_chat_input_focus_and_select_key((k) => k + 1)
422423
}}
423424
version={version}
424425
is_setup_complete={is_setup_complete}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ export const use_prompt = (vscode: any) => {
314314
chat_input_focus_key,
315315
set_chat_input_focus_key,
316316
chat_input_focus_and_select_key,
317+
set_chat_input_focus_and_select_key,
317318
can_undo,
318319
send_with_shift_enter,
319320
handle_instructions_change,

0 commit comments

Comments
 (0)