Skip to content

Commit

Permalink
UX: minor improvements to LLM page and admin tables (#1034)
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomerobot authored Dec 19, 2024
1 parent a4033e2 commit ac705b6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 18 deletions.
24 changes: 8 additions & 16 deletions assets/javascripts/discourse/components/ai-llms-list-editor.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,17 @@ export default class AiLlmsListEditor extends Component {
@llmTemplate={{@llmTemplate}}
/>
{{else}}
<DPageSubheader
@titleLabel={{i18n "discourse_ai.llms.short_title"}}
@descriptionLabel={{i18n
"discourse_ai.llms.preconfigured.description"
}}
@learnMoreUrl="https://meta.discourse.org/t/discourse-ai-large-language-model-llm-settings-page/319903"
/>
{{#if this.hasLlmElements}}
<section class="ai-llms-list-editor__configured">
<DPageSubheader
@titleLabel={{i18n "discourse_ai.llms.configured.title"}}
@descriptionLabel={{i18n
"discourse_ai.llms.preconfigured.description"
}}
@learnMoreUrl="https://meta.discourse.org/t/discourse-ai-large-language-model-llm-settings-page/319903"
/>
<table class="d-admin-table">
<thead>
Expand Down Expand Up @@ -185,18 +188,7 @@ export default class AiLlmsListEditor extends Component {
</section>
{{/if}}
<section class="ai-llms-list-editor__templates">
<DPageSubheader
@titleLabel={{i18n this.preconfiguredTitle}}
@descriptionLabel={{unless
this.hasLlmElements
(i18n "discourse_ai.llms.preconfigured.description")
}}
@learnMoreUrl={{unless
this.hasLlmElements
"https://meta.discourse.org/t/discourse-ai-large-language-model-llm-settings-page/319903"
}}
/>

<DPageSubheader @titleLabel={{i18n this.preconfiguredTitle}} />
<AdminSectionLandingWrapper
class="ai-llms-list-editor__templates-list"
>
Expand Down
34 changes: 32 additions & 2 deletions assets/stylesheets/modules/llms/common/ai-llms-editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
margin: 0 0 1em 0;
}

&__configured + &__templates {
margin-top: 3em;
&__configured,
&__templates {
margin-top: 2em;
}
}

Expand Down Expand Up @@ -66,12 +67,41 @@
}
}

.ai-llms-list-editor__configured,
.ai-llms-list-editor__templates {
h2 {
font-size: var(--font-up-1);
}
}

.ai-llms-list-editor__configured {
.d-toggle-switch {
justify-content: center;
}
}

.ai-tool-list-editor__current,
.ai-persona-list-editor__current,
.ai-llms-list-editor__configured {
.d-admin-table {
tr:hover {
background: inherit;
}
th,
td {
&:first-child {
padding-left: 0;
}
}
th,
td {
&:last-child {
padding-right: 0;
}
}
}
}

.ai-llms-list-editor__templates {
&-list {
display: grid;
Expand Down

0 comments on commit ac705b6

Please sign in to comment.