Skip to content

Commit 04e308e

Browse files
committed
Add OpenCode agent and Grok chatbot to default configurations and remove is_action_disabled prop from PromptField
- should never disable actions on the prompt field - move [Fragment] to `apps/editor/src/i18n/translations/utils/show-missing-configuration-notification.ts` - warning "Finish setup to send requests." should have precendence over "context cannot be empty" - prompt copying should require not-empty context ├── apps │ └── editor │ └── src │ ├── commands │ │ ├── code-at-cursor-command │ │ │ └── utils │ │ │ ├── get-code-at-cursor-config.ts │ │ │ └── perform-code-at-cursor.ts │ │ └── generate-commit-message-commands │ │ ├── actions │ │ │ └── run-generate-action.ts │ │ └── utils │ │ └── get-commit-message-config.ts │ ├── features │ │ └── search-files │ │ └── search-modes │ │ └── perform-intelligent-search-mode.ts │ ├── i18n │ │ └── translations │ │ ├── common.ts │ │ ├── utils │ │ │ └── show-missing-configuration-notification.ts │ │ └── views │ │ └── common │ │ └── handlers │ │ └── common.ts │ ├── utils │ │ ├── get-api-configuration.ts │ │ └── show-missing-configuration-notification.ts │ └── views │ └── prompt │ ├── backend │ │ └── message-handlers │ │ ├── handle-autofill.ts │ │ ├── handle-copy-prompt.ts │ │ ├── handle-invoke-agentic-cli.ts │ │ ├── handle-make-api-call.ts │ │ ├── handle-patch-repair.ts │ │ ├── handle-preview-prompt.ts │ │ ├── handle-voice-input.ts │ │ └── utils │ │ └── patch-repair-utils.ts │ └── frontend │ └── Main │ └── MainView │ └── MainView.tsx └── packages └── ui └── src └── components └── editor └── common └── prompts ├── PromptField │ ├── PromptField.module.scss │ ├── PromptField.stories.tsx │ ├── PromptField.tsx │ ├── hooks │ │ ├── use-drag-drop.ts │ │ ├── use-dropdown.ts │ │ ├── use-ghost-text.ts │ │ ├── use-handlers │ │ │ ├── handle-copy.ts │ │ │ ├── handle-cut.ts │ │ │ ├── handle-input-change.ts │ │ │ ├── handle-input-click.ts │ │ │ ├── handle-key-down.ts │ │ │ ├── handle-paste.ts │ │ │ ├── handle-submit.ts │ │ │ ├── index.ts │ │ │ ├── types.ts │ │ │ ├── use-handlers.ts │ │ │ └── utils.ts │ │ └── use-keyboard-shortcuts.ts │ └── index.ts ├── Template │ ├── Template.module.scss │ ├── Template.tsx │ └── index.ts └── shared └── symbols ├── caret.ts ├── get-highlighted-text.tsx ├── index.ts ├── position-mapping.ts ├── prompt-symbols.module.scss ├── reconstruct-raw-value.ts └── use-symbol-deletion.ts
1 parent d2cc136 commit 04e308e

18 files changed

Lines changed: 74 additions & 98 deletions

File tree

