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: add a spell check switch to Settings > General (#13023)

Danteb89f170dcae4
diff --git a/studio/frontend/src/features/settings/settings-search.ts b/studio/frontend/src/features/settings/settings-search.ts
index 18dd3d47903..43aa88eede9 100644
--- a/studio/frontend/src/features/settings/settings-search.ts
+++ b/studio/frontend/src/features/settings/settings-search.ts
@@ -23,6 +23,7 @@ export const SETTINGS_SEARCH_INDEX: Record<SettingsTab, TranslationKey[]> = {
"settings.general.huggingFaceToken",
"settings.appearance.language.title",
"settings.appearance.language.label",
+ "settings.appearance.language.spellCheck",
"settings.general.notifications.sectionTitle",
"settings.general.notifications.showLlamaUpdates",
"settings.general.notifications.showWhisperUpdates",
diff --git a/studio/frontend/src/features/settings/tabs/general-tab.tsx b/studio/frontend/src/features/settings/tabs/general-tab.tsx
index a28d6f885d8..9425f40027f 100644
--- a/studio/frontend/src/features/settings/tabs/general-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/general-tab.tsx
@@ -39,6 +39,11 @@ import {
import { useHfTokenValidation } from "@/hooks";
import { LOCALE_STORAGE_KEY, useT } from "@/i18n";
import { isTauri } from "@/lib/api-base";
+import {
+ SPELLCHECK_STORAGE_KEY,
+ setSpellCheck,
+ useSpellCheck,
+} from "@/lib/spellcheck";
import { toast } from "@/lib/toast";
import { cn } from "@/lib/utils";
import { Check, Eye, EyeOff } from "lucide-react";
@@ -98,6 +103,7 @@ const PREFS_KEYS: string[] = [
"unsloth_appearance_customization",
INTERFACE_SCALE_STORAGE_KEY,
LOCALE_STORAGE_KEY,
+ SPELLCHECK_STORAGE_KEY,
// UI state
"sidebar_pinned",
"sidebar_width",
@@ -208,6 +214,7 @@ export function GeneralTab() {
const showWhisperUpdates = useShowWhisperUpdateBanner();
const showAudioCppUpdates = useShowAudioCppUpdateBanner();
const showLoadedModels = useShowLoadedModels();
+ const spellCheck = useSpellCheck();
const [draftToken, setDraftToken] = useState(hfToken ?? "");
const [showToken, setShowToken] = useState(false);
@@ -602,6 +609,12 @@ export function GeneralTab() {
>
<LanguageSelect />
</SettingsRow>
+ <SettingsRow
+ label={t("settings.appearance.language.spellCheck")}
+ description={t("settings.appearance.language.spellCheckDescription")}
+ >
+ <Switch checked={spellCheck} onCheckedChange={setSpellCheck} />
+ </SettingsRow>
</SettingsSection>
{isTauri ? (
diff --git a/studio/frontend/src/i18n/locales/ar.ts b/studio/frontend/src/i18n/locales/ar.ts
index 68ec84384ea..2b9c791be1f 100644
--- a/studio/frontend/src/i18n/locales/ar.ts
+++ b/studio/frontend/src/i18n/locales/ar.ts
@@ -2035,6 +2035,8 @@ export const ar = {
label: "لغة العرض",
description: "اللغة التي يستخدمها Unsloth.",
autoDetect: "اكتشاف تلقائي",
+ spellCheck: "التدقيق الإملائي",
+ spellCheckDescription: "وضع خط تحت الكلمات التي بها أخطاء إملائية أثناء الكتابة.",
},
layout: {
title: "التخطيط",
diff --git a/studio/frontend/src/i18n/locales/de.ts b/studio/frontend/src/i18n/locales/de.ts
index f8c7c6d38d9..19b48168c4b 100644
--- a/studio/frontend/src/i18n/locales/de.ts
+++ b/studio/frontend/src/i18n/locales/de.ts
@@ -2061,6 +2061,8 @@ export const de = {
label: "Anzeigesprache",
description: "Die von Unsloth verwendete Sprache.",
autoDetect: "Automatisch erkennen",
+ spellCheck: "Rechtschreibprüfung",
+ spellCheckDescription: "Falsch geschriebene Wörter beim Tippen unterstreichen.",
},
layout: {
title: "Layout",
diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.ts
index bc147dba920..6f3e4925b23 100644
--- a/studio/frontend/src/i18n/locales/en.ts
+++ b/studio/frontend/src/i18n/locales/en.ts
@@ -2075,6 +2075,8 @@ export const en = {
label: "Display language",
description: "The language used by Unsloth.",
autoDetect: "Auto detect",
+ spellCheck: "Spell check",
+ spellCheckDescription: "Underline misspelled words as you type.",
},
layout: {
title: "Layout",
diff --git a/studio/frontend/src/i18n/locales/es.ts b/studio/frontend/src/i18n/locales/es.ts
index 921216dc0e0..84901d2ae68 100644
--- a/studio/frontend/src/i18n/locales/es.ts
+++ b/studio/frontend/src/i18n/locales/es.ts
@@ -2056,6 +2056,8 @@ export const es = {
label: "Idioma de la interfaz",
description: "El idioma que usa Unsloth.",
autoDetect: "Detección automática",
+ spellCheck: "Corrector ortográfico",
+ spellCheckDescription: "Subrayar las palabras mal escritas mientras escribes.",
},
layout: {
title: "Diseño",
diff --git a/studio/frontend/src/i18n/locales/fr.ts b/studio/frontend/src/i18n/locales/fr.ts
index b82d07d77e8..11b8f29fa6f 100644
--- a/studio/frontend/src/i18n/locales/fr.ts
+++ b/studio/frontend/src/i18n/locales/fr.ts
@@ -2060,6 +2060,8 @@ export const fr = {
label: "Langue d'affichage",
description: "La langue utilisée par Unsloth.",
autoDetect: "Détection automatique",
+ spellCheck: "Correcteur orthographique",
+ spellCheckDescription: "Souligner les mots mal orthographiés pendant la saisie.",
},
layout: {
title: "Disposition",
diff --git a/studio/frontend/src/i18n/locales/he.ts b/studio/frontend/src/i18n/locales/he.ts
index 5e1795d06e4..35ee6ca9193 100644
--- a/studio/frontend/src/i18n/locales/he.ts
+++ b/studio/frontend/src/i18n/locales/he.ts
@@ -2119,6 +2119,8 @@ export const he = {
label: "שפת תצוגה",
description: "השפה שבשימוש ב-Unsloth.",
autoDetect: "זיהוי אוטומטי",
+ spellCheck: "בדיקת איות",
+ spellCheckDescription: "סימון בקו תחתון של מילים עם שגיאות כתיב בזמן ההקלדה.",
},
layout: {
title: "פריסה",
diff --git a/studio/frontend/src/i18n/locales/hi.ts b/studio/frontend/src/i18n/locales/hi.ts
index a857583d2b6..443bfbd9c8b 100644
--- a/studio/frontend/src/i18n/locales/hi.ts
+++ b/studio/frontend/src/i18n/locales/hi.ts
@@ -2038,6 +2038,8 @@ export const hi = {
label: "प्रदर्शन भाषा",
description: "Unsloth द्वारा उपयोग की जाने वाली भाषा।",
autoDetect: "स्वतः पहचान",
+ spellCheck: "वर्तनी जाँच",
+ spellCheckDescription: "टाइप करते समय गलत वर्तनी वाले शब्दों को रेखांकित करें।",
},
layout: {
title: "लेआउट",
diff --git a/studio/frontend/src/i18n/locales/it.ts b/studio/frontend/src/i18n/locales/it.ts
index 83e93860771..e31ff20ea51 100644
--- a/studio/frontend/src/i18n/locales/it.ts
+++ b/studio/frontend/src/i18n/locales/it.ts
@@ -2020,6 +2020,8 @@ export const it = {
label: "Lingua dell'interfaccia",
description: "La lingua usata da Unsloth.",
autoDetect: "Rilevamento automatico",
+ spellCheck: "Controllo ortografico",
+ spellCheckDescription: "Sottolinea le parole errate mentre scrivi.",
},
layout: {
title: "Layout",
diff --git a/studio/frontend/src/i18n/locales/ja.ts b/studio/frontend/src/i18n/locales/ja.ts
index 068aa0784b6..41fc76b1244 100644
--- a/studio/frontend/src/i18n/locales/ja.ts
+++ b/studio/frontend/src/i18n/locales/ja.ts
@@ -2014,6 +2014,8 @@ export const ja = {
label: "表示言語",
description: "Unsloth で使用される言語。",
autoDetect: "自動検出",
+ spellCheck: "スペルチェック",
+ spellCheckDescription: "入力中にスペルミスのある単語に下線を引きます。",
},
layout: {
title: "レイアウト",
diff --git a/studio/frontend/src/i18n/locales/ko.ts b/studio/frontend/src/i18n/locales/ko.ts
index d9ff55e49dc..a44788c7950 100644
--- a/studio/frontend/src/i18n/locales/ko.ts
+++ b/studio/frontend/src/i18n/locales/ko.ts
@@ -2031,6 +2031,8 @@ export const ko = {
label: "표시 언어",
description: "Unsloth에서 사용하는 언어입니다.",
autoDetect: "자동 감지",
+ spellCheck: "맞춤법 검사",
+ spellCheckDescription: "입력하는 동안 맞춤법이 틀린 단어에 밑줄을 표시합니다.",
},
layout: {
title: "레이아웃",
diff --git a/studio/frontend/src/i18n/locales/pt-br.ts b/studio/frontend/src/i18n/locales/pt-br.ts
index 3814f25d6c4..ccdf44d0a87 100644
--- a/studio/frontend/src/i18n/locales/pt-br.ts
+++ b/studio/frontend/src/i18n/locales/pt-br.ts
@@ -2046,6 +2046,8 @@ export const ptBR = {
label: "Idioma de exibição",
description: "O idioma utilizado pelo Unsloth.",
autoDetect: "Detecção automática",
+ spellCheck: "Verificação ortográfica",
+ spellCheckDescription: "Sublinhar palavras com erros de ortografia enquanto você digita.",
},
layout: {
title: "Layout",
diff --git a/studio/frontend/src/i18n/locales/ru.ts b/studio/frontend/src/i18n/locales/ru.ts
index 4ff2c4a5d91..7ea6f50a12e 100644
--- a/studio/frontend/src/i18n/locales/ru.ts
+++ b/studio/frontend/src/i18n/locales/ru.ts
@@ -2040,6 +2040,8 @@ export const ru = {
label: "Язык интерфейса",
description: "Язык, используемый Unsloth.",
autoDetect: "Автоопределение",
+ spellCheck: "Проверка орфографии",
+ spellCheckDescription: "Подчёркивать слова с ошибками при вводе.",
},
layout: {
title: "Макет",
diff --git a/studio/frontend/src/i18n/locales/sv.ts b/studio/frontend/src/i18n/locales/sv.ts
index d9d66c84e85..e3ba0784a0c 100644
--- a/studio/frontend/src/i18n/locales/sv.ts
+++ b/studio/frontend/src/i18n/locales/sv.ts
@@ -2190,6 +2190,8 @@ export const sv = {
label: "Visningsspråk",
description: "Språket som används av Unsloth.",
autoDetect: "Identifiera automatiskt",
+ spellCheck: "Stavningskontroll",
+ spellCheckDescription: "Stryk under felstavade ord medan du skriver.",
},
layout: {
title: "Layout",
diff --git a/studio/frontend/src/i18n/locales/zh-CN.ts b/studio/frontend/src/i18n/locales/zh-CN.ts
index b798163ac8d..82ec7d4effb 100644
--- a/studio/frontend/src/i18n/locales/zh-CN.ts
+++ b/studio/frontend/src/i18n/locales/zh-CN.ts
@@ -1900,6 +1900,8 @@ export const zhCN = {
label: "显示语言",
description: "选择 Unsloth 使用的语言。",
autoDetect: "自动检测",
+ spellCheck: "拼写检查",
+ spellCheckDescription: "输入时在拼写错误的单词下方显示下划线。",
},
theme: {
title: "视觉样式",
diff --git a/studio/frontend/src/lib/account-transition.ts b/studio/frontend/src/lib/account-transition.ts
index b722e2c072d..67605df8e27 100644
--- a/studio/frontend/src/lib/account-transition.ts
+++ b/studio/frontend/src/lib/account-transition.ts
@@ -27,6 +27,7 @@ export const ACCOUNT_CHROME_KEYS = new Set([
"palette",
APPEARANCE_KEY,
"unsloth_locale",
+ "unsloth_spellcheck",
"sidebar_pinned",
"sidebar_width",
"chat_settings_width",
diff --git a/studio/frontend/src/lib/spellcheck.ts b/studio/frontend/src/lib/spellcheck.ts
new file mode 100644
index 00000000000..c43c3ae39ab
--- /dev/null
+++ b/studio/frontend/src/lib/spellcheck.ts
@@ -0,0 +1,65 @@
+// 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 { useSyncExternalStore } from "react";
+
+// Off sets spellcheck="false" on <html>, which every field inherits (none opts back in).
+export const SPELLCHECK_STORAGE_KEY = "unsloth_spellcheck";
+
+const listeners = new Set<() => void>();
+
+export function getSpellCheck(): boolean {
+ try {
+ return localStorage.getItem(SPELLCHECK_STORAGE_KEY) !== "false";
+ } catch {
+ return true;
+ }
+}
+
+function apply(): void {
+ const root = document.documentElement;
+ if (getSpellCheck()) {
+ // Remove rather than set "true", so an untouched install keeps the engine default.
+ root.removeAttribute("spellcheck");
+ } else {
+ root.setAttribute("spellcheck", "false");
+ }
+}
+
+export function setSpellCheck(enabled: boolean): void {
+ try {
+ if (enabled) {
+ localStorage.removeItem(SPELLCHECK_STORAGE_KEY);
+ } else {
+ localStorage.setItem(SPELLCHECK_STORAGE_KEY, "false");
+ }
+ } catch {
+ // storage unavailable
+ }
+ apply();
+ for (const listener of listeners) {
+ listener();
+ }
+}
+
+function subscribe(listener: () => void): () => void {
+ listeners.add(listener);
+ return () => listeners.delete(listener);
+}
+
+export function useSpellCheck(): boolean {
+ return useSyncExternalStore(subscribe, getSpellCheck);
+}
+
+/** Apply the stored choice now and follow toggles made in another tab. */
+export function watchSpellCheck(win: Window): void {
+ apply();
+ win.addEventListener("storage", (event) => {
+ if (event.key === SPELLCHECK_STORAGE_KEY || event.key === null) {
+ apply();
+ for (const listener of listeners) {
+ listener();
+ }
+ }
+ });
+}
diff --git a/studio/frontend/src/main.tsx b/studio/frontend/src/main.tsx
index af0249b8ac6..bf72c0ba2ea 100644
--- a/studio/frontend/src/main.tsx
+++ b/studio/frontend/src/main.tsx
@@ -21,6 +21,7 @@ import { isTauri } from "./lib/api-base";
import { setHubSessionRefresh } from "./lib/hf-endpoint";
import { watchInputModality } from "./lib/input-modality";
import { watchOverlayScrollbarGutter } from "./lib/overlay-scrollbar";
+import { watchSpellCheck } from "./lib/spellcheck";
setHubSessionRefresh(refreshSession);
@@ -60,6 +61,9 @@ watchMathBlockContainmentOverride();
watchOverlayScrollbarGutter(window);
watchInputModality(window);
+// Before the first render, so a disabled spell check never flashes underlines.
+watchSpellCheck(window);
+
function renderApp(): void {
root.render(
<StrictMode>
diff --git a/studio/frontend/tests/general-settings-token-sync.test.ts b/studio/frontend/tests/general-settings-token-sync.test.ts
index e8f6713e84d..849897b13ad 100644
--- a/studio/frontend/tests/general-settings-token-sync.test.ts
+++ b/studio/frontend/tests/general-settings-token-sync.test.ts
@@ -155,6 +155,11 @@ function generalTab(initialToken: string) {
},
"@/i18n": { LOCALE_STORAGE_KEY: "locale", useT: () => translate },
"@/lib/api-base": { isTauri: false },
+ "@/lib/spellcheck": {
+ SPELLCHECK_STORAGE_KEY: "unsloth_spellcheck",
+ setSpellCheck: noop,
+ useSpellCheck: () => true,
+ },
"@/lib/toast": { toast: { success: noop, error: noop } },
"@/lib/utils": {
cn: (...values: unknown[]) => values.filter(Boolean).join(" "),
diff --git a/studio/frontend/tests/spellcheck-preference.test.ts b/studio/frontend/tests/spellcheck-preference.test.ts
new file mode 100644
index 00000000000..75252c70727
--- /dev/null
+++ b/studio/frontend/tests/spellcheck-preference.test.ts
@@ -0,0 +1,92 @@
+// 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 { readFileSync, readdirSync } from "node:fs";
+import test from "node:test";
+
+import {
+ installLocalStorageFake,
+ readSrc,
+ registerBundlerResolver,
+} from "./helpers/kit.ts";
+
+registerBundlerResolver();
+const { store, fireWindowEvent } = installLocalStorageFake();
+
+// Just enough <html> to read back what the preference wrote.
+const attrs = new Map<string, string>();
+Object.assign(globalThis.document, {
+ documentElement: {
+ getAttribute: (name: string) => attrs.get(name) ?? null,
+ setAttribute: (name: string, value: string) => attrs.set(name, value),
+ removeAttribute: (name: string) => attrs.delete(name),
+ },
+});
+const root = () => attrs.get("spellcheck") ?? null;
+
+const {
+ SPELLCHECK_STORAGE_KEY,
+ getSpellCheck,
+ setSpellCheck,
+ watchSpellCheck,
+} = await import("../src/lib/spellcheck.ts");
+
+test("an untouched install leaves spell check to the engine", () => {
+ watchSpellCheck(globalThis.window);
+ assert.equal(getSpellCheck(), true);
+ assert.equal(root(), null);
+});
+
+test("turning it off marks <html> and persists", () => {
+ setSpellCheck(false);
+ assert.equal(getSpellCheck(), false);
+ assert.equal(root(), "false");
+ assert.equal(store.get(SPELLCHECK_STORAGE_KEY), "false");
+});
+
+test("turning it back on removes the attribute and the stored value", () => {
+ setSpellCheck(true);
+ assert.equal(root(), null);
+ assert.equal(store.has(SPELLCHECK_STORAGE_KEY), false);
+});
+
+test("a toggle in another tab is applied here", () => {
+ store.set(SPELLCHECK_STORAGE_KEY, "false");
+ fireWindowEvent("storage", { key: SPELLCHECK_STORAGE_KEY });
+ assert.equal(root(), "false");
+ store.delete(SPELLCHECK_STORAGE_KEY);
+ fireWindowEvent("storage", { key: null }); // localStorage.clear()
+ assert.equal(root(), null);
+});
+
+test("no field opts back in, so the root setting reaches every input", () => {
+ // One spellCheck={true} would keep underlines in that field with the switch off.
+ const src = new URL("../src/", import.meta.url);
+ const optIns = readdirSync(src, { recursive: true, encoding: "utf8" })
+ .filter((file) => /\.tsx?$/.test(file))
+ .filter((file) =>
+ /spell[cC]heck=(\{true\}|"true")/.test(
+ readFileSync(new URL(file, src), "utf8"),
+ ),
+ );
+ assert.deepEqual(optIns, []);
+});
+
+test("the app applies it before the first render", () => {
+ assert.match(readSrc("main.tsx"), /watchSpellCheck\(window\);/);
+});
+
+test("an account switch keeps the choice, like the display language", async () => {
+ const { ACCOUNT_CHROME_KEYS } = await import(
+ "../src/lib/account-transition.ts"
+ );
+ assert.ok(ACCOUNT_CHROME_KEYS.has(SPELLCHECK_STORAGE_KEY));
+});
+
+test("Reset all preferences turns spell check back on", () => {
+ const prefsKeys = readSrc("features/settings/tabs/general-tab.tsx").match(
+ /const PREFS_KEYS: string\[\] = \[([\s\S]*?)\n\];/,
+ )?.[1];
+ assert.match(prefsKeys ?? "", /^\s*SPELLCHECK_STORAGE_KEY,$/m);
+});