Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit f66a294

Browse files
committed
switch to textarea, fix back button
1 parent 883e098 commit f66a294

File tree

2 files changed

+30
-13
lines changed

2 files changed

+30
-13
lines changed

assets/javascripts/discourse/components/ai-embedding-editor.gjs

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Component from "@glimmer/component";
22
import { tracked } from "@glimmer/tracking";
3-
import { Input } from "@ember/component";
3+
import { Input, Textarea } from "@ember/component";
44
import { concat, fn, get } from "@ember/helper";
55
import { on } from "@ember/modifier";
66
import { action, computed } from "@ember/object";
@@ -247,10 +247,17 @@ export default class AiEmbeddingEditor extends Component {
247247
</div>
248248

249249
{{else}}
250-
<div class="btn btn-flat back-button" {{on "click" this.resetForm}}>
251-
{{icon "chevron-left"}}
252-
{{i18n "back_button"}}
253-
</div>
250+
{{#if this.editingModel.isNew}}
251+
<div class="btn btn-flat back-button" {{on "click" this.resetForm}}>
252+
{{icon "chevron-left"}}
253+
{{i18n "back_button"}}
254+
</div>
255+
{{else}}
256+
<BackButton
257+
@route="adminPlugins.show.discourse-ai-embeddings"
258+
@label="discourse_ai.embeddings.back"
259+
/>
260+
{{/if}}
254261
<div class="control-group">
255262
<label>{{i18n "discourse_ai.embeddings.display_name"}}</label>
256263
<Input
@@ -332,9 +339,8 @@ export default class AiEmbeddingEditor extends Component {
332339
@type="checkbox"
333340
@checked={{this.editingModel.matryoshka_dimensions}}
334341
/>
335-
<label>{{i18n
336-
"discourse_ai.embeddings.matryoshka_dimensions"
337-
}}</label>
342+
<label>{{i18n "discourse_ai.embeddings.matryoshka_dimensions"}}
343+
</label>
338344
<DTooltip
339345
@icon="circle-question"
340346
@content={{i18n
@@ -345,10 +351,9 @@ export default class AiEmbeddingEditor extends Component {
345351

346352
<div class="control-group">
347353
<label>{{i18n "discourse_ai.embeddings.embed_prompt"}}</label>
348-
<Input
349-
@type="text"
350-
@value={{this.editingModel.embed_prompt}}
354+
<Textarea
351355
class="ai-embedding-editor-input ai-embedding-editor__embed_prompt"
356+
@value={{this.editingModel.embed_prompt}}
352357
/>
353358
<DTooltip
354359
@icon="circle-question"
@@ -358,8 +363,7 @@ export default class AiEmbeddingEditor extends Component {
358363

359364
<div class="control-group">
360365
<label>{{i18n "discourse_ai.embeddings.search_prompt"}}</label>
361-
<Input
362-
@type="text"
366+
<Textarea
363367
class="ai-embedding-editor-input ai-embedding-editor__search_prompt"
364368
@value={{this.editingModel.search_prompt}}
365369
/>

assets/stylesheets/modules/embeddings/common/ai-embedding-editor.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,17 @@
5858
.btn-flat.back-button {
5959
padding-left: 0;
6060
}
61+
62+
.fk-d-tooltip__icon {
63+
margin-left: 0.25em;
64+
color: var(--primary-medium);
65+
}
66+
67+
textarea + .fk-d-tooltip__trigger {
68+
vertical-align: top;
69+
}
70+
71+
.d-icon-circle-exclamation {
72+
color: var(--danger);
73+
}
6174
}

0 commit comments

Comments
 (0)