Skip to content

Commit cc26d41

Browse files
committed
Remove custom open external URL handler and use standard anchor links
- there is no need to use backed to open external links from frontend - restore 'open website', keep opening urls via 'href' [Changes] - opening websites (parsed markdowns) from symbols stopped working [Changes] - [Pasted text] should be required prop
1 parent da04b7c commit cc26d41

20 files changed

Lines changed: 14 additions & 108 deletions

File tree

‎apps/editor/src/views/prompt/backend/message-handlers/handle-open-external-url.ts‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export * from './handle-delete-task'
5454
export * from './handle-preview-generated-code'
5555
export * from './handle-cancel-intelligent-update-file-in-preview'
5656
export * from './handle-open-file-and-select'
57-
export * from './handle-open-external-url'
5857
export * from './handle-save-prompt-image'
5958
export * from './handle-open-prompt-image'
6059
export * from './handle-save-prompt-pasted-text'

‎apps/editor/src/views/prompt/backend/prompt-view-provider.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ import {
6767
handle_delete_task,
6868
handle_cancel_patch_repair_file_in_preview as handle_cancel_patch_repair_file_in_preview,
6969
handle_open_file_and_select,
70-
handle_open_external_url,
7170
handle_hash_sign_quick_pick,
7271
handle_save_prompt_image,
7372
handle_open_prompt_image,
@@ -825,8 +824,6 @@ export class PromptViewProvider implements vscode.WebviewViewProvider {
825824
await handle_preview_generated_code(message)
826825
} else if (message.command == 'UPDATE_FILE_PROGRESS') {
827826
// Handle the message internally instead of invoking a command
828-
} else if (message.command == 'OPEN_EXTERNAL_URL') {
829-
await handle_open_external_url(message)
830827
} else if (message.command == 'CREATE_API_CONFIGURATION') {
831828
await handle_create_api_configuration(this, message)
832829
} else if (message.command == 'UPDATE_API_CONFIGURATION') {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ type Props = {
6060
currently_open_file_text?: string
6161
on_pasted_lines_click: (path: string, start?: string, end?: string) => void
6262
are_keyboard_shortcuts_disabled: boolean
63-
on_open_url: (url: string) => void
6463
on_open_website: (url: string) => void
6564
on_paste_image: (base64_content: string) => void
6665
on_open_image: (hash: string) => void
@@ -678,7 +677,6 @@ export const Main: React.FC<Props> = (props) => {
678677
on_pasted_lines_click={props.on_pasted_lines_click}
679678
currently_open_file_text={props.currently_open_file_text}
680679
are_keyboard_shortcuts_disabled={props.are_keyboard_shortcuts_disabled}
681-
on_open_url={props.on_open_url}
682680
on_open_website={props.on_open_website}
683681
on_paste_image={props.on_paste_image}
684682
on_open_image={props.on_open_image}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ type Props = {
117117
currently_open_file_text?: string
118118
on_go_to_file: (file_path: string) => void
119119
on_pasted_lines_click: (path: string, start?: string, end?: string) => void
120-
on_open_url: (url: string) => void
121120
on_open_website: (url: string) => void
122121
are_keyboard_shortcuts_disabled: boolean
123122
on_paste_image: (base64_content: string) => void
@@ -473,7 +472,6 @@ export const MainView: React.FC<Props> = (props) => {
473472
selected_files={props.selected_files}
474473
on_go_to_file={props.on_go_to_file}
475474
on_pasted_lines_click={props.on_pasted_lines_click}
476-
on_open_url={props.on_open_url}
477475
on_open_website={props.on_open_website}
478476
target={props.target}
479477
on_target_change={(target) => props.on_target_change(target)}

‎apps/editor/src/views/prompt/frontend/Prompt.tsx‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,6 @@ export const Prompt = () => {
243243
})
244244
}
245245

246-
const handle_open_url = (url: string) => {
247-
post_message(vscode, {
248-
command: 'OPEN_EXTERNAL_URL',
249-
url
250-
})
251-
}
252-
253246
const handle_open_website = (url: string) => {
254247
post_message(vscode, {
255248
command: 'OPEN_WEBSITE',
@@ -369,7 +362,6 @@ export const Prompt = () => {
369362
send_with_shift_enter={send_with_shift_enter}
370363
on_pasted_lines_click={handle_pasted_lines_click}
371364
currently_open_file_text={currently_open_file_text}
372-
on_open_url={handle_open_url}
373365
on_open_website={handle_open_website}
374366
on_paste_image={handle_paste_image}
375367
on_open_image={handle_open_image}

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,11 +461,6 @@ export interface UpdateFileProgressMessage extends BaseMessage {
461461
apply_tokens_per_second?: number
462462
}
463463

464-
export interface OpenExternalUrlMessage extends BaseMessage {
465-
command: 'OPEN_EXTERNAL_URL'
466-
url: string
467-
}
468-
469464
export interface OpenWebsiteMessage extends BaseMessage {
470465
command: 'OPEN_WEBSITE'
471466
url: string
@@ -680,7 +675,6 @@ export type FrontendMessage =
680675
| DeleteTaskMessage
681676
| PreviewGeneratedCodeMessage
682677
| UpdateFileProgressMessage
683-
| OpenExternalUrlMessage
684678
| CreateApiConfigurationMessage
685679
| DeleteApiConfigurationMessage
686680
| SavePromptImageMessage

‎apps/editor/src/views/settings/backend/message-handlers/handle-open-external-url.ts‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎apps/editor/src/views/settings/backend/message-handlers/index.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export * from './handle-get-send-with-shift-enter'
2929
export * from './handle-update-send-with-shift-enter'
3030
export * from './handle-get-api-configurations'
3131
export * from './handle-open-keybindings'
32-
export * from './handle-open-external-url'
3332
export * from './handle-delete-web-configuration'
3433
export * from './handle-reorder-web-configurations'
3534
export * from './handle-create-web-configuration'

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import {
3131
handle_open_ignore_patterns_settings,
3232
handle_open_allow_patterns_settings,
3333
handle_open_keybindings,
34-
handle_open_external_url,
3534
handle_delete_web_configuration,
3635
handle_reorder_web_configurations,
3736
handle_create_web_configuration,
@@ -263,8 +262,6 @@ export class SettingsViewProvider {
263262
await handle_open_allow_patterns_settings()
264263
} else if (message.command == 'OPEN_KEYBINDINGS') {
265264
await handle_open_keybindings(message)
266-
} else if (message.command == 'OPEN_EXTERNAL_URL') {
267-
await handle_open_external_url(message)
268265
} else if (message.command == 'GET_CLI_CONFIGURATIONS') {
269266
this._send_cli_configurations()
270267
} else if (message.command == 'CREATE_CLI_CONFIGURATION') {

0 commit comments

Comments
 (0)