From 38471d5df12a6d1c7c44dbb2e2a8a0ff4ac7cb2c Mon Sep 17 00:00:00 2001
From: huanghuoguoguo <60681390+huanghuoguoguo@users.noreply.github.com>
Date: Wed, 16 Sep 2026 22:37:02 +0800
Subject: [PATCH] style(assistant): compact model picker in header
---
.../home/components/WorkspaceAssistant.tsx | 60 ++++++++++---------
.../dynamic-form/DynamicFormItemComponent.tsx | 13 +++-
web/src/i18n/locales/en-US.ts | 9 ++-
web/src/i18n/locales/ja-JP.ts | 9 ++-
web/src/i18n/locales/zh-Hans.ts | 8 +--
5 files changed, 55 insertions(+), 44 deletions(-)
diff --git a/web/src/app/home/components/WorkspaceAssistant.tsx b/web/src/app/home/components/WorkspaceAssistant.tsx
index 1ea0b8d40..22bf9e5be 100644
--- a/web/src/app/home/components/WorkspaceAssistant.tsx
+++ b/web/src/app/home/components/WorkspaceAssistant.tsx
@@ -205,14 +205,44 @@ function AssistantPanel({ storageKey }: { storageKey: string }) {
-
{t('assistant.title')}
+
{t('assistant.title')}
{t('assistant.subtitle')}
+ {open && (
+
+ {},
+ ref: () => {},
+ disabled:
+ busy ||
+ (!!conversation && conversation.status !== 'ready'),
+ }}
+ requiredModelAbility="func_call"
+ compactModelSelector
+ />
+
+ )}
- {open && (
-
-
- {t('assistant.modelHint')}
-
- {},
- ref: () => {},
- disabled:
- busy || (!!conversation && conversation.status !== 'ready'),
- }}
- requiredModelAbility="func_call"
- />
-
- )}
;
@@ -97,6 +98,7 @@ export default function DynamicFormItemComponent({
setFormValue?: (name: string, value: unknown) => void;
systemContext?: Record;
requiredModelAbility?: string;
+ compactModelSelector?: boolean;
}) {
const [llmModels, setLlmModels] = useState([]);
const [embeddingModels, setEmbeddingModels] = useState([]);
@@ -468,7 +470,14 @@ export default function DynamicFormItemComponent({
onValueChange={field.onChange}
disabled={field.disabled}
>
-
+
@@ -605,7 +614,7 @@ export default function DynamicFormItemComponent({
type="button"
variant="ghost"
size="icon"
- className="h-9 w-9 shrink-0"
+ className={compactModelSelector ? 'hidden' : 'h-9 w-9 shrink-0'}
onClick={() => {
setSettingsSection('models');
setModelsDialogOpen(true);
diff --git a/web/src/i18n/locales/en-US.ts b/web/src/i18n/locales/en-US.ts
index 81e8942bc..d3c1980cd 100644
--- a/web/src/i18n/locales/en-US.ts
+++ b/web/src/i18n/locales/en-US.ts
@@ -1,7 +1,6 @@
const enUS = {
assistant: {
- modelHint:
- 'Assistant model · Space recommendation by default; changes apply to your next message',
+ modelHint: 'Switch assistant model for your next message',
details: 'View raw data',
found: 'Found {{count}} items',
completed: 'Completed',
@@ -29,8 +28,8 @@ const enUS = {
knowledge_bases: 'Find knowledge bases',
knowledge_engines: 'Find knowledge engines',
},
- title: 'Workspace assistant · Experimental',
- subtitle: 'Build with your Space model',
+ title: 'Workspace assistant',
+ subtitle: 'Build and manage your apps',
newChat: 'New conversation',
close: 'Close',
welcome:
@@ -43,7 +42,7 @@ const enUS = {
decline: 'Decline',
working: 'Working…',
modelUnavailable:
- 'The Space model is unavailable. Check your Space account and model access in Settings, then start a new conversation.',
+ 'Model unavailable. Check its configuration and access, then start a new conversation.',
error:
'This turn did not complete. Check the resource results before starting a new conversation; changes are not retried automatically.',
running:
diff --git a/web/src/i18n/locales/ja-JP.ts b/web/src/i18n/locales/ja-JP.ts
index 57f28d9b8..888af05e0 100644
--- a/web/src/i18n/locales/ja-JP.ts
+++ b/web/src/i18n/locales/ja-JP.ts
@@ -1,7 +1,6 @@
const jaJP = {
assistant: {
- modelHint:
- 'アシスタントモデル · 既定は Space 推奨。変更は次のメッセージから適用',
+ modelHint: '次のメッセージからモデルを切り替え',
details: '元のデータを見る',
found: '{{count}} 件見つかりました',
completed: '完了',
@@ -29,8 +28,8 @@ const jaJP = {
knowledge_bases: 'ナレッジベース検索',
knowledge_engines: 'エンジン検索',
},
- title: 'ワークスペースアシスタント · 実験版',
- subtitle: 'Space モデルでアプリを構築',
+ title: 'ワークスペースアシスタント',
+ subtitle: 'アプリを構築・管理',
newChat: '新しい会話',
close: '閉じる',
welcome:
@@ -43,7 +42,7 @@ const jaJP = {
decline: '拒否',
working: '処理中…',
modelUnavailable:
- 'Space モデルを利用できません。設定でログインとモデルの権限を確認して、新しい会話を開始してください。',
+ 'モデルを利用できません。設定と権限を確認して、新しい会話を開始してください。',
error:
'処理が完了しませんでした。新しい会話の前にリソースを確認してください。変更は自動で再試行されません。',
running:
diff --git a/web/src/i18n/locales/zh-Hans.ts b/web/src/i18n/locales/zh-Hans.ts
index 9783ae0e3..0f989ee9c 100644
--- a/web/src/i18n/locales/zh-Hans.ts
+++ b/web/src/i18n/locales/zh-Hans.ts
@@ -1,6 +1,6 @@
const zhHans = {
assistant: {
- modelHint: '助手模型 · 默认使用 Space 推荐模型,切换从下一条消息生效',
+ modelHint: '切换助手模型,从下一条消息生效',
details: '查看原始数据',
found: '找到 {{count}} 项',
completed: '已完成',
@@ -26,8 +26,8 @@ const zhHans = {
knowledge_bases: '查询知识库',
knowledge_engines: '查询知识引擎',
},
- title: '工作区助手 · 实验版',
- subtitle: '使用 Space 模型构建应用',
+ title: '工作区助手',
+ subtitle: '构建和管理你的应用',
newChat: '新对话',
close: '关闭',
welcome:
@@ -40,7 +40,7 @@ const zhHans = {
decline: '拒绝',
working: '正在处理…',
modelUnavailable:
- 'Space 模型暂不可用。请在设置中检查 Space 登录和模型权限,然后开启新对话。',
+ '模型暂不可用。请检查模型配置和访问权限,然后开启新对话。',
error:
'本轮未完成。请先检查资源和操作结果,再开启新对话;系统不会自动重试变更。',
running: