Skip to content

Commit 2933052

Browse files
committed
Replace image symbol error style with disabled state for web targets
- when image symbol is not supported in 'web' it should not be red, but of disabled opacity ├── apps │ └── editor │ └── src │ └── views │ └── prompt │ └── frontend │ ├── Main │ │ ├── Main.tsx │ │ └── MainView │ │ └── MainView.tsx │ └── Prompt.tsx └── packages └── ui └── src ├── components │ └── editor │ └── common │ └── prompts │ ├── PromptField │ │ ├── PromptField.stories.tsx │ │ ├── PromptField.tsx │ │ ├── components │ │ │ ├── CompletedTasks │ │ │ │ └── CompletedTasks.tsx │ │ │ └── Footer │ │ │ └── Footer.tsx │ │ └── hooks │ │ └── use-handlers │ │ └── handle-input-click.ts │ ├── Template │ │ └── Template.tsx │ └── shared │ └── symbols │ ├── get-highlighted-text.tsx │ ├── position-mapping.ts │ └── prompt-symbols.module.scss └── styles └── foundation └── _variables.scss
1 parent 2f49417 commit 2933052

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎packages/ui/src/components/editor/common/prompts/shared/symbols/get-highlighted-text.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ export const get_highlighted_text = (params: {
196196
const image_match = part.match(/^#Image\(([a-fA-F0-9]+)\)$/)
197197
if (part && image_match) {
198198
const hash = image_match[1]
199-
const is_warning = params.is_web_target
199+
const is_disabled = params.is_web_target
200200
return `<span class="${cn(styles['symbol'], styles['symbol--image'], {
201-
[styles['symbol--error']]: is_warning,
201+
[styles['symbol--disabled']]: is_disabled,
202202
[styles['symbol--non-interactive']]: !interactive_text
203203
})}" data-type="image-symbol" data-hash="${hash}"${
204-
is_warning
204+
is_disabled
205205
? ' title="The prompt autofill feature can\'t handle images.\nUpload in chatbot or use API with a multimodal model."'
206206
: ''
207207
}><span class="${

‎packages/ui/src/components/editor/common/prompts/shared/symbols/prompt-symbols.module.scss‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@
252252
);
253253
}
254254

255+
&--disabled {
256+
opacity: var(--disabled-opacity);
257+
}
258+
255259
&--non-interactive &__text {
256260
cursor: text !important;
257261

0 commit comments

Comments
 (0)