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: confirm saved Hugging Face token with a tick (#6630)

Michael Han75166f204309
diff --git a/studio/frontend/src/features/settings/tabs/general-tab.tsx b/studio/frontend/src/features/settings/tabs/general-tab.tsx
index 6e34b3b23d6..5f926e34c31 100644
--- a/studio/frontend/src/features/settings/tabs/general-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/general-tab.tsx
@@ -25,8 +25,9 @@ import {
useShowLlamaUpdateBanner,
} from "@/hooks/use-llama-update-pref";
import { LOCALE_STORAGE_KEY, useT } from "@/i18n";
+import { cn } from "@/lib/utils";
import { useNavigate, useRouterState } from "@tanstack/react-router";
-import { Eye, EyeOff } from "lucide-react";
+import { Check, Eye, EyeOff } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import {
type HelperPrecacheSettings,
@@ -171,6 +172,12 @@ export function GeneralTab() {
if (trimmed !== hfToken) setHfToken(trimmed);
};
+ // Show an "accepted" tick once a non-empty token has been committed to the
+ // store and the field still matches it (i.e. not mid-edit). Gives the user
+ // feedback that a pasted token was saved.
+ const tokenSaved =
+ draftToken.trim().length > 0 && draftToken.trim() === (hfToken ?? "");
+
useEffect(() => {
let cancelled = false;
void loadUploadLimitSettings()
@@ -319,8 +326,22 @@ export function GeneralTab() {
value={draftToken}
onChange={(e) => setDraftToken(e.target.value)}
onBlur={commitToken}
- className="h-8 w-full pr-8 font-mono text-xs"
+ className={cn(
+ "h-8 w-full font-mono text-xs",
+ tokenSaved ? "pr-14" : "pr-8",
+ )}
/>
+ {tokenSaved ? (
+ // Decorative: pointer-events-none lets clicks reach the input
+ // underneath so the field still focuses anywhere.
+ <span
+ className="pointer-events-none absolute right-7 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center text-emerald-600 duration-150 animate-in fade-in zoom-in dark:text-emerald-500"
+ role="img"
+ aria-label={t("settings.general.tokenSaved")}
+ >
+ <Check className="size-4" strokeWidth={2.5} />
+ </span>
+ ) : null}
<button
type="button"
onClick={() => setShowToken((s) => !s)}
diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.ts
index 7cd68865dd9..885c0edd0ee 100644
--- a/studio/frontend/src/i18n/locales/en.ts
+++ b/studio/frontend/src/i18n/locales/en.ts
@@ -106,6 +106,7 @@ export const en = {
"Used to load gated models and push artifacts.",
hideToken: "Hide token",
showToken: "Show token",
+ tokenSaved: "Token saved",
password: "Password",
passwordDescription: "Change the password for this Studio account.",
passwordDialog: {
diff --git a/studio/frontend/src/i18n/locales/zh-CN.ts b/studio/frontend/src/i18n/locales/zh-CN.ts
index 7a6a5ee66d9..bc239294bd6 100644
--- a/studio/frontend/src/i18n/locales/zh-CN.ts
+++ b/studio/frontend/src/i18n/locales/zh-CN.ts
@@ -105,6 +105,7 @@ export const zhCN = {
huggingFaceTokenDescription: "用于加载受限模型和推送产物。",
hideToken: "隐藏 token",
showToken: "显示 token",
+ tokenSaved: "Token 已保存",
password: "密码",
passwordDescription: "更改此 Studio 账号的密码。",
passwordDialog: {