Skip to content

Commit ae00a71

Browse files
committed
Remove the obsolete edit_format field from message types, handlers, and content scripts
- remove passing 'edit format' to the browser and back
1 parent 6b4536f commit ae00a71

8 files changed

Lines changed: 2 additions & 20 deletions

File tree

‎apps/browser/src/background/message-handler.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ export const setup_message_listeners = () => {
182182
action: 'apply-response',
183183
client_id: message.client_id,
184184
raw_instructions: message.raw_instructions,
185-
edit_format: message.edit_format,
186185
url: message.url
187186
} as ApplyResponseMessage)
188187
} else if (message.action == 'finished-responding') {

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ const main = async () => {
197197
current_chat: Chat
198198
client_id: number
199199
raw_instructions?: string
200-
edit_format?: string
201200
prompt_type?:
202201
| 'ask-about-files'
203202
| 'edit-files'
@@ -244,14 +243,12 @@ const main = async () => {
244243
JSON.stringify({
245244
client_id: stored_data.client_id,
246245
raw_instructions: stored_data.raw_instructions,
247-
edit_format: stored_data.edit_format,
248246
inject_button
249247
})
250248
)
251249
chatbot.setup_observer({
252250
client_id: stored_data.client_id,
253251
raw_instructions: stored_data.raw_instructions,
254-
edit_format: stored_data.edit_format,
255252
inject_button
256253
})
257254
} else {
@@ -266,7 +263,6 @@ const main = async () => {
266263
chatbot.setup_observer({
267264
client_id: session_data.client_id,
268265
raw_instructions: session_data.raw_instructions,
269-
edit_format: session_data.edit_format,
270266
inject_button: session_data.inject_button ?? true
271267
})
272268
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export type Chatbot = {
1212
setup_observer?: (params: {
1313
client_id: number
1414
raw_instructions?: string
15-
edit_format?: string
1615
inject_button: boolean
1716
}) => void
1817
enter_message?: (params: { message: string }) => Promise<void>

‎apps/browser/src/content-scripts/send-prompt-content-script/utils/add-apply-response-button.ts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { show_response_ready_notification } from './show-response-ready-notifica
1212
export function add_apply_response_button(params: {
1313
client_id: number
1414
raw_instructions?: string
15-
edit_format?: string
1615
footer: Element
1716
get_chat_turn: (footer: Element) => HTMLElement | null
1817
get_code_from_block?: (code_block: Element) => string | null | undefined
@@ -51,7 +50,6 @@ export function add_apply_response_button(params: {
5150

5251
let client_id = params.client_id
5352
let raw_instructions = params.raw_instructions
54-
let edit_format = params.edit_format
5553

5654
try {
5755
const session_data_str = sessionStorage.getItem('cwc-session-data')
@@ -60,7 +58,6 @@ export function add_apply_response_button(params: {
6058
if (session_data.client_id !== undefined) {
6159
client_id = session_data.client_id
6260
raw_instructions = session_data.raw_instructions
63-
edit_format = session_data.edit_format
6461
}
6562
}
6663
} catch (error) {
@@ -71,7 +68,6 @@ export function add_apply_response_button(params: {
7168
action: 'apply-response',
7269
client_id,
7370
raw_instructions,
74-
edit_format,
7571
url: window.location.href
7672
})
7773
})

‎apps/browser/src/types/messages.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ type ApplyResponseMessage = {
66
action: 'apply-response'
77
client_id: number
88
raw_instructions?: string
9-
edit_format?: string
109
url?: string
1110
}
1211

‎apps/editor/src/services/websocket-manager.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import { ApplyResponseCommandArgs } from '@/commands/apply-response-command/resp
2020
import { WebPromptType } from '@shared/types/prompt-types'
2121

2222
/**
23-
* Bridges the current workspace window and websocket server that runs in a separate process.
23+
* Bridges the current workspace window and a WebSockets server
24+
* that runs in a separate process.
2425
*/
2526
export class WebSocketManager {
2627
private extension_context: vscode.ExtensionContext
@@ -355,7 +356,6 @@ export class WebSocketManager {
355356
text: string
356357
web_configuration_name: string
357358
raw_instructions?: string
358-
edit_format?: string
359359
prompt_type?: WebPromptType
360360
invocation_count: number
361361
}): Promise<boolean> {
@@ -449,7 +449,6 @@ export class WebSocketManager {
449449
options: web_configuration.options,
450450
client_id: this.client_id || 0, // 0 is a temporary fallback and should be removed few weeks from 28.03.25
451451
raw_instructions: params.raw_instructions,
452-
edit_format: params.edit_format,
453452
prompt_type: params.prompt_type,
454453
reuse_last_tab,
455454
invocation_count: params.invocation_count

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,6 @@ export const handle_autofill = async (params: {
209209
web_configuration_name: resolved_web_configuration_name,
210210
raw_instructions: current_instructions,
211211
prompt_type: params.panel_view_provider.web_prompt_type,
212-
edit_format:
213-
params.panel_view_provider.web_prompt_type == 'edit-files'
214-
? params.panel_view_provider.chat_edit_format
215-
: undefined,
216212
invocation_count: params.invocation_count
217213
}
218214
)

‎packages/shared/src/types/websocket-message.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export type InitializeChatMessage = {
3131
system_instructions?: string
3232
options?: string[]
3333
raw_instructions?: string
34-
edit_format?: string
3534
prompt_type?: WebPromptType
3635
reuse_last_tab?: boolean
3736
invocation_count?: number
@@ -46,7 +45,6 @@ export type ApplyResponseMessage = {
4645
action: 'apply-response'
4746
client_id: number
4847
raw_instructions?: string
49-
edit_format?: string
5048
url?: string
5149
}
5250

0 commit comments

Comments
 (0)