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

Commit ce346b1

Browse files
committed
WIP
1 parent 5e0bed1 commit ce346b1

File tree

4 files changed

+62
-22
lines changed

4 files changed

+62
-22
lines changed

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

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { tracked } from "@glimmer/tracking";
33
import { action } from "@ember/object";
44
import { service } from "@ember/service";
55
import { htmlSafe } from "@ember/template";
6-
import { eq, gt } from "truth-helpers";
6+
import { eq } from "truth-helpers";
77
import BackButton from "discourse/components/back-button";
88
import Form from "discourse/components/form";
99
import { ajax } from "discourse/lib/ajax";
@@ -89,9 +89,8 @@ export default class AiFeatureEditor extends Component {
8989
const settingsMap = settings.map((setting) =>
9090
SiteSetting.create(setting)
9191
);
92-
this.settings = settingsMap;
9392

94-
console.log(this.settings);
93+
this.settings = settingsMap;
9594
} catch (error) {
9695
// eslint-disable-next-line no-console
9796
console.warn(`Failed to load settings with error: ${error}`);
@@ -110,7 +109,7 @@ export default class AiFeatureEditor extends Component {
110109
<p>{{@model.description}}</p>
111110
</section>
112111

113-
<Form
112+
{{!-- <Form
114113
@onSubmit={{this.save}}
115114
@data={{this.formData}}
116115
class="form-horizontal ai-feature-editor"
@@ -149,23 +148,23 @@ export default class AiFeatureEditor extends Component {
149148
</field.Select>
150149
</form.Field>
151150
152-
<form.Section
153-
@title={{i18n "discourse_ai.features.editor.advanced_settings"}}
154-
/>
155-
156151
<form.Actions>
157152
<form.Submit
158153
@label="discourse_ai.features.editor.save"
159154
@disabled={{this.isSaving}}
160155
/>
161156
</form.Actions>
162-
</Form>
163-
{{#unless this.isLoading}}
164-
{{#each this.settings as |setting|}}
165-
{{#if setting}}
166-
<SiteSettingComponent @setting={{setting}} />
167-
{{/if}}
168-
{{/each}}
169-
{{/unless}}
157+
</Form> --}}
158+
159+
<section class="ai-feature-editor__advanced-settings">
160+
<h3>{{i18n "discourse_ai.features.editor.advanced_settings"}}</h3>
161+
{{#unless this.isLoading}}
162+
{{#each this.settings as |setting|}}
163+
<div>
164+
<SiteSettingComponent @setting={{setting}} />
165+
</div>
166+
{{/each}}
167+
{{/unless}}
168+
</section>
170169
</template>
171170
}

assets/stylesheets/common/ai-features.scss

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,35 @@
3030
}
3131
}
3232
}
33+
34+
.ai-feature-editor__advanced-settings {
35+
margin-block: 1rem;
36+
padding-block: 1rem;
37+
38+
.setting {
39+
margin-block: 1.5rem;
40+
}
41+
42+
.setting-label {
43+
font-size: var(--font-down-1-rem);
44+
color: var(--primary-high);
45+
46+
a[title="View change history"],
47+
.history-icon {
48+
display: none;
49+
}
50+
}
51+
52+
.setting-value {
53+
.desc {
54+
font-size: var(--font-down-1-rem);
55+
color: var(--primary-high-or-secondary-low);
56+
}
57+
}
58+
59+
.setting-controls,
60+
.setting-controls__undo {
61+
font-size: var(--font-down-1-rem);
62+
margin-top: 0.5rem;
63+
}
64+
}

config/locales/server.en.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ en:
104104
ai_google_custom_search_api_key: "API key for the Google Custom Search API see: https://developers.google.com/custom-search"
105105
ai_google_custom_search_cx: "CX for Google Custom Search API"
106106

107+
ai_discord_app_id: "The ID of the Discord application you would like to connect Discord search to"
108+
ai_discord_app_public_key: "The public key of the Discord application you would like to connect Discord search to"
109+
ai_discord_search_mode: "Select the search mode to use for Discord search"
110+
ai_discord_search_persona: "The persona to use for Discord search."
111+
ai_discord_allowed_guilds: "Discord guilds (servers) where the bot is allowed to search"
112+
107113
reviewables:
108114
reasons:
109115
flagged_by_toxicity: The AI plugin flagged this after classifying it as toxic.

config/settings.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ discourse_ai:
235235
client: true
236236
validator: "DiscourseAi::Configuration::LlmDependencyValidator"
237237
hidden: true
238+
area: "ai-features/summarization"
238239
ai_summarization_model:
239240
default: ""
240241
allow_any: false
@@ -246,11 +247,12 @@ discourse_ai:
246247
default: "-11"
247248
type: enum
248249
enum: "DiscourseAi::Configuration::PersonaEnumerator"
249-
hidden: true
250+
area: "ai-features/summarization"
250251
ai_pm_summarization_allowed_groups:
251252
type: group_list
252253
list_type: compact
253254
default: ""
255+
area: "ai-features/summarization"
254256
ai_custom_summarization_allowed_groups: # Deprecated. TODO(roman): Remove 2025-09-01
255257
type: group_list
256258
list_type: compact
@@ -259,11 +261,12 @@ discourse_ai:
259261
ai_summary_gists_enabled:
260262
default: false
261263
hidden: true
264+
area: "ai-features/gists"
262265
ai_summary_gists_persona:
263266
default: "-12"
264267
type: enum
265268
enum: "DiscourseAi::Configuration::PersonaEnumerator"
266-
hidden: true
269+
area: "ai-features/gists"
267270
ai_summary_gists_allowed_groups: # Deprecated. TODO(roman): Remove 2025-09-01
268271
type: group_list
269272
list_type: compact
@@ -278,15 +281,15 @@ discourse_ai:
278281
default: 30
279282
min: 1
280283
max: 10000
281-
hidden: true
284+
area: "ai-features/summarization"
282285
ai_summary_backfill_maximum_topics_per_hour:
283286
default: 0
284287
min: 0
285288
max: 10000
286-
hidden: true
289+
area: "ai-features/summarization"
287290
ai_summary_backfill_minimum_word_count:
288291
default: 200
289-
hidden: true
292+
area: "ai-features/summarization"
290293

291294
ai_bot_enabled:
292295
default: false
@@ -329,9 +332,9 @@ discourse_ai:
329332
ai_bot_discover_persona:
330333
default: ""
331334
type: enum
332-
hidden: true
333335
client: true
334336
enum: "DiscourseAi::Configuration::PersonaEnumerator"
337+
area: "ai-features/discoveries"
335338
ai_automation_max_triage_per_minute:
336339
default: 60
337340
hidden: true

0 commit comments

Comments
 (0)