Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(llm): split the Antigravity connection description into paragraphs
Elian Doran96c1ef617a16
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex ba9a461a30..8037020cae 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -4048,7 +4048,7 @@"base_url_invalid": "Base URL must be a valid http:// or https:// URL","claude_agent_description": "Uses your Claude Pro/Max subscription through Claude Code, so no API key is needed. Claude Code must be installed on the machine running Trilium (the server when self-hosting, or this computer on desktop); sign in once by running \"claude /login\" there.","copilot_agent_description": "Uses your GitHub Copilot subscription through the GitHub Copilot CLI, so no API key is needed. The Copilot CLI must be installed on the machine running Trilium (the server when self-hosting, or this computer on desktop); sign in once by running \"copilot login\" there — an existing Copilot login from another editor is reused automatically.",- "antigravity_agent_description": "Uses the Gemini quota of your Google account (free, Google AI Pro or Ultra) through Google Antigravity, so no API key is needed. Google's Antigravity ACP server must be downloaded to the machine running Trilium (the server when self-hosting, or this computer on desktop). The first time the models are listed, the Google sign-in page opens in a browser on that machine.",+ "antigravity_agent_description": "Uses the Gemini quota of your Google account (free, Google AI Pro or Ultra) through Google Antigravity, so no API key is needed.\n\nGoogle's Antigravity ACP server must be downloaded to the machine running Trilium: the server when self-hosting, or this computer on desktop.\n\nThe first time the models are listed, the Google sign-in page opens in a browser on that machine.","add_provider_title_named": "Add {{- name}}","provider_group_cloud": "Cloud providers","provider_group_cloud_description": "Pay per use with an API key, billed separately from any subscription you already have. Your notes are sent to the provider's servers.",diff --git a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsxindex e347d072c8..3b596faea8 100644--- a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx+++ b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx@@ -52,7 +52,8 @@ export interface ProviderType {/*** What the connection step shows when the provider has neither a key nor an* endpoint to ask for: the full account-and-prerequisite story, in place of- * the fields that would otherwise fill the step.+ * the fields that would otherwise fill the step. Blank lines separate its+ * paragraphs, so the translation decides where they fall.*/connectionDescription?: string;/** One-line setup reminder shown under the endpoint field (i18n key, rendered via `<Trans>`). */@@ -376,7 +377,7 @@ export default function AddProviderModal({ show, onHidden, onSave, existingProvi)}{baseUrlMode === "advanced" && baseUrlField}{!usesApiKey && baseUrlMode === "none" && (- <p>{providerType?.connectionDescription}</p>+ providerType?.connectionDescription?.split(/\n\s*\n/).map((paragraph) => <p key={paragraph}>{paragraph}</p>))}</CardSection></Card>diff --git a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.wizard.spec.tsx b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.wizard.spec.tsxindex 12612d3879..19ed5f38a8 100644--- a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.wizard.spec.tsx+++ b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.wizard.spec.tsx@@ -5,7 +5,12 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";const mocks = vi.hoisted(() => ({ onSave: vi.fn(), onHidden: vi.fn() }));-vi.mock("../../../../services/i18n", () => ({ t: (key: string) => key }));+/** Messages whose text a case depends on; every other key renders as itself. */+const MESSAGES = vi.hoisted<Record<string, string>>(() => ({+ "llm.antigravity_agent_description": "Uses your Google account.\n\nDownload the server.\n\nSign in once."+}));++vi.mock("../../../../services/i18n", () => ({ t: (key: string) => MESSAGES[key] ?? key }));vi.mock("react-i18next", () => ({ Trans: ({ i18nKey }: { i18nKey: string }) => <>{i18nKey}</> }));@@ -140,6 +145,14 @@ describe("the connection step", () => {expect(nextButton()?.disabled).toBe(false);});+ it("shows such a provider's description one paragraph at a time", () => {+ open();+ act(() => providerCard("Google Antigravity")?.click());++ const paragraphs = [ ...document.querySelectorAll(".wizard-step p") ].map((p) => p.textContent);+ expect(paragraphs).toEqual([ "Uses your Google account.", "Download the server.", "Sign in once." ]);+ });+it("opens on the connection step when editing, the provider type being fixed by then", () => {open({ id: "openai_1", name: "OpenAI", provider: "openai", apiKey: "sk-old" });