Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
fix(webui): align fallback notice and clarify settings action
Xubin Ren1bfb4f6fc7cc
diff --git a/webui/src/components/thread/ModelFallbackNotice.tsx b/webui/src/components/thread/ModelFallbackNotice.tsxindex bd1cfada4..c0691a701 100644--- a/webui/src/components/thread/ModelFallbackNotice.tsx+++ b/webui/src/components/thread/ModelFallbackNotice.tsx@@ -16,7 +16,7 @@ export function ModelFallbackNotice({ model, reauthProvider, reauthProviderLabelreturn (<divrole="status"- className="mx-auto mb-2 flex w-full max-w-[49.5rem] items-start gap-2 rounded-control border border-border/60 bg-muted/40 px-3 py-2 text-xs text-foreground/80 animate-in fade-in-0 slide-in-from-bottom-1 motion-reduce:animate-none"+ className="mx-auto mb-2 flex w-full max-w-[49.5rem] items-center gap-2 rounded-control border border-border/60 bg-muted/40 px-3 py-2 text-xs text-foreground/80 animate-in fade-in-0 slide-in-from-bottom-1 motion-reduce:animate-none"><PresetProviderIconprovider={reauthProvider}@@ -42,7 +42,7 @@ export function ModelFallbackNotice({ model, reauthProvider, reauthProviderLabel{onOpenSettings ? (<button type="button" onClick={onOpenSettings} className="shrink-0 rounded-sm font-medium text-foreground underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">{reauthProviderLabel- ? t("thread.composer.reauthSettings", { defaultValue: "Open sign-in settings" })+ ? t("thread.composer.reauthSettings", { defaultValue: "Open model settings" }): t("thread.composer.checkModelSettings", { defaultValue: "Check model settings" })}</button>) : null}diff --git a/webui/src/i18n/locales/en/common.json b/webui/src/i18n/locales/en/common.jsonindex 794f72da9..1775eddea 100644--- a/webui/src/i18n/locales/en/common.json+++ b/webui/src/i18n/locales/en/common.json@@ -1587,7 +1587,7 @@"checkModelSettings": "Check model settings","reauthNotice": "{{provider}} authorization expired. Please sign in again.","reauthFallback": "A fallback model handled this response.",- "reauthSettings": "Open sign-in settings",+ "reauthSettings": "Open model settings","context": {"tooltip": "Context {{percent}}%","detailsLabel": "Open context usage",diff --git a/webui/src/i18n/locales/es/common.json b/webui/src/i18n/locales/es/common.jsonindex b2917e7e6..1c5df115d 100644--- a/webui/src/i18n/locales/es/common.json+++ b/webui/src/i18n/locales/es/common.json@@ -1388,7 +1388,7 @@"checkModelSettings": "Revisar ajustes del modelo","reauthNotice": "La autorización de {{provider}} caducó. Vuelve a iniciar sesión.","reauthFallback": "Un modelo alternativo respondió esta vez.",- "reauthSettings": "Abrir ajustes de inicio de sesión",+ "reauthSettings": "Abrir ajustes del modelo","context": {"tooltip": "Contexto {{percent}}%","detailsLabel": "Abrir uso del contexto",diff --git a/webui/src/i18n/locales/fr/common.json b/webui/src/i18n/locales/fr/common.jsonindex 7749420d0..06b4cdae8 100644--- a/webui/src/i18n/locales/fr/common.json+++ b/webui/src/i18n/locales/fr/common.json@@ -1387,7 +1387,7 @@"checkModelSettings": "Vérifier les paramètres du modèle","reauthNotice": "L’autorisation de {{provider}} a expiré. Veuillez vous reconnecter.","reauthFallback": "Un modèle de secours a traité cette réponse.",- "reauthSettings": "Ouvrir les paramètres de connexion",+ "reauthSettings": "Ouvrir les paramètres du modèle","context": {"tooltip": "Contexte {{percent}} %","detailsLabel": "Ouvrir l’utilisation du contexte",diff --git a/webui/src/i18n/locales/id/common.json b/webui/src/i18n/locales/id/common.jsonindex c66e96b00..b2ca91ebf 100644--- a/webui/src/i18n/locales/id/common.json+++ b/webui/src/i18n/locales/id/common.json@@ -1387,7 +1387,7 @@"checkModelSettings": "Periksa pengaturan model","reauthNotice": "Otorisasi {{provider}} kedaluwarsa. Silakan masuk kembali.","reauthFallback": "Model cadangan menangani respons ini.",- "reauthSettings": "Buka pengaturan masuk",+ "reauthSettings": "Buka pengaturan model","context": {"tooltip": "Konteks {{percent}}%","detailsLabel": "Buka penggunaan konteks",diff --git a/webui/src/i18n/locales/ja/common.json b/webui/src/i18n/locales/ja/common.jsonindex 2a64a63e6..5fe3c9c0a 100644--- a/webui/src/i18n/locales/ja/common.json+++ b/webui/src/i18n/locales/ja/common.json@@ -1387,7 +1387,7 @@"checkModelSettings": "モデル設定を確認","reauthNotice": "{{provider}} の認証が失効しました。再ログインしてください。","reauthFallback": "今回の応答には代替モデルを使用しました。",- "reauthSettings": "ログイン設定を開く",+ "reauthSettings": "モデル設定を開く","context": {"tooltip": "コンテキスト {{percent}}%","detailsLabel": "コンテキスト使用量を開く",diff --git a/webui/src/i18n/locales/ko/common.json b/webui/src/i18n/locales/ko/common.jsonindex f4215f1c6..7894a9653 100644--- a/webui/src/i18n/locales/ko/common.json+++ b/webui/src/i18n/locales/ko/common.json@@ -1387,7 +1387,7 @@"checkModelSettings": "모델 설정 확인","reauthNotice": "{{provider}} 인증이 만료되었습니다. 다시 로그인해 주세요.","reauthFallback": "이번 응답은 대체 모델이 처리했습니다.",- "reauthSettings": "로그인 설정 열기",+ "reauthSettings": "모델 설정 열기","context": {"tooltip": "컨텍스트 {{percent}}%","detailsLabel": "컨텍스트 사용량 열기",diff --git a/webui/src/i18n/locales/pt-BR/common.json b/webui/src/i18n/locales/pt-BR/common.jsonindex b5911e2f1..a6b216d3c 100644--- a/webui/src/i18n/locales/pt-BR/common.json+++ b/webui/src/i18n/locales/pt-BR/common.json@@ -1401,7 +1401,7 @@"checkModelSettings": "Verificar configurações do modelo","reauthNotice": "A autorização de {{provider}} expirou. Entre novamente.","reauthFallback": "Um modelo alternativo respondeu desta vez.",- "reauthSettings": "Abrir configurações de login",+ "reauthSettings": "Abrir configurações do modelo","context": {"tooltip": "Contexto {{percent}}%","detailsLabel": "Abrir uso do contexto",diff --git a/webui/src/i18n/locales/vi/common.json b/webui/src/i18n/locales/vi/common.jsonindex cba267835..86af4e4c9 100644--- a/webui/src/i18n/locales/vi/common.json+++ b/webui/src/i18n/locales/vi/common.json@@ -1387,7 +1387,7 @@"checkModelSettings": "Kiểm tra cài đặt mô hình","reauthNotice": "Quyền truy cập {{provider}} đã hết hạn. Vui lòng đăng nhập lại.","reauthFallback": "Mô hình dự phòng đã xử lý phản hồi này.",- "reauthSettings": "Mở cài đặt đăng nhập",+ "reauthSettings": "Mở cài đặt mô hình","context": {"tooltip": "Ngữ cảnh {{percent}}%","detailsLabel": "Mở mức sử dụng ngữ cảnh",diff --git a/webui/src/i18n/locales/zh-CN/common.json b/webui/src/i18n/locales/zh-CN/common.jsonindex afcc637e3..edabca8ad 100644--- a/webui/src/i18n/locales/zh-CN/common.json+++ b/webui/src/i18n/locales/zh-CN/common.json@@ -1586,7 +1586,7 @@"checkModelSettings": "检查模型设置","reauthNotice": "{{provider}} 授权已失效,请重新登录。","reauthFallback": "本次已由备用模型继续回复。",- "reauthSettings": "前往登录设置",+ "reauthSettings": "打开模型设置","context": {"tooltip": "上下文 {{percent}}%","detailsLabel": "打开上下文用量",diff --git a/webui/src/i18n/locales/zh-TW/common.json b/webui/src/i18n/locales/zh-TW/common.jsonindex bf0dd41ac..ec1c571df 100644--- a/webui/src/i18n/locales/zh-TW/common.json+++ b/webui/src/i18n/locales/zh-TW/common.json@@ -1387,7 +1387,7 @@"checkModelSettings": "檢查模型設定","reauthNotice": "{{provider}} 授權已失效,請重新登入。","reauthFallback": "本次已由備用模型繼續回覆。",- "reauthSettings": "前往登入設定",+ "reauthSettings": "開啟模型設定","context": {"tooltip": "上下文 {{percent}}%","detailsLabel": "開啟上下文用量",diff --git a/webui/src/tests/model-fallback-notice.test.tsx b/webui/src/tests/model-fallback-notice.test.tsxindex 658bd88e8..a9a5780df 100644--- a/webui/src/tests/model-fallback-notice.test.tsx+++ b/webui/src/tests/model-fallback-notice.test.tsx@@ -5,10 +5,20 @@ import { ModelFallbackNotice } from "@/components/thread/ModelFallbackNotice";import { __clearLogoFallbackCacheForTests } from "@/hooks/useLogoFallback";import { providerBrand } from "@/lib/provider-brand";-describe("model fallback notice logos", () => {+describe("model fallback notice", () => {beforeEach(__clearLogoFallbackCacheForTests);afterEach(cleanup);+ it("centers the notice contents and labels its model-settings destination", () => {+ const onOpenSettings = vi.fn();+ render(<ModelFallbackNotice model="xai-grok/grok-4.5" reauthProvider="openai_codex"+ reauthProviderLabel="OpenAI Codex" onDismiss={vi.fn()} onOpenSettings={onOpenSettings} />);+ expect(screen.getByRole("status")).toHaveClass("items-center");+ expect(screen.getByRole("status")).not.toHaveClass("items-start");+ fireEvent.click(screen.getByRole("button", { name: "Open model settings" }));+ expect(onOpenSettings).toHaveBeenCalledOnce();+ });+it.each(["openai_codex", "xai_grok", "github_copilot"])("shows the rejected %s provider, not the backup", (provider) => {render(<ModelFallbackNotice model="deepseek/deepseek-chat" reauthProvider={provider}reauthProviderLabel={provider} onDismiss={vi.fn()} />);diff --git a/webui/src/tests/thread-shell.test.tsx b/webui/src/tests/thread-shell.test.tsxindex 8a4736885..9243bf1c9 100644--- a/webui/src/tests/thread-shell.test.tsx+++ b/webui/src/tests/thread-shell.test.tsx@@ -1246,7 +1246,7 @@ describe("ThreadShell", () => {expect(title).toBeVisible();expect(screen.getByText("A fallback model handled this response.")).toBeVisible();expect(screen.queryByText(/This response used a fallback model/)).not.toBeInTheDocument();- fireEvent.click(screen.getByRole("button", { name: "Open sign-in settings" }));+ fireEvent.click(screen.getByRole("button", { name: "Open model settings" }));expect(openSettings).toHaveBeenCalledOnce();fireEvent.click(within(title.closest('[role="status"]') as HTMLElement).getByRole("button", { name: "Dismiss" }));emit("openai_codex");