Skip to content

Build your personal knowledge base with Trilium Notes

feat(llm_chat): manage search providers from the Web search heading

Elian Doran64e7ffda19e1
diff --git a/apps/client/src/widgets/type_widgets/llm_chat/ChatToolsDropdown.spec.tsx b/apps/client/src/widgets/type_widgets/llm_chat/ChatToolsDropdown.spec.tsx
index 2a6aadd28e..096901ef84 100644
--- a/apps/client/src/widgets/type_widgets/llm_chat/ChatToolsDropdown.spec.tsx
+++ b/apps/client/src/widgets/type_widgets/llm_chat/ChatToolsDropdown.spec.tsx
@@ -105,7 +105,9 @@ describe("ChatToolsDropdown", () => {
await act(async () => menu.row("llm_chat.note_tools")?.click());
expect(menu.onNoteToolsChange).toHaveBeenCalledExactlyOnceWith(false);
- await act(async () => menu.row("llm_chat.manage_search_providers")?.click());
+ const manage = host?.querySelector<HTMLButtonElement>(".dropdown-header button.bx-cog");
+ expect(manage).not.toBeNull();
+ await act(async () => manage?.click());
expect(mocks.triggerCommand).toHaveBeenCalledExactlyOnceWith("showOptions", { section: "_optionsLlm" });
});
diff --git a/apps/client/src/widgets/type_widgets/llm_chat/ChatToolsDropdown.tsx b/apps/client/src/widgets/type_widgets/llm_chat/ChatToolsDropdown.tsx
index e77b50474c..678d131907 100644
--- a/apps/client/src/widgets/type_widgets/llm_chat/ChatToolsDropdown.tsx
+++ b/apps/client/src/widgets/type_widgets/llm_chat/ChatToolsDropdown.tsx
@@ -6,6 +6,7 @@ import type { ComponentChildren } from "preact";
import appContext from "../../../components/app_context.js";
import { t } from "../../../services/i18n.js";
import type { SearchProviderOption, WebSearchState } from "../../../services/llm_providers.js";
+import ActionButton from "../../react/ActionButton.js";
import Dropdown from "../../react/Dropdown.js";
import { FormDropdownDivider, FormListHeader, FormListItem, FormListToggleableItem } from "../../react/FormList.js";
import Icon from "../../react/Icon.js";
@@ -50,7 +51,16 @@ export default function ChatToolsDropdown({ enableNoteTools, onNoteToolsChange,
/>
<FormDropdownDivider />
- <FormListHeader text={t("llm_chat.web_search")} />
+ <FormListHeader
+ text={t("llm_chat.web_search")}
+ action={
+ <ActionButton
+ icon="bx bx-cog"
+ text={t("llm_chat.manage_search_providers")}
+ onClick={() => appContext.triggerCommand("showOptions", { section: "_optionsLlm" })}
+ />
+ }
+ />
<WebSearchChoice choice="disabled" webSearch={webSearch} onChoose={onWebSearchChoose}>
<Icon icon="bx bx-block" className="llm-chat-tools-choice-icon" />
{t("llm_chat.web_search_disabled")}
@@ -78,12 +88,6 @@ export default function ChatToolsDropdown({ enableNoteTools, onNoteToolsChange,
{provider.name}
</WebSearchChoice>
))}
- <FormListItem
- icon="bx bx-cog"
- onClick={() => appContext.triggerCommand("showOptions", { section: "_optionsLlm" })}
- >
- {t("llm_chat.manage_search_providers")}
- </FormListItem>
</Dropdown>
);
}
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/AI.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/AI.html
index 3a70d9a1ab..6c504f4fd4 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/AI.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/AI.html
@@ -124,8 +124,9 @@
is disabled for their models.</li>
<li>A search provider (Brave Search, Tavily, Exa or SearXNG) searches through
that service instead, whichever model is answering. Search providers are
- added in the <em>Search Providers</em> section of the AI settings, which <em>Manage search providers…</em> at
- the end of the menu opens.</li>
+ added in the <em>Search Providers</em> section of the AI settings, which
+ the <span class="tn-icon bx bx-cog"></span> button beside the <em>Web search</em> heading
+ in the menu opens.</li>
</ul>
<p>Whether web search is on is kept per chat; the search source is shared
by all chats. A choice the current model can't use stays in the menu, disabled;
diff --git a/docs/User Guide/User Guide/AI.md b/docs/User Guide/User Guide/AI.md
index 3f7ff6b432..357c50b5c3 100644
--- a/docs/User Guide/User Guide/AI.md
+++ b/docs/User Guide/User Guide/AI.md
@@ -89,7 +89,7 @@ Where the search comes from is chosen under _Web search_ in the <span class="tn-
* _Disabled_ turns web search off for this chat.
* _Use the model's built-in search_, the default, lets the model search with its provider's own search. Anthropic, OpenAI and Google Gemini models have one, as do Claude Code, Google Antigravity and OpenAI Codex. DeepSeek, Ollama, LM Studio and custom endpoints don't, so this choice is disabled for their models.
-* A search provider (Brave Search, Tavily, Exa or SearXNG) searches through that service instead, whichever model is answering. Search providers are added in the _Search Providers_ section of the AI settings, which _Manage search providers…_ at the end of the menu opens.
+* A search provider (Brave Search, Tavily, Exa or SearXNG) searches through that service instead, whichever model is answering. Search providers are added in the _Search Providers_ section of the AI settings, which the <span class="tn-icon bx bx-cog"></span> button beside the _Web search_ heading in the menu opens.
Whether web search is on is kept per chat; the search source is shared by all chats. A choice the current model can't use stays in the menu, disabled; hover the <span class="tn-icon bx bx-info-circle"></span> icon next to it to see why. Claude Code, GitHub Copilot, Google Antigravity and OpenAI Codex run their own tools, so they can't use a search provider.