Skip to content

Commit 22f74f1

Browse files
committed
Rename ask-about-context prompt type to ask-about-files throughout the codebase
1 parent 4588e46 commit 22f74f1

13 files changed

Lines changed: 24 additions & 26 deletions

File tree

‎apps/browser/src/content-scripts/send-prompt-content-script/send-prompt-content-script.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ const main = async () => {
199199
raw_instructions?: string
200200
edit_format?: string
201201
prompt_type?:
202-
| 'ask-about-context'
202+
| 'ask-about-files'
203203
| 'edit-files'
204204
| 'code-at-cursor'
205205
| 'find-relevant-files'

‎apps/editor/src/views/panel/backend/message-handlers/handle-save-history.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const handle_save_history = async (
1616
let key: string | undefined
1717

1818
switch (message.prompt_type) {
19-
case 'ask-about-context':
19+
case 'ask-about-files':
2020
key = HISTORY_ASK_STATE_KEY
2121
break
2222
case 'edit-files':

‎apps/editor/src/views/panel/backend/message-handlers/handle-save-instructions.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const handle_save_instructions = async (
1818
const { prompt_type, instruction } = message as any
1919
const instruction_state = instruction as InstructionsState
2020

21-
if (prompt_type == 'ask-about-context') {
21+
if (prompt_type == 'ask-about-files') {
2222
panel_provider.ask_about_context_instructions = instruction_state
2323
await panel_provider.context.workspaceState.update(
2424
INSTRUCTIONS_ASK_STATE_KEY,

‎apps/editor/src/views/panel/backend/message-handlers/handle-send-to-browser.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ const resolve_web_configuration = async (params: {
426426
params.panel_provider.code_at_cursor_instructions.instructions[
427427
params.panel_provider.code_at_cursor_instructions.active_index
428428
] || ''
429-
} else if (params.panel_provider.web_prompt_type == 'ask-about-context') {
429+
} else if (params.panel_provider.web_prompt_type == 'ask-about-files') {
430430
current_instructions =
431431
params.panel_provider.ask_about_context_instructions.instructions[
432432
params.panel_provider.ask_about_context_instructions.active_index

‎apps/editor/src/views/panel/backend/message-handlers/handle-show-prompt-template-quick-pick.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const handle_show_prompt_template_quick_pick = async (
2626

2727
let prompt_templates_key: string | undefined
2828
switch (prompt_type) {
29-
case 'ask-about-context':
29+
case 'ask-about-files':
3030
prompt_templates_key = 'promptTemplatesForAskAboutContext'
3131
break
3232
case 'edit-files':

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export class PanelProvider implements vscode.WebviewViewProvider {
236236

237237
public get active_instructions_state(): InstructionsState {
238238
const type = this.prompt_type
239-
if (type == 'ask-about-context') return this.ask_about_context_instructions
239+
if (type == 'ask-about-files') return this.ask_about_context_instructions
240240
if (type == 'edit-files') return this.edit_context_instructions
241241
if (type == 'without-files') return this.no_context_instructions
242242
if (type == 'code-at-cursor') return this.code_at_cursor_instructions
@@ -1025,7 +1025,7 @@ export class PanelProvider implements vscode.WebviewViewProvider {
10251025
})
10261026

10271027
const web_prompt_types: WebPromptType[] = [
1028-
'ask-about-context',
1028+
'ask-about-files',
10291029
'find-relevant-files',
10301030
'edit-files',
10311031
'code-at-cursor',

‎apps/editor/src/views/panel/frontend/Main/Main.tsx‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type Props = {
3636
set_instructions: (
3737
value: string,
3838
prompt_type:
39-
| 'ask-about-context'
39+
| 'ask-about-files'
4040
| 'edit-files'
4141
| 'without-files'
4242
| 'code-at-cursor'
@@ -197,7 +197,7 @@ export const Main: React.FC<Props> = (props) => {
197197
let history: string[] | undefined
198198
let set_history: React.Dispatch<React.SetStateAction<string[] | undefined>>
199199

200-
if (current_prompt_type == 'ask-about-context') {
200+
if (current_prompt_type == 'ask-about-files') {
201201
history = ask_history
202202
set_history = set_ask_history
203203
} else if (current_prompt_type == 'edit-files') {
@@ -411,8 +411,7 @@ export const Main: React.FC<Props> = (props) => {
411411
} else if (current_prompt_type == 'find-relevant-files') {
412412
return props.find_relevant_files_instructions
413413
}
414-
if (current_prompt_type == 'ask-about-context')
415-
return props.ask_instructions
414+
if (current_prompt_type == 'ask-about-files') return props.ask_instructions
416415
if (current_prompt_type == 'edit-files') return props.edit_instructions
417416
if (current_prompt_type == 'without-files')
418417
return props.no_context_instructions
@@ -569,7 +568,7 @@ export const Main: React.FC<Props> = (props) => {
569568
}
570569

571570
const instructions =
572-
current_prompt_type == 'ask-about-context'
571+
current_prompt_type == 'ask-about-files'
573572
? props.ask_instructions
574573
: current_prompt_type == 'edit-files'
575574
? props.edit_instructions
@@ -586,7 +585,7 @@ export const Main: React.FC<Props> = (props) => {
586585
}
587586

588587
let current_history: string[] | undefined
589-
if (current_prompt_type == 'ask-about-context') {
588+
if (current_prompt_type == 'ask-about-files') {
590589
current_history = ask_history
591590
} else if (current_prompt_type == 'edit-files') {
592591
current_history = edit_history

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export const MainView: React.FC<Props> = (props) => {
157157
(props.mode == MODE.API && props.api_prompt_type == 'edit-files')
158158

159159
const is_in_ask_about_context_prompt_type =
160-
props.mode == MODE.WEB && props.web_prompt_type == 'ask-about-context'
160+
props.mode == MODE.WEB && props.web_prompt_type == 'ask-about-files'
161161

162162
const is_in_code_completions_prompt_type =
163163
(props.mode == MODE.WEB && props.web_prompt_type == 'code-at-cursor') ||

‎apps/editor/src/views/panel/frontend/Main/MainView/prompt-type-labels.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ApiPromptType, WebPromptType } from '@shared/types/prompt-types'
22

33
export const web_prompt_type_labels: Record<WebPromptType, string> = {
44
'edit-files': 'Edit files',
5-
'ask-about-context': 'Ask about context',
5+
'ask-about-files': 'Ask about files',
66
'code-at-cursor': 'Code at cursor',
77
'find-relevant-files': 'Find relevant files',
88
'without-files': 'Without files'

‎apps/editor/src/views/panel/frontend/Panel.tsx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export const Panel = () => {
200200
}
201201
const prompt_type = mode == MODE.WEB ? web_prompt_type : api_prompt_type
202202

203-
if (prompt_type == 'ask-about-context') {
203+
if (prompt_type == 'ask-about-files') {
204204
state = ask_about_context_instructions
205205
} else if (prompt_type == 'edit-files') {
206206
state = edit_context_instructions
@@ -217,8 +217,7 @@ export const Panel = () => {
217217

218218
const get_current_instructions_state = () => {
219219
const prompt_type = mode == MODE.WEB ? web_prompt_type : api_prompt_type
220-
if (prompt_type == 'ask-about-context')
221-
return ask_about_context_instructions
220+
if (prompt_type == 'ask-about-files') return ask_about_context_instructions
222221
if (prompt_type == 'edit-files') return edit_context_instructions
223222
if (prompt_type == 'without-files') return no_context_instructions
224223
if (prompt_type == 'code-at-cursor') return code_at_cursor_instructions

0 commit comments

Comments
 (0)