Skip to content

Commit 274e95f

Browse files
committed
Rename edit context system instructions to edit files system instructions throughout the settings view
- rename 'edit context' to 'edit files', completing our renaming efforts.
1 parent 45b706c commit 274e95f

8 files changed

Lines changed: 58 additions & 65 deletions

File tree

‎apps/editor/src/views/settings/backend/message-handlers/handle-get-edit-files-system-instructions.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const handle_get_edit_files_system_instructions = async (
1010
config.get<string>('editFilesSystemInstructions') ||
1111
default_system_instructions
1212
provider.postMessage({
13-
command: 'EDIT_CONTEXT_SYSTEM_INSTRUCTIONS',
13+
command: 'EDIT_FILES_SYSTEM_INSTRUCTIONS',
1414
instructions
1515
})
1616
}

‎apps/editor/src/views/settings/backend/settings-provider.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,9 @@ export class SettingsProvider {
166166
)
167167
} else if (message.command == 'SELECT_DEFAULT_API_CONFIGURATION') {
168168
await handle_select_default_api_configuration(this, message)
169-
} else if (message.command == 'GET_EDIT_CONTEXT_SYSTEM_INSTRUCTIONS') {
169+
} else if (message.command == 'GET_EDIT_FILES_SYSTEM_INSTRUCTIONS') {
170170
await handle_get_edit_files_system_instructions(this)
171-
} else if (
172-
message.command == 'UPDATE_EDIT_CONTEXT_SYSTEM_INSTRUCTIONS'
173-
) {
171+
} else if (message.command == 'UPDATE_EDIT_FILES_SYSTEM_INSTRUCTIONS') {
174172
await handle_update_edit_files_system_instructions(message)
175173
} else if (message.command == 'GET_EDIT_FORMAT_INSTRUCTIONS') {
176174
await handle_get_edit_format_instructions(this)

‎apps/editor/src/views/settings/frontend/Home/Home.tsx‎

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ type Props = {
9999
api_configurations: ApiConfiguration[]
100100
web_configurations: WebConfiguration[]
101101
defaults: Record<ToolType, string | null>
102-
edit_context_system_instructions: string
102+
edit_files_system_instructions: string
103103
voice_input_instructions: string
104104
voice_input_push_to_talk: boolean
105105
commit_message_instructions: string
@@ -127,7 +127,7 @@ type Props = {
127127
on_edit_format_instructions_change: (
128128
instructions: EditFormatInstructions
129129
) => void
130-
on_edit_context_system_instructions_change: (instructions: string) => void
130+
on_edit_files_system_instructions_change: (instructions: string) => void
131131
on_voice_input_instructions_change: (instructions: string) => void
132132
on_voice_input_push_to_talk_change: (enabled: boolean) => void
133133
on_automatic_checkpoints_toggle: (disabled: boolean) => void
@@ -204,8 +204,7 @@ export const Home: React.FC<Props> = (props) => {
204204

205205
const [commit_instructions, set_commit_instructions] = useState('')
206206
const [voice_input_instructions, set_voice_input_instructions] = useState('')
207-
const [edit_context_instructions, set_edit_context_instructions] =
208-
useState('')
207+
const [edit_files_instructions, set_edit_files_instructions] = useState('')
209208

210209
const get_has_warning = (id: NavItem): boolean => {
211210
if (id == 'model-providers') {
@@ -262,8 +261,8 @@ export const Home: React.FC<Props> = (props) => {
262261
}, [props.voice_input_instructions])
263262

264263
useEffect(() => {
265-
set_edit_context_instructions(props.edit_context_system_instructions || '')
266-
}, [props.edit_context_system_instructions])
264+
set_edit_files_instructions(props.edit_files_system_instructions || '')
265+
}, [props.edit_files_system_instructions])
267266

268267
const handle_scroll_to_section = (item_id: NavItem) => {
269268
const section = section_refs.current[item_id]
@@ -430,22 +429,22 @@ export const Home: React.FC<Props> = (props) => {
430429
on_add_api_configuration={props.on_add_api_configuration}
431430
on_edit_api_configuration={props.on_edit_api_configuration}
432431
on_delete_api_configuration={props.on_delete_api_configuration}
433-
edit_context_instructions={edit_context_instructions}
432+
edit_files_instructions={edit_files_instructions}
434433
commit_instructions={commit_instructions}
435434
voice_input_instructions={voice_input_instructions}
436-
set_edit_context_instructions={set_edit_context_instructions}
435+
set_edit_files_instructions={set_edit_files_instructions}
437436
set_commit_instructions={set_commit_instructions}
438437
set_voice_input_instructions={set_voice_input_instructions}
439-
on_edit_context_instructions_blur={() => {
440-
props.on_edit_context_system_instructions_change(
441-
edit_context_instructions
438+
on_edit_files_instructions_blur={() => {
439+
props.on_edit_files_system_instructions_change(
440+
edit_files_instructions
442441
)
443442
if (
444-
edit_context_instructions == '' &&
445-
props.edit_context_system_instructions ==
443+
edit_files_instructions == '' &&
444+
props.edit_files_system_instructions ==
446445
default_system_instructions
447446
) {
448-
set_edit_context_instructions(default_system_instructions)
447+
set_edit_files_instructions(default_system_instructions)
449448
}
450449
}}
451450
on_commit_instructions_blur={() => {
@@ -467,12 +466,12 @@ export const Home: React.FC<Props> = (props) => {
467466
set_voice_input_instructions(default_voice_input_instructions)
468467
}
469468
}}
470-
default_edit_context_instructions={default_system_instructions}
469+
default_edit_files_instructions={default_system_instructions}
471470
default_commit_instructions={default_commit_message_instructions}
472471
default_voice_input_instructions={default_voice_input_instructions}
473-
on_restore_edit_context_instructions={() => {
474-
set_edit_context_instructions(default_system_instructions)
475-
props.on_edit_context_system_instructions_change(
472+
on_restore_edit_files_instructions={() => {
473+
set_edit_files_instructions(default_system_instructions)
474+
props.on_edit_files_system_instructions_change(
476475
default_system_instructions
477476
)
478477
}}

‎apps/editor/src/views/settings/frontend/Home/sections/ApiConfigurationsSection.tsx‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ type Props = {
4040
) => void
4141
on_select_default_api_configuration: (tool_name: ToolType) => void
4242
set_section_ref: (id: NavItem, el: HTMLDivElement | null) => void
43-
edit_context_instructions: string
43+
edit_files_instructions: string
4444
commit_instructions: string
4545
voice_input_instructions: string
46-
set_edit_context_instructions: (instructions: string) => void
46+
set_edit_files_instructions: (instructions: string) => void
4747
set_commit_instructions: (instructions: string) => void
4848
set_voice_input_instructions: (instructions: string) => void
49-
on_edit_context_instructions_blur: () => void
49+
on_edit_files_instructions_blur: () => void
5050
on_commit_instructions_blur: () => void
5151
on_voice_input_instructions_blur: () => void
52-
default_edit_context_instructions: string
52+
default_edit_files_instructions: string
5353
default_commit_instructions: string
5454
default_voice_input_instructions: string
55-
on_restore_edit_context_instructions: () => void
55+
on_restore_edit_files_instructions: () => void
5656
on_restore_commit_instructions: () => void
5757
on_restore_voice_input_instructions: () => void
5858
extended_cache_duration_for_anthropic: boolean
@@ -354,17 +354,17 @@ export const ApiConfigurationsSection = forwardRef<HTMLDivElement, Props>(
354354
)}
355355
>
356356
<UiTextarea
357-
value={props.edit_context_instructions}
358-
on_change={props.set_edit_context_instructions}
359-
on_blur={props.on_edit_context_instructions_blur}
357+
value={props.edit_files_instructions}
358+
on_change={props.set_edit_files_instructions}
359+
on_blur={props.on_edit_files_instructions_blur}
360360
action_icon={
361-
props.edit_context_instructions !==
362-
props.default_edit_context_instructions
361+
props.edit_files_instructions !==
362+
props.default_edit_files_instructions
363363
? 'discard'
364364
: undefined
365365
}
366366
action_title={t('configurations.action.restore-default')}
367-
on_action_click={props.on_restore_edit_context_instructions}
367+
on_action_click={props.on_restore_edit_files_instructions}
368368
/>
369369
</UiItem>
370370
<UiItem

‎apps/editor/src/views/settings/frontend/Settings.tsx‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const Settings = () => {
3838
settings_hook.api_configurations !== undefined &&
3939
settings_hook.web_configurations !== undefined &&
4040
settings_hook.defaults !== undefined &&
41-
settings_hook.edit_context_system_instructions !== undefined &&
41+
settings_hook.edit_files_system_instructions !== undefined &&
4242
settings_hook.voice_input_instructions !== undefined &&
4343
settings_hook.voice_input_push_to_talk !== undefined &&
4444
settings_hook.commit_message_instructions !== undefined &&
@@ -78,8 +78,8 @@ export const Settings = () => {
7878
providers={settings_hook.providers!}
7979
api_configurations={settings_hook.api_configurations!}
8080
defaults={settings_hook.defaults!}
81-
edit_context_system_instructions={
82-
settings_hook.edit_context_system_instructions!
81+
edit_files_system_instructions={
82+
settings_hook.edit_files_system_instructions!
8383
}
8484
context_size_warning_threshold={
8585
settings_hook.context_size_warning_threshold!
@@ -124,8 +124,8 @@ export const Settings = () => {
124124
on_include_prompts_in_commit_messages_change={
125125
settings_hook.handle_include_prompts_in_commit_messages_change
126126
}
127-
on_edit_context_system_instructions_change={
128-
settings_hook.handle_edit_context_system_instructions_change
127+
on_edit_files_system_instructions_change={
128+
settings_hook.handle_edit_files_system_instructions_change
129129
}
130130
on_edit_format_instructions_change={
131131
settings_hook.handle_edit_format_instructions_change

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

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ export const use_settings = (vscode: any) => {
3333
include_prompts_in_commit_messages,
3434
set_include_prompts_in_commit_messages
3535
] = useState<boolean | undefined>(undefined)
36-
const [
37-
edit_context_system_instructions,
38-
set_edit_context_system_instructions
39-
] = useState<string | undefined>(undefined)
36+
const [edit_files_system_instructions, set_edit_files_system_instructions] =
37+
useState<string | undefined>(undefined)
4038
const [context_size_warning_threshold, set_context_size_warning_threshold] =
4139
useState<number>()
4240
const [edit_format_instructions, set_edit_format_instructions] = useState<
@@ -79,7 +77,7 @@ export const use_settings = (vscode: any) => {
7977
post_message(vscode, { command: 'GET_MODEL_PROVIDERS' })
8078
post_message(vscode, { command: 'GET_API_CONFIGURATIONS' })
8179
post_message(vscode, { command: 'GET_WEB_CONFIGURATIONS' })
82-
post_message(vscode, { command: 'GET_EDIT_CONTEXT_SYSTEM_INSTRUCTIONS' })
80+
post_message(vscode, { command: 'GET_EDIT_FILES_SYSTEM_INSTRUCTIONS' })
8381
post_message(vscode, { command: 'GET_COMMIT_MESSAGE_INSTRUCTIONS' })
8482
post_message(vscode, { command: 'GET_INCLUDE_PROMPTS_IN_COMMIT_MESSAGES' })
8583
post_message(vscode, { command: 'GET_VOICE_INPUT_INSTRUCTIONS' })
@@ -110,8 +108,8 @@ export const use_settings = (vscode: any) => {
110108
set_defaults(message.defaults)
111109
} else if (message.command == 'WEB_CONFIGURATIONS') {
112110
set_web_configurations(message.web_configurations)
113-
} else if (message.command == 'EDIT_CONTEXT_SYSTEM_INSTRUCTIONS') {
114-
set_edit_context_system_instructions(message.instructions)
111+
} else if (message.command == 'EDIT_FILES_SYSTEM_INSTRUCTIONS') {
112+
set_edit_files_system_instructions(message.instructions)
115113
} else if (message.command == 'COMMIT_MESSAGE_INSTRUCTIONS') {
116114
set_commit_message_instructions(message.instructions)
117115
} else if (message.command == 'INCLUDE_PROMPTS_IN_COMMIT_MESSAGES') {
@@ -289,11 +287,9 @@ export const use_settings = (vscode: any) => {
289287
})
290288
}
291289

292-
const handle_edit_context_system_instructions_change = (
293-
instructions: string
294-
) =>
290+
const handle_edit_files_system_instructions_change = (instructions: string) =>
295291
post_message(vscode, {
296-
command: 'UPDATE_EDIT_CONTEXT_SYSTEM_INSTRUCTIONS',
292+
command: 'UPDATE_EDIT_FILES_SYSTEM_INSTRUCTIONS',
297293
instructions
298294
})
299295

@@ -426,7 +422,7 @@ export const use_settings = (vscode: any) => {
426422
voice_input_push_to_talk,
427423
commit_message_instructions,
428424
include_prompts_in_commit_messages,
429-
edit_context_system_instructions,
425+
edit_files_system_instructions,
430426
context_size_warning_threshold,
431427
edit_format_instructions,
432428
are_automatic_checkpoints_disabled,
@@ -455,7 +451,7 @@ export const use_settings = (vscode: any) => {
455451
handle_voice_input_push_to_talk_change,
456452
handle_commit_instructions_change,
457453
handle_include_prompts_in_commit_messages_change,
458-
handle_edit_context_system_instructions_change,
454+
handle_edit_files_system_instructions_change,
459455
handle_open_editor_settings,
460456
handle_open_ignore_patterns_settings,
461457
handle_open_allow_patterns_settings,

‎apps/editor/src/views/settings/frontend/i18n/translations/configurations.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@ export const configurations = {
324324
bg: 'Инструкции'
325325
},
326326
'configurations.edit-files-system-instructions.title': {
327-
en: 'Edit Context System Instructions',
328-
pl: 'Instrukcje systemowe edycji kontekstu',
327+
en: 'Edit Files System Instructions',
328+
pl: 'Instrukcje systemowe edycji plików',
329329
'zh-cn': '编辑上下文系统指令',
330330
ja: 'コンテキスト編集のシステム指示',
331331
'zh-tw': '編輯上下文系統指令',
@@ -342,8 +342,8 @@ export const configurations = {
342342
bg: 'Системни инструкции за редактиране на контекст'
343343
},
344344
'configurations.edit-files-system-instructions.description': {
345-
en: 'Tone and style instructions for the model when using the Edit Context prompt type with API calls.',
346-
pl: 'Instrukcje dotyczące tonu i stylu dla modelu przy użyciu typu promptu Edycji Kontekstu z zapytaniami API.',
345+
en: 'Tone and style instructions for the model when using the Edit Files prompt type with API calls.',
346+
pl: 'Instrukcje dotyczące tonu i stylu dla modelu przy użyciu typu promptu Edycji Plików z zapytaniami API.',
347347
'zh-cn': '使用编辑上下文提示类型进行 API 调用时,模型的语气和样式说明。',
348348
ja: 'API 呼び出しでコンテキスト編集プロンプトタイプを使用する際のモデルのトーンとスタイルの指示。',
349349
'zh-tw': '使用編輯上下文提示類型進行 API 呼叫時,模型的語氣和樣式說明。',

‎apps/editor/src/views/settings/types/messages.ts‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ export interface UpdateVoiceInputPushToTalkMessage {
100100
enabled: boolean
101101
}
102102

103-
export interface GetEditContextSystemInstructionsMessage {
104-
command: 'GET_EDIT_CONTEXT_SYSTEM_INSTRUCTIONS'
103+
export interface GetEditFilesSystemInstructionsMessage {
104+
command: 'GET_EDIT_FILES_SYSTEM_INSTRUCTIONS'
105105
}
106106

107-
export interface UpdateEditContextSystemInstructionsMessage {
108-
command: 'UPDATE_EDIT_CONTEXT_SYSTEM_INSTRUCTIONS'
107+
export interface UpdateEditFilesSystemInstructionsMessage {
108+
command: 'UPDATE_EDIT_FILES_SYSTEM_INSTRUCTIONS'
109109
instructions: string
110110
}
111111

@@ -350,8 +350,8 @@ export type FrontendMessage =
350350
| UpdateVoiceInputInstructionsMessage
351351
| GetVoiceInputPushToTalkMessage
352352
| UpdateVoiceInputPushToTalkMessage
353-
| GetEditContextSystemInstructionsMessage
354-
| UpdateEditContextSystemInstructionsMessage
353+
| GetEditFilesSystemInstructionsMessage
354+
| UpdateEditFilesSystemInstructionsMessage
355355
| GetEditFormatInstructionsMessage
356356
| UpdateEditFormatInstructionsMessage
357357
| SettingsUiReadyMessage
@@ -430,8 +430,8 @@ export interface VoiceInputPushToTalkMessage {
430430
enabled: boolean
431431
}
432432

433-
export interface EditContextSystemInstructionsMessage {
434-
command: 'EDIT_CONTEXT_SYSTEM_INSTRUCTIONS'
433+
export interface EditFilesSystemInstructionsMessage {
434+
command: 'EDIT_FILES_SYSTEM_INSTRUCTIONS'
435435
instructions: string
436436
}
437437

@@ -557,7 +557,7 @@ export type BackendMessage =
557557
| IncludePromptsInCommitMessagesMessage
558558
| VoiceInputInstructionsMessage
559559
| VoiceInputPushToTalkMessage
560-
| EditContextSystemInstructionsMessage
560+
| EditFilesSystemInstructionsMessage
561561
| EditFormatInstructionsMessage
562562
| ContextSizeWarningThresholdMessage
563563
| AreAutomaticCheckpointsDisabledMessage

0 commit comments

Comments
 (0)