Skip to content

Build your personal knowledge base with Trilium Notes

feat(llm): illustrate the connection step with the provider's logo

Elian Doranc709215f78f8
diff --git a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.css b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.css
index 9ecb29ed9d..8cd6eb53ab 100644
--- a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.css
+++ b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.css
@@ -7,6 +7,21 @@
margin-bottom: 0;
}
+ /* The picked provider's logo introducing the connection step, following the
+ setup wizard's illustrations: one large centred mark, muted so it stays
+ decoration rather than competing with the fields below it. */
+ .add-provider-illustration {
+ display: flex;
+ justify-content: center;
+ margin-bottom: 1.25rem;
+ color: var(--muted-text-color);
+ opacity: 0.6;
+
+ .masked-icon {
+ --masked-icon-size: 80px;
+ }
+ }
+
/* Where the notes end up — the distinction the groups exist to draw. Sits at
the top of its group's card, ahead of the providers it qualifies. */
.add-provider-group-description {
diff --git a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx
index f1d812aba0..d7d54f017a 100644
--- a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx
+++ b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx
@@ -9,6 +9,7 @@ import { t } from "../../../../services/i18n";
import { Badge } from "../../../react/Badge";
import { Card, CardSection } from "../../../react/Card";
import FormTextBox from "../../../react/FormTextBox";
+import MaskedIcon from "../../../react/MaskedIcon";
import Modal from "../../../react/Modal";
import SelectableCard, { SelectableCardGrid } from "../../../react/SelectableCard";
import OptionsRow from "../components/OptionsRow";
@@ -332,36 +333,40 @@ export default function AddProviderModal({ show, onHidden, onSave, existingProvi
/>
))
) : step === "connection" ? (
- // A single unlabelled card of settings rows: the step holds a handful of
- // fields for one provider — already named in the modal title — so the
- // hairline between rows is all the structure it needs.
- <Card>
- <CardSection>
- {/* Self-hosted providers lead with the endpoint — the port is the
- detail that has to be right — and treat the key as optional. */}
- {baseUrlMode === "required" && baseUrlField}
- {usesApiKey && (
- <OptionsRow
- name="api-key"
- label={t("llm.api_key")}
- description={apiKeyMode === "optional" ? t("llm.api_key_optional_description") : undefined}
- stacked
- >
- <FormTextBox
- type="password"
- currentValue={apiKey}
- onChange={setApiKey}
- placeholder={t("llm.api_key_placeholder")}
- autoFocus={baseUrlMode !== "required"}
- />
- </OptionsRow>
- )}
- {baseUrlMode === "advanced" && baseUrlField}
- {!usesApiKey && baseUrlMode === "none" && (
- <p>{t("llm.claude_agent_description")}</p>
- )}
- </CardSection>
- </Card>
+ <>
+ {providerType && <ProviderIllustration providerType={providerType} />}
+
+ {/* A single unlabelled card of settings rows: the step holds a handful of
+ fields for one provider — already named in the modal title — so the
+ hairline between rows is all the structure it needs. */}
+ <Card>
+ <CardSection>
+ {/* Self-hosted providers lead with the endpoint — the port is the
+ detail that has to be right — and treat the key as optional. */}
+ {baseUrlMode === "required" && baseUrlField}
+ {usesApiKey && (
+ <OptionsRow
+ name="api-key"
+ label={t("llm.api_key")}
+ description={apiKeyMode === "optional" ? t("llm.api_key_optional_description") : undefined}
+ stacked
+ >
+ <FormTextBox
+ type="password"
+ currentValue={apiKey}
+ onChange={setApiKey}
+ placeholder={t("llm.api_key_placeholder")}
+ autoFocus={baseUrlMode !== "required"}
+ />
+ </OptionsRow>
+ )}
+ {baseUrlMode === "advanced" && baseUrlField}
+ {!usesApiKey && baseUrlMode === "none" && (
+ <p>{t("llm.claude_agent_description")}</p>
+ )}
+ </CardSection>
+ </Card>
+ </>
) : (
<Card heading={t("llm.select_models")}>
<CardSection>
@@ -383,6 +388,21 @@ export default function AddProviderModal({ show, onHidden, onSave, existingProvi
);
}
+/**
+ * The provider's own mark, above the fields it belongs to. Follows the setup
+ * wizard's illustrations — one large, centred, muted glyph introducing the page —
+ * except that here it is the logo of whatever was picked on the previous step, so
+ * the step opens by confirming *what* is being connected rather than with a bare
+ * text box.
+ */
+function ProviderIllustration({ providerType }: { providerType: ProviderType }) {
+ return (
+ <div className="add-provider-illustration">
+ <MaskedIcon url={providerType.iconUrl} />
+ </div>
+ );
+}
+
/**
* One group of the provider list, as its own card. The blurb sits inside the card
* above the choices, the way the settings pages place a section description, so it