‎apps/editor/package.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,10 @@
10381038
{
10391039
"name": "(2)",
10401040
"agent": "Claude Code"
1041+
},
1042+
{
1043+
"name": "(3)",
1044+
"agent": "OpenCode"
10411045
}
10421046
],
10431047
"items": {
@@ -1096,6 +1100,10 @@
10961100
"name": "(3)",
10971101
"chatbot": "Claude"
10981102
},
1103+
{
1104+
"name": "(5)",
1105+
"chatbot": "Grok"
1106+
},
10991107
{
11001108
"name": "(4)",
11011109
"chatbot": "DeepSeek"

‎apps/editor/src/i18n/translations/common.ts‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,6 @@ export const translations = {
5353
hu: 'A felhasználó megszakította a műveletet',
5454
bg: 'Потребителят отмени операцията'
5555
},
56-
'common.warning.setup-incomplete': {
57-
en: 'Setup incomplete.',
58-
pl: 'Konfiguracja niekompletna.',
59-
'zh-cn': '设置未完成。',
60-
ja: 'セットアップが未完了です。',
61-
'zh-tw': '設定未完成。',
62-
de: 'Einrichtung unvollständig.',
63-
es: 'Configuración incompleta.',
64-
fr: 'Configuration incomplète.',
65-
'pt-br': 'Configuração incompleta.',
66-
ru: 'Настройка не завершена.',
67-
ko: '설정이 완료되지 않았습니다.',
68-
it: 'Configurazione incompleta.',
69-
tr: 'Kurulum tamamlanmadı.',
70-
cs: 'Nastavení není dokončeno.',
71-
hu: 'A beállítás nem teljes.',
72-
bg: 'Настройката е непълна.'
73-
},
7456
'common.error.provider-not-found': {
7557
en: 'Provider {name} not found.',
7658
pl: 'Nie znaleziono providera {name}.',
Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1-
export const translations = {} as const
1+
export const translations = {
2+
'utils.show-missing-configuration-notification.warning.setup-incomplete': {
3+
en: 'Finish setup to send requests.',
4+
pl: 'Dokończ konfigurację, aby wysyłać zapytania.',
5+
'zh-cn': '完成设置以发送请求。',
6+
ja: 'リクエストを送信するにはセットアップを完了してください。',
7+
'zh-tw': '完成設定以發送請求。',
8+
de: 'Schließen Sie die Einrichtung ab, um Anfragen zu senden.',
9+
es: 'Termina la configuración para enviar solicitudes.',
10+
fr: 'Terminez la configuration pour envoyer des demandes.',
11+
'pt-br': 'Conclua a configuração para enviar solicitações.',
12+
ru: 'Завершите настройку, чтобы отправлять запросы.',
13+
ko: '요청을 보내려면 설정을 완료하세요.',
14+
it: 'Completa la configurazione per inviare richieste.',
15+
tr: 'İstek göndermek için kurulumu tamamlayın.',
16+
cs: 'Dokončete nastavení, abyste mohli odesílat požadavky.',
17+
hu: 'Fejezze be a beállítást a kérések küldéséhez.',
18+
bg: 'Завършете настройката, за да изпращате заявки.'
19+
}
20+
} as const

‎apps/editor/src/utils/show-missing-configuration-notification.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ export const show_incomplete_setup_warning = async (
88
const open_settings_label = t('common.open-settings')
99
const result = await vscode.window.showWarningMessage(
1010
type == 'api'
11-
? t('common.warning.setup-incomplete')
11+
? t(
12+
'utils.show-missing-configuration-notification.warning.setup-incomplete'
13+
)
1214
: t('common.info.no-items-created-yet', { items: 'chatbots' }),
1315
open_settings_label
1416
)

‎apps/editor/src/views/prompt/backend/message-handlers/handle-autofill.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const handle_autofill = async (params: {
7272
params.prompt_view_provider.web_prompt_type == 'edit-files' &&
7373
!collected_files
7474
) {
75-
vscode.window.showInformationMessage(
75+
vscode.window.showWarningMessage(
7676
t('views.common.handlers.common.context-cannot-be-empty')
7777
)
7878
return

‎apps/editor/src/views/prompt/backend/message-handlers/handle-copy-prompt.ts‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,24 @@ import { t } from '@/i18n'
1313
export const handle_copy_prompt = async (params: {
1414
prompt_view_provider: PromptViewProvider
1515
}): Promise<void> => {
16-
let text = ''
17-
1816
const {
1917
other_files,
2018
recent_files,
19+
collected_files,
2120
processed_instructions,
2221
skill_definitions
2322
} = await build_prompt_payload({
2423
prompt_view_provider: params.prompt_view_provider,
2524
remove_images: true
2625
})
2726

27+
if (!collected_files) {
28+
vscode.window.showWarningMessage(
29+
t('views.common.handlers.common.context-cannot-be-empty')
30+
)
31+
return
32+
}
33+
2834
let output_formatting: string | undefined = undefined
2935
const user_instructions = processed_instructions
3036

@@ -45,7 +51,7 @@ export const handle_copy_prompt = async (params: {
4551
output_formatting,
4652
user_instructions
4753
})
48-
text = build_result.full_prompt
54+
const text = build_result.full_prompt
4955

5056
vscode.env.clipboard.writeText(text.trim())
5157

‎apps/editor/src/views/prompt/backend/message-handlers/handle-invoke-agentic-cli.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const handle_invoke_agentic_cli = async (
2626
prompt_view_provider.cli_prompt_type == 'edit-files' &&
2727
!prompt_view_provider.workspace_provider.get_selected_files().length
2828
) {
29-
vscode.window.showInformationMessage(
29+
vscode.window.showWarningMessage(
3030
t('views.common.handlers.common.context-cannot-be-empty')
3131
)
3232
return

‎apps/editor/src/views/prompt/backend/message-handlers/handle-make-api-call.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
} from '@/constants/edit-format-instructions'
2121
import { PROVIDERS } from '@/constants/providers'
2222
import { get_api_configuration } from '@/utils/get-api-configuration'
23+
import { show_incomplete_setup_warning } from '@/utils/show-missing-configuration-notification'
2324

2425
export const handle_make_api_call = async (
2526
prompt_view_provider: PromptViewProvider,
@@ -32,6 +33,13 @@ export const handle_make_api_call = async (
3233
prompt_view_provider.extension_context
3334
)
3435

36+
const api_configurations = await providers_manager.get_api_configurations()
37+
38+
if (!api_configurations.length) {
39+
show_incomplete_setup_warning('api')
40+
return
41+
}
42+
3543
const current_instructions = prompt_view_provider.current_instructions.trim()
3644

3745
if (!current_instructions) {
@@ -52,7 +60,7 @@ export const handle_make_api_call = async (
5260
})
5361

5462
if (!collected_files) {
55-
vscode.window.showInformationMessage(
63+
vscode.window.showWarningMessage(
5664
t('views.common.handlers.common.context-cannot-be-empty')
5765
)
5866
return

‎apps/editor/src/views/prompt/backend/message-handlers/handle-preview-prompt.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const handle_preview_prompt = async (params: {
4444
})
4545

4646
if (!collected_files) {
47-
vscode.window.showInformationMessage(
47+
vscode.window.showWarningMessage(
4848
t('views.common.handlers.common.context-cannot-be-empty')
4949
)
5050
return

‎apps/editor/src/views/prompt/frontend/Main/MainView/MainView.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,6 @@ export const MainView: React.FC<Props> = (props) => {
441441
props.target == 'WEB' &&
442442
(!props.is_connected || !props.web_configurations.length)
443443
}
444-
is_action_disabled={is_required_context_empty}
445444
value={props.instructions}
446445
chat_history={props.chat_history}
447446
on_change={handle_input_change}

0 commit comments

Comments
 (0)