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: keep the export Save folder input as typed (#13142)

Jay Zhou2d432ed460fd
diff --git a/studio/frontend/src/features/export/components/export-run-panel.tsx b/studio/frontend/src/features/export/components/export-run-panel.tsx
index 260dfe21552..c259fe1033d 100644
--- a/studio/frontend/src/features/export/components/export-run-panel.tsx
+++ b/studio/frontend/src/features/export/components/export-run-panel.tsx
@@ -104,6 +104,7 @@ export interface ExportRunPanelProps {
destination: ExportDestination;
onDestinationChange: (v: ExportDestination) => void;
saveDirectory: string;
+ saveDirectoryInput: string;
defaultSaveDirectory: string;
saveDirectoryOverridden: boolean;
onSaveDirectoryChange: (v: string | null) => void;
@@ -133,6 +134,7 @@ export function ExportRunPanel(props: ExportRunPanelProps) {
destination,
onDestinationChange,
saveDirectory,
+ saveDirectoryInput,
defaultSaveDirectory,
saveDirectoryOverridden,
onSaveDirectoryChange,
@@ -289,7 +291,7 @@ export function ExportRunPanel(props: ExportRunPanelProps) {
<div className="flex items-stretch gap-2">
<Input
className="min-w-0 flex-1 font-mono text-ui-12"
- value={saveDirectory}
+ value={saveDirectoryInput}
onChange={(e) => onSaveDirectoryChange(e.target.value)}
spellCheck={false}
title={saveDirectory}
diff --git a/studio/frontend/src/features/export/export-page.tsx b/studio/frontend/src/features/export/export-page.tsx
index a55bfe064d9..909d22a4193 100644
--- a/studio/frontend/src/features/export/export-page.tsx
+++ b/studio/frontend/src/features/export/export-page.tsx
@@ -95,6 +95,7 @@ import {
} from "./export-navigation-cache";
import { confirmLlmCompressorInstallIfNeeded } from "./hooks/use-llm-compressor-consent";
import { useExportSizeEstimate } from "./hooks/use-export-size-estimate";
+import { saveDirectoryField } from "./lib/save-directory";
import {
isExportPanelActive,
useExportRuntimeStore,
@@ -737,7 +738,10 @@ export function ExportPage() {
sourceBaseModelName,
sourceMode,
]);
- const saveDirectory = customSaveDirectory?.trim() || defaultSaveDirectory;
+ const { inputValue: saveDirectoryInput, saveDirectory } = saveDirectoryField(
+ customSaveDirectory,
+ defaultSaveDirectory,
+ );
// Each merged format uploads a full model to the repo root, so several to one repo would collide.
// GGUF method exporting an adapter checkpoint as a GGUF LoRA; reuses the LoRA export path.
const ggufAsLora =
@@ -1990,6 +1994,7 @@ export function ExportPage() {
destination={destination}
onDestinationChange={setDestination}
saveDirectory={saveDirectory}
+ saveDirectoryInput={saveDirectoryInput}
defaultSaveDirectory={defaultSaveDirectory}
saveDirectoryOverridden={!!customSaveDirectory}
onSaveDirectoryChange={setCustomSaveDirectory}
diff --git a/studio/frontend/src/features/export/lib/save-directory.ts b/studio/frontend/src/features/export/lib/save-directory.ts
new file mode 100644
index 00000000000..1535a10d223
--- /dev/null
+++ b/studio/frontend/src/features/export/lib/save-directory.ts
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+export function saveDirectoryField(
+ custom: string | null,
+ defaultSaveDirectory: string,
+): { inputValue: string; saveDirectory: string } {
+ // Echoing the trimmed path back into the input would drop a space as it is
+ // typed and refill a cleared field with the default.
+ return {
+ inputValue: custom ?? defaultSaveDirectory,
+ saveDirectory: custom?.trim() || defaultSaveDirectory,
+ };
+}
diff --git a/studio/frontend/tests/export-save-directory.test.ts b/studio/frontend/tests/export-save-directory.test.ts
new file mode 100644
index 00000000000..13c60e6f51e
--- /dev/null
+++ b/studio/frontend/tests/export-save-directory.test.ts
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import assert from "node:assert/strict";
+import test from "node:test";
+
+import { saveDirectoryField } from "../src/features/export/lib/save-directory.ts";
+
+const DEFAULT = "qwen3-4b-GGUF";
+
+test("the save folder input shows the default until the user edits it", () => {
+ assert.deepEqual(saveDirectoryField(null, DEFAULT), {
+ inputValue: DEFAULT,
+ saveDirectory: DEFAULT,
+ });
+});
+
+test("a cleared save folder input stays empty and exports to the default", () => {
+ assert.deepEqual(saveDirectoryField("", DEFAULT), {
+ inputValue: "",
+ saveDirectory: DEFAULT,
+ });
+});
+
+test("a trailing space survives typing and is trimmed from the export path", () => {
+ assert.deepEqual(saveDirectoryField("D:\\My ", DEFAULT), {
+ inputValue: "D:\\My ",
+ saveDirectory: "D:\\My",
+ });
+});
+
+test("a pasted absolute path is used as typed", () => {
+ assert.deepEqual(saveDirectoryField("/Volumes/ext/exports", DEFAULT), {
+ inputValue: "/Volumes/ext/exports",
+ saveDirectory: "/Volumes/ext/exports",
+ });
+});