Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: Select all only picks the models the search shows (#11485)

Nilay87ff26aa8ebe
diff --git a/studio/frontend/src/features/chat/chat-providers-dialog.tsx b/studio/frontend/src/features/chat/chat-providers-dialog.tsx
index 03e92b293f6..a537ed44b96 100644
--- a/studio/frontend/src/features/chat/chat-providers-dialog.tsx
+++ b/studio/frontend/src/features/chat/chat-providers-dialog.tsx
@@ -555,11 +555,14 @@ export function ChatProvidersSettings({
}
function selectAllModels() {
- setSelectedModelIds([...availableModels]);
+ setSelectedModelIds((prev) => [
+ ...new Set([...prev, ...filteredAvailableModels]),
+ ]);
}
function clearModelSelection() {
- setSelectedModelIds([]);
+ const visible = new Set(filteredAvailableModels);
+ setSelectedModelIds((prev) => prev.filter((id) => !visible.has(id)));
}
function parseOptionalBaseUrl(
@@ -1849,7 +1852,7 @@ export function ChatProvidersSettings({
className="h-8 px-2 text-xs font-medium text-foreground/80 hover:bg-muted/45"
onClick={() => {
clearModelSelection();
- setManualModelIds("");
+ if (!modelSearchQuery.trim()) setManualModelIds("");
}}
>
Clear
diff --git a/studio/frontend/tests/connections-model-bulk-select.test.ts b/studio/frontend/tests/connections-model-bulk-select.test.ts
new file mode 100644
index 00000000000..6bcbdd4a4f5
--- /dev/null
+++ b/studio/frontend/tests/connections-model-bulk-select.test.ts
@@ -0,0 +1,51 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+// Select all and Clear act on the models the search shows, and keep hidden picks.
+
+import assert from "node:assert/strict";
+import test from "node:test";
+
+import { readSrc } from "./helpers/kit.ts";
+
+const dialog = readSrc("features/chat/chat-providers-dialog.tsx");
+
+function body(name: string): string {
+ const match = dialog.match(
+ new RegExp(`function ${name}\\(\\) \\{([\\s\\S]*?)\\n {2}\\}`),
+ )?.[1];
+ assert.ok(match, `${name} not found`);
+ return match;
+}
+
+test("Select all only adds the models the search shows", () => {
+ const selectAll = body("selectAllModels");
+ assert.match(
+ selectAll,
+ /new Set\(\[\.\.\.prev, \.\.\.filteredAvailableModels\]\)/,
+ );
+ assert.doesNotMatch(selectAll, /availableModels\]/);
+});
+
+test("Clear only removes the models the search shows", () => {
+ const clear = body("clearModelSelection");
+ assert.match(clear, /new Set\(filteredAvailableModels\)/);
+ assert.match(clear, /prev\.filter\(\(id\) => !visible\.has\(id\)\)/);
+ assert.doesNotMatch(clear, /setSelectedModelIds\(\[\]\)/);
+});
+
+test("both model lists wire their buttons to the scoped handlers", () => {
+ assert.equal(dialog.match(/onClick=\{selectAllModels\}/g)?.length, 2);
+ assert.equal(
+ dialog.match(/onClick=\{clearModelSelection\}|clearModelSelection\(\);/g)
+ ?.length,
+ 2,
+ );
+});
+
+test("Clear keeps typed model IDs while a search is active", () => {
+ assert.match(
+ dialog,
+ /clearModelSelection\(\);\s*if \(!modelSearchQuery\.trim\(\)\) setManualModelIds\(""\);/,
+ );
+});