Skip to content

Commit 917564b

Browse files
committed
Refactor message handlers to group configuration handlers into a configurations subdirectory
- place selected handlers in `apps/editor/src/views/prompt/backend/message-handlers/configurations` - move `apps/editor/src/views/prompt/backend/message-handlers/handle-agentic-search/handle-agentic-search.ts` to `apps/editor/src/views/prompt/backend/message-handlers` - move `apps/editor/src/views/prompt/backend/message-handlers/handle-at-sign-quick-pick/handle-at-sign-quick-pick.ts` to `apps/editor/src/views/prompt/backend/message-handlers` - updating last used web configuration should be a util so that `apps/editor/src/views/prompt/backend/message-handlers/handle-autofill.ts`doesn't call another handle - create index.ts in `apps/editor/src/views/prompt/backend/message-handlers/configurations`, fix imports in `apps/editor/src/views/prompt/backend/prompt-view-provider.ts` └── apps └── editor └── src └── views └── prompt └── backend ├── message-handlers │ ├── configurations │ │ ├── handle-create-api-configuration.ts │ │ ├── handle-create-cli-configuration.ts │ │ ├── handle-create-web-configuration.ts │ │ ├── handle-delete-api-configuration.ts │ │ ├── handle-delete-cli-configuration.ts │ │ ├── handle-delete-web-configuration.ts │ │ ├── handle-get-api-configurations.ts │ │ ├── handle-pick-api-model.ts │ │ ├── handle-pick-api-reasoning-effort.ts │ │ ├── handle-pick-chatbot.ts │ │ ├── handle-pick-model.ts │ │ ├── handle-pick-provider.ts │ │ ├── handle-pick-reasoning-effort.ts │ │ ├── handle-reorder-api-configurations.ts │ │ ├── handle-reorder-cli-configurations.ts │ │ ├── handle-reorder-web-configurations.ts │ │ ├── handle-toggle-pinned-api-configuration.ts │ │ ├── handle-toggle-pinned-cli-configuration.ts │ │ ├── handle-toggle-pinned-web-configuration.ts │ │ ├── handle-update-api-configuration.ts │ │ ├── handle-update-cli-configuration.ts │ │ ├── handle-update-last-used-web-configuration.ts │ │ ├── handle-update-web-configuration.ts │ │ └── index.ts │ ├── handle-agentic-search.ts │ ├── handle-autofill.ts │ ├── index.ts │ └── utils │ ├── build-cli-prompt.ts │ ├── build-prompt-payload.ts │ ├── patch-repair-utils.ts │ └── update-last-used-web-configuration.ts └── prompt-view-provider.ts
1 parent 3d7f239 commit 917564b

33 files changed

Lines changed: 99 additions & 77 deletions

apps/editor/src/views/prompt/backend/message-handlers/handle-create-api-configuration.ts renamed to apps/editor/src/views/prompt/backend/message-handlers/configurations/handle-create-api-configuration.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { PromptViewProvider } from '../prompt-view-provider'
1+
import { PromptViewProvider } from '../../prompt-view-provider'
22
import { create } from '@/views/shared/actions/api/create/create'
33
import { get_api_configuration_id } from '@/services/providers-manager'
4-
import { CreateApiConfigurationMessage } from '../../types/messages'
4+
import { CreateApiConfigurationMessage } from '../../../types/messages'
55

66
export const handle_create_api_configuration = async (
77
provider: PromptViewProvider,
@@ -24,4 +24,4 @@ export const handle_create_api_configuration = async (
2424
api_prompt_type: message.api_prompt_type
2525
})
2626
}
27-
}
27+
}

apps/editor/src/views/prompt/backend/message-handlers/handle-create-cli-configuration.ts renamed to apps/editor/src/views/prompt/backend/message-handlers/configurations/handle-create-cli-configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { config_cli_configuration_to_ui_format } from '@/utils/cli-configuration-format-converters'
2-
import { PromptViewProvider } from '../prompt-view-provider'
2+
import { PromptViewProvider } from '../../prompt-view-provider'
33
import { create } from '@/views/shared/actions/agent/create'
44

55
export const handle_create_cli_configuration = async (

apps/editor/src/views/prompt/backend/message-handlers/handle-create-web-configuration.ts renamed to apps/editor/src/views/prompt/backend/message-handlers/configurations/handle-create-web-configuration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { config_web_configuration_to_ui_format } from '@/utils/web-configuration-format-converters'
2-
import { PromptViewProvider } from '../prompt-view-provider'
2+
import { PromptViewProvider } from '../../prompt-view-provider'
33
import { create } from '@/views/shared/actions/web/create'
44

55
export const handle_create_web_configuration = async (
@@ -18,4 +18,4 @@ export const handle_create_web_configuration = async (
1818
insertion_index: result.insertion_index
1919
})
2020
}
21-
}
21+
}

apps/editor/src/views/prompt/backend/message-handlers/handle-delete-api-configuration.ts renamed to apps/editor/src/views/prompt/backend/message-handlers/configurations/handle-delete-api-configuration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PromptViewProvider } from '../prompt-view-provider'
1+
import { PromptViewProvider } from '../../prompt-view-provider'
22
import { remove } from '@/views/shared/actions/api/delete'
33

44
export const handle_delete_api_configuration = async (
@@ -9,4 +9,4 @@ export const handle_delete_api_configuration = async (
99
extension_context: provider.extension_context,
1010
api_configuration_id: message.api_configuration_id
1111
})
12-
}
12+
}

apps/editor/src/views/prompt/backend/message-handlers/handle-delete-cli-configuration.ts renamed to apps/editor/src/views/prompt/backend/message-handlers/configurations/handle-delete-cli-configuration.ts

File renamed without changes.

apps/editor/src/views/prompt/backend/message-handlers/handle-delete-web-configuration.ts renamed to apps/editor/src/views/prompt/backend/message-handlers/configurations/handle-delete-web-configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ export const handle_delete_web_configuration = async (
55
message: DeleteWebConfigurationMessage
66
): Promise<void> => {
77
await remove({ name: message.name })
8-
}
8+
}

apps/editor/src/views/prompt/backend/message-handlers/handle-get-api-configurations.ts renamed to apps/editor/src/views/prompt/backend/message-handlers/configurations/handle-get-api-configurations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ export const handle_get_api_configurations = async (
2626
command: 'API_CONFIGURATIONS',
2727
configurations
2828
})
29-
}
29+
}

apps/editor/src/views/prompt/backend/message-handlers/handle-pick-api-model.ts renamed to apps/editor/src/views/prompt/backend/message-handlers/configurations/handle-pick-api-model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ export const handle_pick_api_model = async (
3131
model_id: new_model
3232
})
3333
}
34-
}
34+
}

apps/editor/src/views/prompt/backend/message-handlers/handle-pick-api-reasoning-effort.ts renamed to apps/editor/src/views/prompt/backend/message-handlers/configurations/handle-pick-api-reasoning-effort.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ export const handle_pick_api_reasoning_effort = async (
6161
command: 'NEWLY_PICKED_API_REASONING_EFFORT',
6262
effort: new_effort === null ? undefined : (new_effort as string)
6363
})
64-
}
64+
}

apps/editor/src/views/prompt/backend/message-handlers/handle-pick-chatbot.ts renamed to apps/editor/src/views/prompt/backend/message-handlers/configurations/handle-pick-chatbot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ export const handle_pick_chatbot = async (
1515
chatbot_id: selected
1616
})
1717
}
18-
}
18+
}

0 commit comments

Comments
 (0)