Skip to content

Commit f23ac25

Browse files
committed
Refactor prompt field properties and streamline layout structure
- remove 'copy prompt' from 'api' target - in api target, edit prompt type, when missing configuration, should not show 'attaching X files' notice - 'prompt field' should work without being aware of the current prompt type - in api target, submitting should be disabled when there are no api configurations - show 'missing configuration' warning also when there are no web configurations - show warnings independently allowing showing more at once, don't use loops for it to not break border radius that should be only on last notice - when not showing 'empty context' warning, should show 'attaching X files...' notice - not last notice should not have border radius - show empty context/attaching... above the eventual 'missing configuration' - dont't show 'missing configuration' warning, simplify as necessary, as we only show either one context related prompt notice - 'preview prompt' should only be disabled in 'edit' when context is empty. - submitting in API target should never be disabled, even if there are no api configurations - don't show [Image] when in web target and being not connected - move UiBrowserExtensionMessage - in `apps/editor/src/views/prompt/frontend/Main/MainView/MainView.tsx` wrap everyting in .container - in `apps/editor/src/views/prompt/frontend/Main/MainView/MainView.tsx` wrap everyting in scrollable in div.container - remove -container suffix from [Pasted text] ├── apps │ └── editor │ └── src │ └── views │ └── prompt │ └── frontend │ └── Main │ └── MainView │ ├── MainView.module.scss │ └── MainView.tsx └── packages └── ui └── src └── components └── editor ├── common │ └── prompts │ ├── PromptField │ │ ├── PromptField.module.scss │ │ ├── PromptField.stories.tsx │ │ ├── PromptField.tsx │ │ ├── hooks │ │ │ ├── use-drag-drop.ts │ │ │ ├── use-dropdown.ts │ │ │ ├── use-ghost-text.ts │ │ │ ├── use-handlers │ │ │ │ ├── handle-copy.ts │ │ │ │ ├── handle-cut.ts │ │ │ │ ├── handle-input-change.ts │ │ │ │ ├── handle-input-click.ts │ │ │ │ ├── handle-key-down.ts │ │ │ │ ├── handle-paste.ts │ │ │ │ ├── handle-submit.ts │ │ │ │ ├── index.ts │ │ │ │ ├── types.ts │ │ │ │ ├── use-handlers.ts │ │ │ │ └── utils.ts │ │ │ └── use-keyboard-shortcuts.ts │ │ └── index.ts │ ├── Template │ │ ├── Template.module.scss │ │ ├── Template.tsx │ │ └── index.ts │ └── shared │ └── symbols │ ├── caret.ts │ ├── get-highlighted-text.tsx │ ├── index.ts │ ├── position-mapping.ts │ ├── prompt-symbols.module.scss │ ├── reconstruct-raw-value.ts │ └── use-symbol-deletion.ts ├── prompt │ ├── BrowserExtensionMessage │ │ ├── BrowserExtensionMessage.module.scss │ │ ├── BrowserExtensionMessage.stories.tsx │ │ ├── BrowserExtensionMessage.tsx │ │ └── index.ts │ └── PromptNotice │ ├── PromptNotice.module.scss │ └── PromptNotice.tsx └── settings └── Notice └── Notice.tsx
1 parent afe169a commit f23ac25

12 files changed

Lines changed: 286 additions & 279 deletions

File tree

‎apps/editor/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,11 +1040,11 @@
10401040
"default": [
10411041
{
10421042
"name": "(0)",
1043-
"chatbot": "Gemini"
1043+
"chatbot": "ChatGPT"
10441044
},
10451045
{
10461046
"name": "(1)",
1047-
"chatbot": "ChatGPT"
1047+
"chatbot": "Gemini"
10481048
},
10491049
{
10501050
"name": "(2)",

‎apps/editor/src/views/prompt/backend/message-handlers/handle-make-api-call.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
EDIT_FORMAT_INSTRUCTIONS_TRUNCATED,
3030
EDIT_FORMAT_INSTRUCTIONS_WHOLE
3131
} from '@/constants/edit-format-instructions'
32-
import { open_settings } from '@/views/settings/helpers/open-settings'
3332

3433
const get_last_used_config_id_key = () => {
3534
return LAST_USED_EDIT_FILES_CONFIG_ID_STATE_KEY
@@ -50,8 +49,6 @@ const get_api_configuration = async (params: {
5049
await params.model_providers_manager.get_api_configurations()
5150

5251
if (api_configurations.length == 0) {
53-
open_settings.api.api_configurations()
54-
vscode.window.showInformationMessage(t('common.no-configurations-found'))
5552
return
5653
}
5754

‎apps/editor/src/views/prompt/frontend/Main/MainView/MainView.module.scss‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
.chat-input-container {
1+
.container {
2+
padding: 4px 0 12px 0;
3+
4+
:global([data-modern-ui='true']) & {
5+
padding: 4px 0 10px 0;
6+
}
7+
}
8+
9+
.chat-input {
210
display: flex;
311
flex-direction: column;
412
gap: 6px;
@@ -8,3 +16,16 @@
816
margin: 0 10px;
917
}
1018
}
19+
20+
.notices {
21+
display: flex;
22+
flex-direction: column;
23+
border-bottom-left-radius: 6px;
24+
border-bottom-right-radius: 6px;
25+
overflow: hidden;
26+
margin: 0 20px;
27+
28+
:global([data-modern-ui='true']) & {
29+
margin: 0 18px;
30+
}
31+
}

0 commit comments

Comments
 (0)