Skip to content

Commit 7e3f7e3

Browse files
committed
Remove url property from apply response messages and related types
- should not pass chat url from the browser and display it in response preview ├── apps │ ├── browser │ │ └── src │ │ ├── background │ │ │ └── message-handler.ts │ │ ├── content-scripts │ │ │ └── send-prompt-content-script │ │ │ └── utils │ │ │ └── add-apply-response-button.ts │ │ └── types │ │ └── messages.ts │ └── editor │ └── src │ ├── commands │ │ ├── apply-response-command │ │ │ ├── apply-response-command.ts │ │ │ ├── response-processor.ts │ │ │ └── utils │ │ │ ├── preview │ │ │ │ └── preview.ts │ │ │ └── preview-handler.ts │ │ └── history-command │ │ └── actions │ │ └── restore-checkpoint.ts │ ├── services │ │ ├── websocket-manager.ts │ │ └── websocket-server-process.ts │ └── views │ └── prompt │ ├── backend │ │ └── message-handlers │ │ └── handle-apply-response-from-history.ts │ ├── frontend │ │ ├── Prompt.tsx │ │ └── hooks │ │ ├── use-preview-manager.ts │ │ └── use-response-history.ts │ └── types │ └── messages.ts └── packages └── shared └── src └── types ├── response-history-item.ts └── websocket-message.ts
1 parent 9ee38c1 commit 7e3f7e3

15 files changed

Lines changed: 3 additions & 32 deletions

File tree

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,7 @@ export const setup_message_listeners = () => {
204204
send_message_to_server({
205205
action: 'apply-response',
206206
client_id: message.client_id,
207-
raw_instructions: message.raw_instructions,
208-
url: message.url
207+
raw_instructions: message.raw_instructions
209208
} as ApplyResponseMessage)
210209
} else if (message.action == 'finished-responding') {
211210
if (sender.tab?.id && sender.tab.id == last_opened_tab_id) {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ export function add_apply_response_button(params: {
5555
browser.runtime.sendMessage<Message>({
5656
action: 'apply-response',
5757
client_id,
58-
raw_instructions,
59-
url: window.location.href
58+
raw_instructions
6059
})
6160
})
6261
})

‎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-
url?: string
109
}
1110

1211
type FinishedRespondingMessage = {

‎apps/editor/src/commands/apply-response-command/apply-response-command.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ export const apply_response_command = (params: {
222222
response,
223223
raw_instructions: args?.raw_instructions,
224224
created_at: Date.now(),
225-
url: args?.url,
226225
recent_api_configuration: args?.recent_api_configuration,
227226
is_not_looked_at: true
228227
}
@@ -475,7 +474,6 @@ export const apply_response_command = (params: {
475474
lines_added: total_lines_added,
476475
lines_removed: total_lines_removed,
477476
files: files_for_history,
478-
url: args?.url,
479477
recent_api_configuration: args?.recent_api_configuration
480478
}
481479

@@ -500,7 +498,6 @@ export const apply_response_command = (params: {
500498
original_editor_state: args?.original_editor_state,
501499
raw_instructions: args?.raw_instructions,
502500
created_at: created_at_for_preview,
503-
url: args?.url,
504501
recent_api_configuration: args?.recent_api_configuration,
505502
is_code_at_cursor
506503
})

‎apps/editor/src/commands/apply-response-command/response-processor.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export type ApplyResponseCommandArgs = {
4444
}
4545
files_with_content?: FileInPreview[]
4646
created_at?: number
47-
url?: string
4847
recent_api_configuration?: RecentApiConfiguration
4948
}
5049

‎apps/editor/src/commands/apply-response-command/utils/preview-handler.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export const preview_handler = async (params: {
2525
}
2626
raw_instructions?: string
2727
created_at?: number
28-
url?: string
2928
recent_api_configuration?: RecentApiConfiguration
3029
is_code_at_cursor?: boolean
3130
}): Promise<boolean> => {
@@ -42,7 +41,6 @@ export const preview_handler = async (params: {
4241
chat_response: params.chat_response,
4342
extension_context: params.extension_context,
4443
created_at: params.created_at,
45-
url: params.url,
4644
recent_api_configuration: params.recent_api_configuration,
4745
workspace_provider: params.workspace_provider
4846
})

‎apps/editor/src/commands/apply-response-command/utils/preview/preview.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export const preview = async (params: {
2222
chat_response: string
2323
extension_context: vscode.ExtensionContext
2424
created_at?: number
25-
url?: string
2625
recent_api_configuration?: RecentApiConfiguration
2726
workspace_provider: WorkspaceProvider
2827
}): Promise<{
@@ -132,7 +131,6 @@ export const preview = async (params: {
132131
items: items_for_preview,
133132
raw_instructions: params.raw_instructions,
134133
created_at: params.created_at,
135-
url: params.url,
136134
recent_api_configuration: params.recent_api_configuration
137135
})
138136
}

‎apps/editor/src/commands/history-command/actions/restore-checkpoint.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,6 @@ export const restore_checkpoint = async (params: {
514514
raw_instructions: item_to_preview.raw_instructions,
515515
files_with_content: item_to_preview.files,
516516
created_at: item_to_preview.created_at,
517-
url: item_to_preview.url,
518517
recent_api_configuration: item_to_preview.recent_api_configuration
519518
})
520519
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,7 @@ export class WebSocketManager {
207207
} else if (message.action == 'apply-response') {
208208
const apply_msg = message as ApplyResponseMessage
209209
vscode.commands.executeCommand('codeWebChat.applyResponse', {
210-
raw_instructions: apply_msg.raw_instructions,
211-
url: apply_msg.url
210+
raw_instructions: apply_msg.raw_instructions
212211
} as ApplyResponseCommandArgs)
213212
}
214213
} catch (error) {

‎apps/editor/src/views/prompt/backend/message-handlers/handle-apply-response-from-history.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export const handle_apply_response_from_history = async (
99
raw_instructions: message.raw_instructions,
1010
files_with_content: message.files,
1111
created_at: message.created_at,
12-
url: message.url,
1312
recent_api_configuration: message.recent_api_configuration
1413
})
1514
}

0 commit comments

Comments
 (0)