Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style: improve with details (#17217)

René Wang2b0f481bd4d8
diff --git a/apps/server/src/featureFlags/index.test.ts b/apps/server/src/featureFlags/index.test.ts
new file mode 100644
index 00000000000..5a57b95c30b
--- /dev/null
+++ b/apps/server/src/featureFlags/index.test.ts
@@ -0,0 +1,25 @@
+import { afterEach, describe, expect, it, vi } from 'vitest';
+
+import { applyDevelopmentFeatureFlagDefaults } from './index';
+
+afterEach(() => {
+ vi.unstubAllEnvs();
+});
+
+describe('applyDevelopmentFeatureFlagDefaults', () => {
+ it('enables Workspace in development when runtime config contains an allowlist', () => {
+ vi.stubEnv('NODE_ENV', 'development');
+
+ expect(applyDevelopmentFeatureFlagDefaults({ workspace: ['production-user'] }).workspace).toBe(
+ true,
+ );
+ });
+
+ it('preserves the runtime Workspace flag outside development', () => {
+ vi.stubEnv('NODE_ENV', 'production');
+
+ expect(
+ applyDevelopmentFeatureFlagDefaults({ workspace: ['production-user'] }).workspace,
+ ).toEqual(['production-user']);
+ });
+});
diff --git a/apps/server/src/featureFlags/index.ts b/apps/server/src/featureFlags/index.ts
index d765376d5c3..1ef093cd15c 100644
--- a/apps/server/src/featureFlags/index.ts
+++ b/apps/server/src/featureFlags/index.ts
@@ -45,6 +45,9 @@ const FEATURE_FLAG_OVERRIDE_DOMAIN: RuntimeConfigDomain<Record<string, boolean>>
let featureFlagsProvider: RuntimeConfigProvider<IFeatureFlags> | null = null;
let featureFlagsOverrideProvider: RuntimeConfigProvider<Record<string, boolean>> | null = null;
+export const applyDevelopmentFeatureFlagDefaults = (flags: IFeatureFlags) =>
+ process.env.NODE_ENV === 'development' ? { ...flags, workspace: true } : flags;
+
const getFeatureFlagsProvider = () => {
featureFlagsProvider ??= new CompositeRuntimeConfigProvider(
new RedisRuntimeConfigProvider(FEATURE_FLAGS_DOMAIN),
@@ -65,7 +68,11 @@ const getFeatureFlagOverrideProvider = () => {
const getMergedFeatureFlags = async (userId?: string) => {
const globalSnapshot = await getFeatureFlagsProvider().getSnapshot({ scope: 'global' });
- const globalFlags = merge(DEFAULT_FEATURE_FLAGS, globalSnapshot?.data || {});
+ // Shared runtime config can contain production allowlists even in local development.
+ // Apply development defaults after the global snapshot; user-specific overrides below still win.
+ const globalFlags = applyDevelopmentFeatureFlagDefaults(
+ merge(DEFAULT_FEATURE_FLAGS, globalSnapshot?.data || {}),
+ );
if (!userId) {
return globalFlags;
diff --git a/apps/server/src/routers/lambda/market/creds.test.ts b/apps/server/src/routers/lambda/market/creds.test.ts
index 9b2681be330..2c2e8234456 100644
--- a/apps/server/src/routers/lambda/market/creds.test.ts
+++ b/apps/server/src/routers/lambda/market/creds.test.ts
@@ -76,7 +76,7 @@ describe('credsRouter is always personal-scoped', () => {
});
// `market.creds` is the personal-creds router used directly by the browser
- // (standalone /settings/creds page, and the workspace creds page's "your
+ // (standalone /settings/credential page, and the workspace creds page's "your
// personal credentials" section). `ctx.workspaceId` is ambient — set on
// every request whenever the caller has *any* workspace selected elsewhere
// in the app, regardless of which page/section made the call. Routing
diff --git a/locales/en-US/chat.json b/locales/en-US/chat.json
index 1eb8523987a..6106e406e09 100644
--- a/locales/en-US/chat.json
+++ b/locales/en-US/chat.json
@@ -640,7 +640,6 @@
"operation.streamRetry.withAttempt": "{{name}} upstream is busy ({{status}}), retrying {{attempt}}/{{maxAttempts}}",
"owner": "Group owner",
"pageCopilot.title": "Page Agent",
- "pageCopilot.welcome": "**Clearer, sharper writing**\n\nDraft, rewrite, or polish—tell me your intent and I'll refine the rest.",
"pageSelection.lines": "Lines {{start}}-{{end}}",
"pageSelection.reference": "Selected Text",
"pin": "Pin",
@@ -794,6 +793,7 @@
"sessionGroup.creatingAgent": "Creating agent...",
"sessionGroup.groupName": "Category Name",
"sessionGroup.inputPlaceholder": "Please enter category name...",
+ "sessionGroup.manageCategory": "Manage Category",
"sessionGroup.moveGroup": "Move to Category",
"sessionGroup.newGroup": "New Category",
"sessionGroup.noAvailableAgents": "No available agents",
@@ -1056,7 +1056,6 @@
"taskList.contextMenu.transferWarning": "Cross-workspace references like assigned agent and active topic will be cleared.",
"taskList.empty": "No tasks yet",
"taskList.emptyHero.greeting": "What should we tackle today?",
- "taskList.emptyHero.subtitle": "Describe a task for your agent, or start from a template below.",
"taskList.emptyHero.templatesTitle": "Templates picked for you",
"taskList.form.grouping": "Grouping",
"taskList.form.orderCompletedByRecency": "Sort completed tasks by recency",
diff --git a/locales/en-US/file.json b/locales/en-US/file.json
index 4d983df140e..ce22eaa628f 100644
--- a/locales/en-US/file.json
+++ b/locales/en-US/file.json
@@ -115,6 +115,7 @@
"pageEditor.editMode.lockedBySomeone": "Someone else is editing this document",
"pageEditor.editMode.lockedDescription": "The page is read-only while they edit. Your changes won’t be saved until they’re done.",
"pageEditor.editedAt": "Last edited on {{time}}",
+ "pageEditor.editedAtBy": "Last edited on {{time}} by {{name}}",
"pageEditor.editedBy": "Last edited by {{name}}",
"pageEditor.editorPlaceholder": "Press \"/\" for AI and commands.",
"pageEditor.empty.createNewDocument": "Create New Page",
@@ -158,6 +159,7 @@
"pageEditor.menu.export.markdown": "Markdown",
"pageEditor.menu.exportDocument": "Export Page",
"pageEditor.menu.importDocument": "Import Page",
+ "pageEditor.menu.move": "Move",
"pageEditor.menu.pin": "Pin Page",
"pageEditor.saving": "Saving...",
"pageEditor.titlePlaceholder": "Untitled",
@@ -188,7 +190,7 @@
"pageList.transferDescription": "You can move to personal or workspaces that have permission to create a page.",
"pageList.transferFailed": "Failed to transfer page",
"pageList.transferSuccess": "Page transferred",
- "pageList.transferTitle": "Transfer page",
+ "pageList.transferTitle": "Move page",
"pageList.transferTo": "Transfer to…",
"pageList.transferWarning": "This is a one-way move; reverting requires another transfer.",
"pageList.untitled": "Untitled",
diff --git a/locales/en-US/pageShare.json b/locales/en-US/pageShare.json
index 87ad426121f..d9d27b30bb5 100644
--- a/locales/en-US/pageShare.json
+++ b/locales/en-US/pageShare.json
@@ -12,6 +12,7 @@
"popover.linkHint": "Anyone with the link can view this page",
"popover.permissionLink": "Anyone with the link",
"popover.permissionPrivate": "Private",
+ "popover.permissionWorkspace": "Anyone in the workspace",
"popover.privateHint": "Only you can access this page",
"popover.sectionViews_one": "{{count}} view",
"popover.sectionViews_other": "{{count}} views",
@@ -19,6 +20,7 @@
"popover.updateError": "Failed to update sharing settings",
"popover.visibility": "Visibility",
"popover.visibilityUpdated": "Visibility updated",
+ "popover.workspaceHint": "Anyone in this workspace can view this page",
"shareButton.label": "Share",
"shell.footer": "Published on {{appName}}",
"shell.sharedBy": "Shared by {{name}}",
diff --git a/locales/en-US/setting.json b/locales/en-US/setting.json
index 6f780fd51fa..84ecbc8667a 100644
--- a/locales/en-US/setting.json
+++ b/locales/en-US/setting.json
@@ -2341,7 +2341,6 @@
"workspace.members.invite.seatInsufficient": "Only {{remaining}} seat(s) remaining. Buy more seats to invite {{required}} new member(s), or invite viewers instead (they don’t take a seat).",
"workspace.members.invite.seatInsufficientNoBuy": "Only {{remaining}} seat(s) remaining. Ask the workspace owner to purchase more seats, or invite viewers instead (they don’t take a seat).",
"workspace.members.invite.submit": "Invite",
- "workspace.members.invite.subtitle": "Add new members by entering their email address and assigning a role",
"workspace.members.invite.success": "Team members invited successfully.",
"workspace.members.invite.title": "Invite Members",
"workspace.members.invite.upgradePlanCta": "Upgrade plan",
diff --git a/locales/en-US/spend.json b/locales/en-US/spend.json
index 3be0af29e01..35c12af3f1e 100644
--- a/locales/en-US/spend.json
+++ b/locales/en-US/spend.json
@@ -38,8 +38,12 @@
"table.columns.type.enums.videoGeneration": "Video Generation",
"table.columns.type.title": "Type",
"table.desc": "Details of credit usage for text generation, embedding, image generation, etc.",
- "table.more": "View Details",
- "table.title": "Credit Usage Details",
+ "table.filters.allTypes": "All types",
+ "table.filters.endDate": "End date",
+ "table.filters.reset": "Reset",
+ "table.filters.searchModel": "Search model",
+ "table.filters.startDate": "Start date",
+ "table.title": "Breakdown",
"table.totalToken.input": "Input",
"table.totalToken.output": "Output",
"usageStats.breakdown.cost": "Cost",
diff --git a/locales/en-US/subscription.json b/locales/en-US/subscription.json
index 2052ff607d0..7cdafd948f8 100644
--- a/locales/en-US/subscription.json
+++ b/locales/en-US/subscription.json
@@ -564,7 +564,6 @@
"usage.credit.addon.desc": "Quota resets in {{time}}",
"usage.credit.addon.used": "Top-up Credits",
"usage.credit.desc": "Credits usage for AI chat, image generation, speech synthesis",
- "usage.credit.detail": "Usage statistics for the past {{day}} days",
"usage.credit.free.desc": "Quota resets in {{time}}",
"usage.credit.free.expired": "Expired on {{date}}",
"usage.credit.free.used": "Free Credits",
@@ -575,7 +574,7 @@
"usage.credit.time.days": "{{days}} days",
"usage.credit.time.daysAndHours": "{{days}} days {{hours}} hours",
"usage.credit.time.hours": "{{hours}} hours",
- "usage.credit.title": "Credit Usage",
+ "usage.credit.title": "Credit",
"usage.overview.charge": "Charges",
"usage.overview.included": "Plan Usage",
"usage.overview.onDemand": "On-demand",
@@ -584,8 +583,7 @@
"usage.storage.desc": "Data storage can be released by manual cleanup",
"usage.storage.embeddings.used": "Vector Storage",
"usage.storage.file.used": "File Usage",
- "usage.storage.title": "Data Storage",
- "usage.title": "This Month Usage",
+ "usage.storage.title": "Storage",
"usage.used": "Used",
"zarinpal.infoModal.desc": "Due to policy requirements, please complete the following personal information before placing an order:",
"zarinpal.infoModal.phone.label": "Phone Number",
diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.json
index e6ef9a51cf9..bb216ff27f9 100644
--- a/locales/zh-CN/chat.json
+++ b/locales/zh-CN/chat.json
@@ -640,7 +640,6 @@
"operation.streamRetry.withAttempt": "{{name}} 上游繁忙({{status}}),正在重试 {{attempt}}/{{maxAttempts}}",
"owner": "群主",
"pageCopilot.title": "文稿助理",
- "pageCopilot.welcome": "**让文字更清晰、更到位**\n\n起草、改写、润色都可以。你把意图说清楚,其余交给我打磨",
"pageSelection.lines": "第 {{start}}-{{end}} 行",
"pageSelection.reference": "选中文本",
"pin": "置顶",
@@ -794,6 +793,7 @@
"sessionGroup.creatingAgent": "正在创建助理…",
"sessionGroup.groupName": "分类名称",
"sessionGroup.inputPlaceholder": "请输入分类名称…",
+ "sessionGroup.manageCategory": "管理分类",
"sessionGroup.moveGroup": "移动到分类",
"sessionGroup.newGroup": "新分类",
"sessionGroup.noAvailableAgents": "暂无可用助理",
@@ -1056,7 +1056,6 @@
"taskList.contextMenu.transferWarning": "跨工作区的引用(如分配的代理和活动主题)将被清除。",
"taskList.empty": "暂无任务",
"taskList.emptyHero.greeting": "今天想搞定点什么?",
- "taskList.emptyHero.subtitle": "描述一项任务交给你的助理,或从下方模板开始。",
"taskList.emptyHero.templatesTitle": "为你推荐的模板",
"taskList.form.grouping": "分组",
"taskList.form.orderCompletedByRecency": "按最近完成排序",
diff --git a/locales/zh-CN/file.json b/locales/zh-CN/file.json
index 8ff73be70c7..10d664bfdec 100644
--- a/locales/zh-CN/file.json
+++ b/locales/zh-CN/file.json
@@ -115,6 +115,7 @@
"pageEditor.editMode.lockedBySomeone": "其他人正在编辑此文档",
"pageEditor.editMode.lockedDescription": "对方编辑期间本页为只读,你的改动在对方完成前不会被保存。",
"pageEditor.editedAt": "最后编辑于 {{time}}",
+ "pageEditor.editedAtBy": "最后由 {{name}} 编辑于 {{time}}",
"pageEditor.editedBy": "最后编辑者 {{name}}",
"pageEditor.editorPlaceholder": "按 \"/\" 使用 AI 和命令",
"pageEditor.empty.createNewDocument": "创建新文稿",
@@ -158,6 +159,7 @@
"pageEditor.menu.export.markdown": "Markdown 格式",
"pageEditor.menu.exportDocument": "导出文稿",
"pageEditor.menu.importDocument": "导入文稿",
+ "pageEditor.menu.move": "移动",
"pageEditor.menu.pin": "置顶文稿",
"pageEditor.saving": "正在保存…",
"pageEditor.titlePlaceholder": "无标题",
@@ -188,7 +190,7 @@
"pageList.transferDescription": "您可以移动到有权限创建页面的个人账户或工作区。",
"pageList.transferFailed": "转移页面失败",
"pageList.transferSuccess": "页面已转移",
- "pageList.transferTitle": "转移页面",
+ "pageList.transferTitle": "移动页面",
"pageList.transferTo": "转移到…",
"pageList.transferWarning": "这是单向移动;恢复需要另一次转移。",
"pageList.untitled": "无标题",
diff --git a/locales/zh-CN/pageShare.json b/locales/zh-CN/pageShare.json
index 57ba90d26c2..ab5888f5620 100644
--- a/locales/zh-CN/pageShare.json
+++ b/locales/zh-CN/pageShare.json
@@ -12,6 +12,7 @@
"popover.linkHint": "拥有链接的任何人都可查看此页面",
"popover.permissionLink": "拥有链接者",
"popover.permissionPrivate": "私密",
+ "popover.permissionWorkspace": "工作区中的任何人",
"popover.privateHint": "仅你可访问此页面",
"popover.sectionViews_one": "{{count}} 次浏览",
"popover.sectionViews_other": "{{count}} 次浏览",
@@ -19,6 +20,7 @@
"popover.updateError": "更新分享设置失败",
"popover.visibility": "可见性",
"popover.visibilityUpdated": "可见性已更新",
+ "popover.workspaceHint": "此工作区中的任何人都可以查看此页面",
"shareButton.label": "分享",
"shell.footer": "由 {{appName}} 发布",
"shell.sharedBy": "由 {{name}} 分享",
diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.json
index 895e8c2fbf7..de9562c7531 100644
--- a/locales/zh-CN/setting.json
+++ b/locales/zh-CN/setting.json
@@ -2341,7 +2341,6 @@
"workspace.members.invite.seatInsufficient": "仅剩 {{remaining}} 个席位,不足以邀请 {{required}} 名新成员。请购买更多席位,或将部分角色改为查看者(不占席位)。",
"workspace.members.invite.seatInsufficientNoBuy": "仅剩 {{remaining}} 个席位,不足以邀请 {{required}} 名新成员。请联系工作区所有者购买更多席位,或将部分角色改为查看者(不占席位)。",
"workspace.members.invite.submit": "邀请",
- "workspace.members.invite.subtitle": "通过输入电子邮件地址并分配角色添加新成员",
"workspace.members.invite.success": "团队成员已成功邀请。",
"workspace.members.invite.title": "邀请成员",
"workspace.members.invite.upgradePlanCta": "升级套餐",
diff --git a/locales/zh-CN/spend.json b/locales/zh-CN/spend.json
index f0606c02c9b..072df0de779 100644
--- a/locales/zh-CN/spend.json
+++ b/locales/zh-CN/spend.json
@@ -38,8 +38,12 @@
"table.columns.type.enums.videoGeneration": "视频生成",
"table.columns.type.title": "类型",
"table.desc": "展示文本生成、嵌入、图像生成等功能的计算积分使用详情。",
- "table.more": "查看详情",
- "table.title": "计算积分使用详情",
+ "table.filters.allTypes": "全部类型",
+ "table.filters.endDate": "结束日期",
+ "table.filters.reset": "重置",
+ "table.filters.searchModel": "搜索模型",
+ "table.filters.startDate": "开始日期",
+ "table.title": "明细",
"table.totalToken.input": "输入",
"table.totalToken.output": "输出",
"usageStats.breakdown.cost": "费用",
diff --git a/locales/zh-CN/subscription.json b/locales/zh-CN/subscription.json
index c2ef841102c..1ccf8be48dc 100644
--- a/locales/zh-CN/subscription.json
+++ b/locales/zh-CN/subscription.json
@@ -564,7 +564,6 @@
"usage.credit.addon.desc": "配额将在 {{time}} 后重置",
"usage.credit.addon.used": "充值积分",
"usage.credit.desc": "用于 AI 聊天、图像生成、语音合成的积分使用情况",
- "usage.credit.detail": "过去 {{day}} 天的使用统计",
"usage.credit.free.desc": "配额将在 {{time}} 后重置",
"usage.credit.free.expired": "已于 {{date}} 过期",
"usage.credit.free.used": "免费积分",
@@ -575,7 +574,7 @@
"usage.credit.time.days": "{{days}} 天",
"usage.credit.time.daysAndHours": "{{days}} 天 {{hours}} 小时",
"usage.credit.time.hours": "{{hours}} 小时",
- "usage.credit.title": "积分使用情况",
+ "usage.credit.title": "积分",
"usage.overview.charge": "按量计费",
"usage.overview.included": "计划内使用",
"usage.overview.onDemand": "按需使用",
@@ -584,8 +583,7 @@
"usage.storage.desc": "可通过手动清理释放数据存储空间",
"usage.storage.embeddings.used": "向量存储",
"usage.storage.file.used": "文件使用量",
- "usage.storage.title": "数据存储",
- "usage.title": "本月使用情况",
+ "usage.storage.title": "存储",
"usage.used": "已使用",
"zarinpal.infoModal.desc": "根据政策要求,请在下单前填写以下个人信息:",
"zarinpal.infoModal.phone.label": "手机号",
diff --git a/packages/app-config/src/featureFlags/schema.ts b/packages/app-config/src/featureFlags/schema.ts
index b2afbd7b864..2d4783b6027 100644
--- a/packages/app-config/src/featureFlags/schema.ts
+++ b/packages/app-config/src/featureFlags/schema.ts
@@ -87,7 +87,7 @@ export const DEFAULT_FEATURE_FLAGS: IFeatureFlags = {
auth_captcha: true,
cloud_promotion: false,
storage_overage: true,
- workspace: false,
+ workspace: isDev,
market: true,
speech_to_text: true,
diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.ts
index c7f659fd7da..a94bde5aed1 100644
--- a/packages/locales/src/default/chat.ts
+++ b/packages/locales/src/default/chat.ts
@@ -802,7 +802,6 @@ export default {
'operation.sendMessage': 'Sending message',
'owner': 'Group owner',
'pageCopilot.title': 'Page Agent',
- 'pageCopilot.welcome': `**Clearer, sharper writing**\n\nDraft, rewrite, or polish—tell me your intent and I'll refine the rest.`,
'pageSelection.lines': 'Lines {{start}}-{{end}}',
'pageSelection.reference': 'Selected Text',
'textSelection.added': 'Added to conversation context',
@@ -898,6 +897,7 @@ export default {
'sendPlaceholderWithAgentAssignment':
'Ask, create, or start a task. @ to assign tasks to other agents.',
'sessionGroup.config': 'Category Management',
+ 'sessionGroup.manageCategory': 'Manage Category',
'sessionGroup.confirmRemoveGroupAlert':
'This category is about to be deleted. After deletion, the agents in this category will be moved to the default list. Please confirm your operation.',
'sessionGroup.createAgentSuccess': 'Agent created successfully',
@@ -1233,7 +1233,6 @@ export default {
'taskList.breadcrumb.task': 'Task',
'taskList.empty': 'No tasks yet',
'taskList.emptyHero.greeting': 'What should we tackle today?',
- 'taskList.emptyHero.subtitle': 'Describe a task for your agent, or start from a template below.',
'taskList.emptyHero.templatesTitle': 'Templates picked for you',
'taskList.form.grouping': 'Grouping',
'taskList.form.orderCompletedByRecency': 'Sort completed tasks by recency',
diff --git a/packages/locales/src/default/file.ts b/packages/locales/src/default/file.ts
index e03b2d9926d..cb5f9b462a1 100644
--- a/packages/locales/src/default/file.ts
+++ b/packages/locales/src/default/file.ts
@@ -115,6 +115,7 @@ export default {
'pageEditor.duplicateError': 'Failed to duplicate the page',
'pageEditor.duplicateSuccess': 'Page duplicated successfully',
'pageEditor.editedAt': 'Last edited on {{time}}',
+ 'pageEditor.editedAtBy': 'Last edited on {{time}} by {{name}}',
'pageEditor.editedBy': 'Last edited by {{name}}',
'pageEditor.editMode.checking': 'Checking edit availability…',
'pageEditor.editMode.draftRestoreCancel': 'Discard',
@@ -180,6 +181,7 @@ export default {
'pageEditor.menu.export.markdown': 'Markdown',
'pageEditor.menu.exportDocument': 'Export Page',
'pageEditor.menu.importDocument': 'Import Page',
+ 'pageEditor.menu.move': 'Move',
'pageEditor.menu.pin': 'Pin Page',
'pageEditor.saving': 'Saving...',
'pageEditor.titlePlaceholder': 'Untitled',
@@ -213,7 +215,7 @@ export default {
'You can move to personal or workspaces that have permission to create a page.',
'pageList.transferFailed': 'Failed to transfer page',
'pageList.transferSuccess': 'Page transferred',
- 'pageList.transferTitle': 'Transfer page',
+ 'pageList.transferTitle': 'Move page',
'pageList.transferTo': 'Transfer to…',
'pageList.transferWarning': 'This is a one-way move; reverting requires another transfer.',
'pageList.untitled': 'Untitled',
diff --git a/packages/locales/src/default/pageShare.ts b/packages/locales/src/default/pageShare.ts
index 759609fec97..9f00a752667 100644
--- a/packages/locales/src/default/pageShare.ts
+++ b/packages/locales/src/default/pageShare.ts
@@ -15,6 +15,7 @@ export default {
'popover.linkHint': 'Anyone with the link can view this page',
'popover.permissionLink': 'Anyone with the link',
'popover.permissionPrivate': 'Private',
+ 'popover.permissionWorkspace': 'Anyone in the workspace',
'popover.privateHint': 'Only you can access this page',
'popover.sectionViews_one': '{{count}} view',
'popover.sectionViews_other': '{{count}} views',
@@ -22,6 +23,7 @@ export default {
'popover.updateError': 'Failed to update sharing settings',
'popover.visibility': 'Visibility',
'popover.visibilityUpdated': 'Visibility updated',
+ 'popover.workspaceHint': 'Anyone in this workspace can view this page',
'shareButton.label': 'Share',
'shell.footer': 'Published on {{appName}}',
'shell.sharedBy': 'Shared by {{name}}',
diff --git a/packages/locales/src/default/setting.ts b/packages/locales/src/default/setting.ts
index b0731dfd074..b49409e2857 100644
--- a/packages/locales/src/default/setting.ts
+++ b/packages/locales/src/default/setting.ts
@@ -2507,8 +2507,6 @@ When I am ___, I need ___
'workspace.members.invite.upgradePlanCta': 'Upgrade plan',
'workspace.members.invite.roleLabel': 'Role',
'workspace.members.invite.submit': 'Invite',
- 'workspace.members.invite.subtitle':
- 'Add new members by entering their email address and assigning a role',
'workspace.members.invite.addAnother': 'Add another',
'workspace.members.invite.button': 'Invite',
'workspace.members.invite.modal.cancel': 'Cancel',
diff --git a/packages/locales/src/default/spend.ts b/packages/locales/src/default/spend.ts
index e4b6accc8e3..f32d7153444 100644
--- a/packages/locales/src/default/spend.ts
+++ b/packages/locales/src/default/spend.ts
@@ -38,8 +38,12 @@ export default {
'table.columns.type.enums.videoGeneration': 'Video Generation',
'table.columns.type.title': 'Type',
'table.desc': 'Details of credit usage for text generation, embedding, image generation, etc.',
- 'table.more': 'View Details',
- 'table.title': 'Credit Usage Details',
+ 'table.filters.allTypes': 'All types',
+ 'table.filters.endDate': 'End date',
+ 'table.filters.reset': 'Reset',
+ 'table.filters.searchModel': 'Search model',
+ 'table.filters.startDate': 'Start date',
+ 'table.title': 'Breakdown',
'table.totalToken.input': 'Input',
'table.totalToken.output': 'Output',
'usageStats.breakdown.cost': 'Cost',
diff --git a/packages/locales/src/default/subscription.ts b/packages/locales/src/default/subscription.ts
index 0061826f5fe..5bdf8034432 100644
--- a/packages/locales/src/default/subscription.ts
+++ b/packages/locales/src/default/subscription.ts
@@ -662,7 +662,6 @@ export default {
'usage.credit.addon.desc': 'Quota resets in {{time}}',
'usage.credit.addon.used': 'Top-up Credits',
'usage.credit.desc': 'Credits usage for AI chat, image generation, speech synthesis',
- 'usage.credit.detail': 'Usage statistics for the past {{day}} days',
'usage.credit.free.desc': 'Quota resets in {{time}}',
'usage.credit.free.expired': 'Expired on {{date}}',
'usage.credit.free.used': 'Free Credits',
@@ -673,7 +672,7 @@ export default {
'usage.credit.time.days': '{{days}} days',
'usage.credit.time.daysAndHours': '{{days}} days {{hours}} hours',
'usage.credit.time.hours': '{{hours}} hours',
- 'usage.credit.title': 'Credit Usage',
+ 'usage.credit.title': 'Credit',
'usage.overview.charge': 'Charges',
'usage.overview.included': 'Plan Usage',
'usage.overview.onDemand': 'On-demand',
@@ -682,8 +681,7 @@ export default {
'usage.storage.desc': 'Data storage can be released by manual cleanup',
'usage.storage.embeddings.used': 'Vector Storage',
'usage.storage.file.used': 'File Usage',
- 'usage.storage.title': 'Data Storage',
- 'usage.title': 'This Month Usage',
+ 'usage.storage.title': 'Storage',
'usage.used': 'Used',
'zarinpal.infoModal.desc':
'Due to policy requirements, please complete the following personal information before placing an order:',
diff --git a/src/business/client/hooks/useDocumentTransferMenuItem.ts b/src/business/client/hooks/useDocumentTransferMenuItem.ts
index 642cf61425d..449bf1e1210 100644
--- a/src/business/client/hooks/useDocumentTransferMenuItem.ts
+++ b/src/business/client/hooks/useDocumentTransferMenuItem.ts
@@ -1,3 +1,12 @@
-import { type ItemType } from 'antd/es/menu/interface';
+import type { ItemType } from 'antd/es/menu/interface';
-export const useDocumentTransferMenuItem = (_documentId?: string): ItemType[] | null => null;
+export interface DocumentTransferMenuItemOptions {
+ defaultTargetVisibility?: 'private' | 'public';
+ preferCurrentWorkspace?: boolean;
+ transferLabel?: string;
+}
+
+export const useDocumentTransferMenuItem = (
+ _documentId?: string,
+ _options?: DocumentTransferMenuItemOptions,
+): ItemType[] | null => null;
diff --git a/src/features/AgentTasks/AgentTaskList/AgentTasksPage.test.ts b/src/features/AgentTasks/AgentTaskList/AgentTasksPage.test.ts
index ef263976591..22722415d02 100644
--- a/src/features/AgentTasks/AgentTaskList/AgentTasksPage.test.ts
+++ b/src/features/AgentTasks/AgentTaskList/AgentTasksPage.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';
-import { getTaskCreateActionBehavior } from './AgentTasksPage';
+import { getTaskCreateActionBehavior, getTaskPageHeaderVisibility } from './AgentTasksPage';
import { shouldRenderTaskAgentPanelToggle } from './taskAgentPanelToggle';
describe('AgentTasksPage', () => {
@@ -35,4 +35,26 @@ describe('AgentTasksPage', () => {
expect(shouldRenderTaskAgentPanelToggle(true)).toBe(false);
});
});
+
+ describe('getTaskPageHeaderVisibility', () => {
+ it('hides empty global-task chrome that has no useful content yet', () => {
+ expect(
+ getTaskPageHeaderVisibility({ agentId: undefined, isEmptyHero: true, isMobile: false }),
+ ).toEqual({
+ showBreadcrumb: false,
+ showTaskAgentPanelToggle: false,
+ showViewOptions: false,
+ });
+ });
+
+ it('keeps scoped task-list context when only the selected agent has no tasks', () => {
+ expect(
+ getTaskPageHeaderVisibility({ agentId: 'agent-1', isEmptyHero: true, isMobile: false }),
+ ).toEqual({
+ showBreadcrumb: true,
+ showTaskAgentPanelToggle: true,
+ showViewOptions: true,
+ });
+ });
+ });
});
diff --git a/src/features/AgentTasks/AgentTaskList/AgentTasksPage.tsx b/src/features/AgentTasks/AgentTaskList/AgentTasksPage.tsx
index 1d4b0d25b89..b0969f7b478 100644
--- a/src/features/AgentTasks/AgentTaskList/AgentTasksPage.tsx
+++ b/src/features/AgentTasks/AgentTaskList/AgentTasksPage.tsx
@@ -47,6 +47,26 @@ export const getTaskCreateActionBehavior = ({
} as const;
};
+interface TaskPageHeaderVisibilityParams {
+ agentId?: string;
+ isEmptyHero: boolean;
+ isMobile: boolean;
+}
+
+export const getTaskPageHeaderVisibility = ({
+ agentId,
+ isEmptyHero,
+ isMobile,
+}: TaskPageHeaderVisibilityParams) => {
+ const isGlobalEmpty = !agentId && isEmptyHero;
+
+ return {
+ showBreadcrumb: !isGlobalEmpty,
+ showTaskAgentPanelToggle: !isGlobalEmpty && shouldRenderTaskAgentPanelToggle(isMobile),
+ showViewOptions: !isGlobalEmpty,
+ };
+};
+
interface AgentTasksPageProps {
/**
* When provided, the page is scoped to a single agent's tasks; otherwise it
@@ -123,12 +143,12 @@ const AgentTasksPage = memo<AgentTasksPageProps>(({ agentId }) => {
setViewOptions((prev) => ({ ...prev, hideCompleted: false }));
}, [setViewOptions]);
- const showTaskAgentPanelToggle = shouldRenderTaskAgentPanelToggle(isMobile);
+ const headerVisibility = getTaskPageHeaderVisibility({ agentId, isEmptyHero, isMobile });
return (
<Flexbox flex={1} height={'100%'}>
<NavHeader
- left={<Breadcrumb />}
+ left={headerVisibility.showBreadcrumb ? <Breadcrumb /> : undefined}
right={
<Flexbox horizontal align={'center'} gap={4}>
{!agentId && <TaskListVisibilityFilter />}
@@ -141,8 +161,10 @@ const AgentTasksPage = memo<AgentTasksPageProps>(({ agentId }) => {
onClick={handleCreateTask}
/>
)}
- <TasksGroupConfig options={viewOptions} setOptions={setViewOptions} />
- {showTaskAgentPanelToggle && (
+ {headerVisibility.showViewOptions && (
+ <TasksGroupConfig options={viewOptions} setOptions={setViewOptions} />
+ )}
+ {headerVisibility.showTaskAgentPanelToggle && (
<ToggleRightPanelButton
hideWhenExpanded
expand={showTaskAgentPanel}
diff --git a/src/features/AgentTasks/AgentTaskList/CreateTaskInlineEntry.test.tsx b/src/features/AgentTasks/AgentTaskList/CreateTaskInlineEntry.test.tsx
index 6a2b8e36093..85a84ae2b3c 100644
--- a/src/features/AgentTasks/AgentTaskList/CreateTaskInlineEntry.test.tsx
+++ b/src/features/AgentTasks/AgentTaskList/CreateTaskInlineEntry.test.tsx
@@ -1,8 +1,8 @@
/**
* @vitest-environment happy-dom
*/
-import { render, screen } from '@testing-library/react';
-import type { ReactNode } from 'react';
+import { fireEvent, render, screen, waitFor } from '@testing-library/react';
+import type { CSSProperties, ReactNode } from 'react';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import CreateTaskInlineEntry from './CreateTaskInlineEntry';
@@ -12,6 +12,9 @@ const permissionMock = vi.hoisted(() => ({
}));
const focusMock = vi.hoisted(() => vi.fn());
+const createTaskMock = vi.hoisted(() => vi.fn());
+const insertNewlineMock = vi.hoisted(() => vi.fn());
+const editorMarkdownMock = vi.hoisted(() => ({ value: '' }));
const activeWorkspaceMock = vi.hoisted(() => ({
id: 'workspace-1' as string | undefined,
}));
@@ -20,6 +23,7 @@ vi.mock('@lobehub/editor/react', () => ({
useEditor: () => ({
cleanDocument: vi.fn(),
focus: focusMock,
+ getDocument: (format: string) => (format === 'markdown' ? editorMarkdownMock.value : {}),
getLexicalEditor: () => undefined,
}),
}));
@@ -43,8 +47,15 @@ vi.mock('@lobehub/ui/base-ui', () => ({
}));
vi.mock('@/features/EditorCanvas', () => ({
- EditorCanvas: ({ disabled }: { disabled?: boolean }) => (
- <div data-disabled={String(!!disabled)} data-testid="task-editor" />
+ EditorCanvas: ({ disabled, style }: { disabled?: boolean; style?: CSSProperties }) => (
+ <textarea
+ data-disabled={String(!!disabled)}
+ data-padding-bottom={String(style?.paddingBottom)}
+ data-testid="task-editor"
+ onKeyDown={(event) => {
+ if (event.key === 'Enter' && !event.defaultPrevented) insertNewlineMock();
+ }}
+ />
),
}));
@@ -62,7 +73,7 @@ vi.mock('@/business/client/hooks/useActiveWorkspaceId', () => ({
vi.mock('@/store/task', () => ({
useTaskStore: (selector: (state: Record<string, unknown>) => unknown) =>
selector({
- createTask: vi.fn(),
+ createTask: createTaskMock,
isCreatingTask: false,
}),
}));
@@ -113,6 +124,10 @@ describe('CreateTaskInlineEntry', () => {
permissionMock.allowed = true;
activeWorkspaceMock.id = 'workspace-1';
focusMock.mockReset();
+ createTaskMock.mockReset();
+ createTaskMock.mockResolvedValue({ identifier: 'task-1' });
+ editorMarkdownMock.value = '';
+ insertNewlineMock.mockReset();
});
it('renders the task editor as disabled when the user cannot create content', () => {
@@ -135,4 +150,36 @@ describe('CreateTaskInlineEntry', () => {
expect(screen.getByTestId('visibility-trigger')).toHaveAttribute('data-locked', 'false');
});
+
+ it('uses compact editor padding and aligned action controls', () => {
+ const { container } = render(<CreateTaskInlineEntry variant="hero" />);
+
+ const editor = screen.getByTestId('task-editor');
+ expect(editor.parentElement).toHaveStyle({ padding: '12px 16px 0' });
+ expect(editor).toHaveAttribute('data-padding-bottom', '12');
+
+ const assigneeControl = screen.getByText('createTask.assignee').parentElement;
+ expect(assigneeControl?.style.getPropertyValue('--lobe-flex-height')).toBe('24px');
+ expect(assigneeControl?.style.getPropertyValue('--lobe-flex-padding-block')).toBe('3px');
+
+ const attachmentAction = container.querySelector<HTMLElement>('[role="button"]');
+ expect(attachmentAction).toHaveStyle({ height: '24px', width: '24px' });
+ expect(attachmentAction?.parentElement?.style.getPropertyValue('--lobe-flex-align')).toBe(
+ 'center',
+ );
+
+ const visibilityTrigger = screen.getByTestId('visibility-trigger');
+ expect(visibilityTrigger.nextElementSibling).toHaveTextContent('createTask.submit');
+ });
+
+ it('captures Cmd+Enter before the editor inserts a newline and submits the task', async () => {
+ editorMarkdownMock.value = 'Write a project plan';
+
+ render(<CreateTaskInlineEntry variant="hero" />);
+
+ fireEvent.keyDown(screen.getByTestId('task-editor'), { key: 'Enter', metaKey: true });
+
+ expect(insertNewlineMock).not.toHaveBeenCalled();
+ await waitFor(() => expect(createTaskMock).toHaveBeenCalledTimes(1));
+ });
});
diff --git a/src/features/AgentTasks/AgentTaskList/CreateTaskInlineEntry.tsx b/src/features/AgentTasks/AgentTaskList/CreateTaskInlineEntry.tsx
index c15e2a6f5dc..5f6a43bb93b 100644
--- a/src/features/AgentTasks/AgentTaskList/CreateTaskInlineEntry.tsx
+++ b/src/features/AgentTasks/AgentTaskList/CreateTaskInlineEntry.tsx
@@ -288,7 +288,7 @@ const CreateTaskInlineEntry = memo<CreateTaskInlineEntryProps>((props) => {
<Block
style={{ overflow: 'hidden', position: 'relative' }}
variant={'outlined'}
- onKeyDown={handleKeyDown}
+ onKeyDownCapture={handleKeyDown}
>
{!isHero && (
<ActionIcon
@@ -306,7 +306,7 @@ const CreateTaskInlineEntry = memo<CreateTaskInlineEntryProps>((props) => {
// growing the composer until it pushes the task list below the fold.
maxHeight: isHero ? 360 : 200,
overflowY: 'auto',
- padding: isHero ? '20px 24px 4px' : '12px 40px 0 16px',
+ padding: isHero ? '12px 16px 0' : '8px 40px 0 16px',
}}
>
<EditorCanvas
@@ -317,7 +317,7 @@ const CreateTaskInlineEntry = memo<CreateTaskInlineEntryProps>((props) => {
style={{
fontSize: isHero ? 16 : 14,
minHeight: isHero ? 80 : undefined,
- paddingBottom: isHero ? 16 : 12,
+ paddingBottom: 12,
}}
onContentChange={handleContentChange}
/>
@@ -332,14 +332,15 @@ const CreateTaskInlineEntry = memo<CreateTaskInlineEntryProps>((props) => {
paddingInline: '8px 16px',
}}
>
- <Flexbox horizontal gap={2} wrap={'wrap'}>
+ <Flexbox horizontal align={'center'} gap={2} wrap={'wrap'}>
<TaskPriorityTag priority={priority} onChange={setPriority}>
<Block
clickable
horizontal
align="center"
gap={6}
- paddingBlock={4}
+ height={24}
+ paddingBlock={3}
paddingInline={8}
variant={'borderless'}
>
@@ -361,7 +362,8 @@ const CreateTaskInlineEntry = memo<CreateTaskInlineEntryProps>((props) => {
align="center"
clickable={!lockAssignee}
gap={6}
- paddingBlock={4}
+ height={24}
+ paddingBlock={3}
paddingInline={8}
variant={'borderless'}
>
@@ -390,6 +392,15 @@ const CreateTaskInlineEntry = memo<CreateTaskInlineEntryProps>((props) => {
);
})()}
+ <ActionIcon
+ icon={Paperclip}
+ size={'small'}
+ title={t('upload.action.tooltip')}
+ onClick={handleAttach}
+ />
+ </Flexbox>
+
+ <Flexbox horizontal align={'center'} gap={4}>
{activeWorkspaceId && (
<TaskVisibilityTag
visibility={visibility}
@@ -402,29 +413,22 @@ const CreateTaskInlineEntry = memo<CreateTaskInlineEntryProps>((props) => {
}
onChange={setVisibility}
>
- <TaskVisibilityChipLabel visibility={visibility} />
+ <TaskVisibilityChipLabel height={24} paddingBlock={3} visibility={visibility} />
</TaskVisibilityTag>
)}
- <ActionIcon
- icon={Paperclip}
+ <Button
+ disabled={!canCreateTask || isCreating || (!instruction.trim() && !hasAttachments)}
+ loading={isCreating}
+ shape={'round'}
size={'small'}
- title={t('upload.action.tooltip')}
- onClick={handleAttach}
- />
+ title={canCreateTask ? undefined : reason}
+ type={'primary'}
+ onClick={handleSubmit}
+ >
+ {t('createTask.submit')}
+ </Button>
</Flexbox>
-
- <Button
- disabled={!canCreateTask || isCreating || (!instruction.trim() && !hasAttachments)}
- loading={isCreating}
- shape={'round'}
- size={'small'}
- title={canCreateTask ? undefined : reason}
- type={'primary'}
- onClick={handleSubmit}
- >
- {t('createTask.submit')}
- </Button>
</Flexbox>
</Block>
);
diff --git a/src/features/AgentTasks/AgentTaskList/EmptyState.tsx b/src/features/AgentTasks/AgentTaskList/EmptyState.tsx
index ea8c3d62533..c7234bccb3d 100644
--- a/src/features/AgentTasks/AgentTaskList/EmptyState.tsx
+++ b/src/features/AgentTasks/AgentTaskList/EmptyState.tsx
@@ -45,13 +45,10 @@ const EmptyState = memo<EmptyStateProps>(({ agentId }) => {
paddingBlock={48}
wrapperStyle={{ flex: 1, overflowY: 'auto' }}
>
- <Flexbox align={'center'} gap={8}>
+ <Flexbox align={'center'}>
<Text as={'h1'} style={{ fontSize: 24, fontWeight: 600, margin: 0 }}>
{t('taskList.emptyHero.greeting')}
</Text>
- <Text fontSize={14} type={'secondary'}>
- {t('taskList.emptyHero.subtitle')}
- </Text>
</Flexbox>
<CreateTaskInlineEntry agentId={agentId} lockAssignee={!!agentId} variant={'hero'} />
diff --git a/src/features/AgentTasks/AgentTaskList/TaskListVisibilityFilter.test.tsx b/src/features/AgentTasks/AgentTaskList/TaskListVisibilityFilter.test.tsx
new file mode 100644
index 00000000000..b03fda12df7
--- /dev/null
+++ b/src/features/AgentTasks/AgentTaskList/TaskListVisibilityFilter.test.tsx
@@ -0,0 +1,66 @@
+/**
+ * @vitest-environment happy-dom
+ */
+import { render, screen } from '@testing-library/react';
+import type { ReactNode } from 'react';
+import { describe, expect, it, vi } from 'vitest';
+
+import TaskListVisibilityFilter from './TaskListVisibilityFilter';
+
+const taskStoreMock = vi.hoisted(() => ({
+ setListVisibility: vi.fn(),
+ visibility: 'workspace',
+}));
+
+vi.mock('@lobehub/ui', () => ({
+ ActionIcon: () => <span>Visibility</span>,
+ DropdownMenu: ({
+ children,
+ items,
+ }: {
+ children: ReactNode;
+ items: Array<{ extra?: ReactNode; key: string }>;
+ }) => (
+ <>
+ {children}
+ {items.map((item) => (
+ <div data-testid={`extra-${item.key}`} key={item.key}>
+ {item.extra}
+ </div>
+ ))}
+ </>
+ ),
+ Icon: () => <span data-testid="menu-extra-icon" />,
+}));
+
+vi.mock('antd-style', () => ({
+ cssVar: { colorTextSecondary: '#666' },
+}));
+
+vi.mock('@/business/client/hooks/useActiveWorkspaceId', () => ({
+ useActiveWorkspaceId: () => 'workspace-1',
+}));
+
+vi.mock('@/store/task', () => ({
+ useTaskStore: (selector: (state: Record<string, unknown>) => unknown) =>
+ selector({
+ listVisibility: taskStoreMock.visibility,
+ setListVisibility: taskStoreMock.setListVisibility,
+ }),
+}));
+
+vi.mock('react-i18next', () => ({
+ useTranslation: () => ({ t: (key: string) => key }),
+}));
+
+describe('TaskListVisibilityFilter', () => {
+ it('shows a trailing checkmark only for the active visibility option', () => {
+ render(<TaskListVisibilityFilter />);
+
+ expect(screen.getByTestId('extra-workspace')).toContainElement(
+ screen.getByTestId('menu-extra-icon'),
+ );
+ expect(screen.getByTestId('extra-private')).toBeEmptyDOMElement();
+ expect(screen.getByTestId('extra-all')).toBeEmptyDOMElement();
+ });
+});
diff --git a/src/features/AgentTasks/AgentTaskList/TaskListVisibilityFilter.tsx b/src/features/AgentTasks/AgentTaskList/TaskListVisibilityFilter.tsx
index f841f923de4..a5d9e1f039f 100644
--- a/src/features/AgentTasks/AgentTaskList/TaskListVisibilityFilter.tsx
+++ b/src/features/AgentTasks/AgentTaskList/TaskListVisibilityFilter.tsx
@@ -12,6 +12,8 @@ import { useTaskStore } from '@/store/task';
import { taskListSelectors } from '@/store/task/selectors';
import type { TaskListVisibilityFilter as Filter } from '@/store/task/slices/list/initialState';
+import { renderMenuCheck } from '../features/menuExtra';
+
const FILTER_OPTIONS: Array<{ icon: typeof Globe; key: Filter; labelKey: string }> = [
{
icon: LockIcon,
@@ -51,6 +53,7 @@ const TaskListVisibilityFilter = memo(() => {
FILTER_OPTIONS.map((option) => {
const OptionIcon = option.icon;
return {
+ extra: renderMenuCheck(option.key === visibility),
icon: <Icon color={cssVar.colorTextSecondary} icon={OptionIcon} size={16} />,
key: option.key,
label: t(option.labelKey as never),
@@ -60,7 +63,7 @@ const TaskListVisibilityFilter = memo(() => {
},
};
}),
- [setListVisibility, t],
+ [setListVisibility, t, visibility],
);
if (!activeWorkspaceId) return null;
diff --git a/src/features/AgentTasks/features/TaskVisibilityTag.test.tsx b/src/features/AgentTasks/features/TaskVisibilityTag.test.tsx
new file mode 100644
index 00000000000..abb86f988fe
--- /dev/null
+++ b/src/features/AgentTasks/features/TaskVisibilityTag.test.tsx
@@ -0,0 +1,73 @@
+/**
+ * @vitest-environment happy-dom
+ */
+import { render, screen } from '@testing-library/react';
+import type { ReactNode } from 'react';
+import { describe, expect, it, vi } from 'vitest';
+
+import TaskVisibilityTag from './TaskVisibilityTag';
+
+vi.mock('@lobehub/ui', () => ({
+ DropdownMenu: ({
+ children,
+ items,
+ }: {
+ children: ReactNode;
+ items: Array<{ extra?: ReactNode; key: string }>;
+ }) => (
+ <>
+ {children}
+ {items.map((item) => (
+ <div data-testid={`extra-${item.key}`} key={item.key}>
+ {item.extra}
+ </div>
+ ))}
+ </>
+ ),
+ Icon: () => <span data-testid="menu-extra-icon" />,
+ Tooltip: ({ children }: { children: ReactNode }) => children,
+}));
+
+vi.mock('antd-style', () => ({
+ createStaticStyles: () => ({ trigger: 'trigger', triggerDisabled: 'trigger-disabled' }),
+ cssVar: {
+ colorTextDescription: '#999',
+ colorTextSecondary: '#666',
+ },
+}));
+
+vi.mock('@/business/client/hooks/useActiveWorkspaceId', () => ({
+ useActiveWorkspaceId: () => 'workspace-1',
+}));
+
+vi.mock('@/hooks/usePermission', () => ({
+ usePermission: () => ({ allowed: true, reason: '' }),
+}));
+
+vi.mock('@/store/task', () => ({
+ useTaskStore: (selector: (state: Record<string, unknown>) => unknown) =>
+ selector({ updateTaskVisibility: vi.fn() }),
+}));
+
+vi.mock('react-i18next', () => ({
+ useTranslation: () => ({
+ t: (_key: string, options?: { defaultValue?: string }) => options?.defaultValue,
+ }),
+}));
+
+describe('TaskVisibilityTag', () => {
+ it('shows only the current checkmark without unsupported numeric shortcut hints', () => {
+ render(
+ <TaskVisibilityTag visibility="private">
+ <span>Visibility</span>
+ </TaskVisibilityTag>,
+ );
+
+ expect(screen.getByTestId('extra-private')).toContainElement(
+ screen.getByTestId('menu-extra-icon'),
+ );
+ expect(screen.getByTestId('extra-public')).toBeEmptyDOMElement();
+ expect(screen.queryByText('1')).not.toBeInTheDocument();
+ expect(screen.queryByText('2')).not.toBeInTheDocument();
+ });
+});
diff --git a/src/features/AgentTasks/features/TaskVisibilityTag.tsx b/src/features/AgentTasks/features/TaskVisibilityTag.tsx
index c58955754d2..12db15c0de6 100644
--- a/src/features/AgentTasks/features/TaskVisibilityTag.tsx
+++ b/src/features/AgentTasks/features/TaskVisibilityTag.tsx
@@ -9,7 +9,7 @@ import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspace
import { usePermission } from '@/hooks/usePermission';
import { useTaskStore } from '@/store/task';
-import { renderMenuExtra } from './menuExtra';
+import { renderMenuCheck } from './menuExtra';
import { getTaskVisibilityDefaultLabel, getTaskVisibilityLabelKey } from './taskVisibilityLabel';
const styles = createStaticStyles(({ css, cssVar }) => ({
@@ -101,11 +101,11 @@ const TaskVisibilityTag = memo<TaskVisibilityTagProps>(
const menuItems = useMemo<DropdownItem[]>(
() =>
- VISIBILITY_OPTIONS.map((option, index) => {
+ VISIBILITY_OPTIONS.map((option) => {
const OptionIcon = option === 'private' ? LockIcon : UsersIcon;
const isCurrent = option === visibility;
return {
- extra: renderMenuExtra(String(index + 1), isCurrent),
+ extra: renderMenuCheck(isCurrent),
icon: <Icon color={cssVar.colorTextSecondary} icon={OptionIcon} size={16} />,
key: option,
label: t(getTaskVisibilityLabelKey(option) as never, {
diff --git a/src/features/AgentTasks/features/menuExtra.tsx b/src/features/AgentTasks/features/menuExtra.tsx
index 2cf05d2267a..3ec169b31b8 100644
--- a/src/features/AgentTasks/features/menuExtra.tsx
+++ b/src/features/AgentTasks/features/menuExtra.tsx
@@ -4,6 +4,8 @@ import { CheckIcon } from 'lucide-react';
const renderCheck = () => <Icon color={cssVar.colorTextSecondary} icon={CheckIcon} size={14} />;
+export const renderMenuCheck = (isCurrent: boolean) => (isCurrent ? renderCheck() : undefined);
+
export const renderMenuExtra = (shortcut: string, isCurrent: boolean) =>
isCurrent ? (
<Flexbox horizontal align={'center'} gap={6}>
diff --git a/src/features/NavHeader/index.tsx b/src/features/NavHeader/index.tsx
index 7dc0cc43314..82261951443 100644
--- a/src/features/NavHeader/index.tsx
+++ b/src/features/NavHeader/index.tsx
@@ -37,7 +37,7 @@ const NavHeader = memo<NavHeaderProps>(
}) => {
const expand = useGlobalStore(systemStatusSelectors.showLeftPanel);
- const noContent = !left && !right;
+ const noContent = !left && !right && !children;
// When empty, this header only rendered to host the collapse toggle. Hide it
// when expanded, and also on macOS desktop where the toggle moved to the titlebar.
diff --git a/src/features/PageEditor/Copilot/Welcome.tsx b/src/features/PageEditor/Copilot/Welcome.tsx
index eaff1f9cef6..e9cd60faf22 100644
--- a/src/features/PageEditor/Copilot/Welcome.tsx
+++ b/src/features/PageEditor/Copilot/Welcome.tsx
@@ -1,6 +1,6 @@
'use client';
-import { Avatar, Flexbox, Markdown, Text } from '@lobehub/ui';
+import { Avatar, Flexbox, Text } from '@lobehub/ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -29,9 +29,6 @@ const AgentBuilderWelcome = memo(() => {
<Text fontSize={24} weight={'bold'}>
{t('pageCopilot.title')}
</Text>
- <Markdown fontSize={14} variant={'chat'}>
- {t('pageCopilot.welcome')}
- </Markdown>
<SuggestQuestions count={3} mode="write" />
</Flexbox>
</>
diff --git a/src/features/PageEditor/Header/useMenu.test.tsx b/src/features/PageEditor/Header/useMenu.test.tsx
index 43216a77cae..bda22be79f9 100644
--- a/src/features/PageEditor/Header/useMenu.test.tsx
+++ b/src/features/PageEditor/Header/useMenu.test.tsx
@@ -2,6 +2,7 @@
* @vitest-environment happy-dom
*/
import { renderHook } from '@testing-library/react';
+import { renderToStaticMarkup } from 'react-dom/server';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { useMenu } from './useMenu';
@@ -11,13 +12,32 @@ const permissionMock = vi.hoisted(() => ({
edit_own_content: true,
}));
+const headerMock = vi.hoisted(() => ({
+ activeWorkspaceId: 'workspace-1' as string | undefined,
+ authorName: undefined as string | undefined,
+ currentUserId: 'user-1',
+ document: {
+ id: 'doc-1',
+ updatedAt: undefined as string | undefined,
+ userId: 'user-1',
+ visibility: 'private' as 'private' | 'public',
+ },
+ transferMenuItems: vi.fn(() => [{ key: 'transfer-document', label: 'Move' }]),
+}));
+
vi.mock('react-i18next', () => ({
useTranslation: () => ({
i18n: {
language: 'en-US',
resolvedLanguage: 'en-US',
},
- t: (key: string) => key,
+ t: (key: string, options?: Record<string, unknown>) => {
+ if (key === 'pageEditor.editedAtBy') {
+ return `Last edited on ${options?.time} by ${options?.name}`;
+ }
+
+ return key;
+ },
}),
}));
@@ -59,15 +79,15 @@ vi.mock('antd-style', () => ({
}));
vi.mock('@/business/client/hooks/useActiveWorkspaceId', () => ({
- useActiveWorkspaceId: () => undefined,
+ useActiveWorkspaceId: () => headerMock.activeWorkspaceId,
}));
vi.mock('@/business/client/hooks/useAuthorInfo', () => ({
- useAuthorInfo: () => undefined,
+ useAuthorInfo: () => ({ fullName: headerMock.authorName }),
}));
vi.mock('@/business/client/hooks/useDocumentTransferMenuItem', () => ({
- useDocumentTransferMenuItem: () => null,
+ useDocumentTransferMenuItem: headerMock.transferMenuItems,
}));
vi.mock('@/features/VisibilityConfirmContent', () => ({
@@ -87,7 +107,7 @@ vi.mock('@/store/document', () => ({
vi.mock('@/store/page', () => ({
pageSelectors: {
- getDocumentById: (_id: string) => (_s: unknown) => undefined,
+ getDocumentById: (_id: string) => (_s: unknown) => headerMock.document,
},
usePageStore: (selector: (state: Record<string, unknown>) => unknown) =>
selector({
@@ -97,12 +117,13 @@ vi.mock('@/store/page', () => ({
}));
vi.mock('@/store/user', () => ({
- useUserStore: (selector: (state: Record<string, unknown>) => unknown) => selector({}),
+ useUserStore: (selector: (state: { user: { id: string } }) => unknown) =>
+ selector({ user: { id: headerMock.currentUserId } }),
}));
vi.mock('@/store/user/selectors', () => ({
userProfileSelectors: {
- userId: () => undefined,
+ userId: (state: { user: { id: string } }) => state.user.id,
},
}));
@@ -157,6 +178,38 @@ describe('PageEditor header menu', () => {
beforeEach(() => {
permissionMock.create_content = true;
permissionMock.edit_own_content = true;
+ headerMock.activeWorkspaceId = 'workspace-1';
+ headerMock.authorName = undefined;
+ headerMock.document.updatedAt = undefined;
+ headerMock.document.userId = headerMock.currentUserId;
+ headerMock.document.visibility = 'private';
+ headerMock.transferMenuItems.mockClear();
+ });
+
+ it('uses the Move action and does not expose a separate publish action', () => {
+ const { result } = renderHook(() => useMenu());
+
+ expect(headerMock.transferMenuItems).toHaveBeenCalledWith('doc-1', {
+ defaultTargetVisibility: 'private',
+ preferCurrentWorkspace: true,
+ transferLabel: 'pageEditor.menu.move',
+ });
+ expect(getMenuItem(result.current.menuItems, 'transfer-document')).toMatchObject({
+ label: 'Move',
+ });
+ expect(getMenuItem(result.current.menuItems, 'publish-to-workspace')).toBeUndefined();
+ });
+
+ it('renders the last edit footer as natural language without an icon', () => {
+ headerMock.authorName = 'Lin';
+ headerMock.document.updatedAt = '2026-07-15T08:30:00.000Z';
+
+ const { result } = renderHook(() => useMenu());
+ const infoItem = getMenuItem(result.current.menuItems, 'page-info');
+
+ expect(infoItem?.icon).toBeUndefined();
+ expect(renderToStaticMarkup(infoItem?.label)).toContain('Last edited on');
+ expect(renderToStaticMarkup(infoItem?.label)).toContain('by Lin');
});
it('disables mutating page actions for workspace viewers', () => {
diff --git a/src/features/PageEditor/Header/useMenu.tsx b/src/features/PageEditor/Header/useMenu.tsx
index 0e0533c15ee..e71d6202ed2 100644
--- a/src/features/PageEditor/Header/useMenu.tsx
+++ b/src/features/PageEditor/Header/useMenu.tsx
@@ -1,20 +1,10 @@
import { isDesktop } from '@lobechat/const';
-import { type DropdownItem } from '@lobehub/ui';
+import type { DropdownItem } from '@lobehub/ui';
import { Icon } from '@lobehub/ui';
import { confirmModal } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { cssVar, useResponsive } from 'antd-style';
-import {
- Clock3Icon,
- CopyPlus,
- Download,
- EyeOffIcon,
- Link2,
- Maximize2,
- Trash2,
- UserRound,
- UsersIcon,
-} from 'lucide-react';
+import { Clock3Icon, CopyPlus, Download, EyeOffIcon, Link2, Maximize2, Trash2 } from 'lucide-react';
import { useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -62,18 +52,18 @@ export const useMenu = (): { menuItems: any[] } => {
const duplicateDocument = useFileStore((s) => s.duplicateDocument);
const setRightPanelMode = usePageEditorStore((s) => s.setRightPanelMode);
- const transferMenuItems = useDocumentTransferMenuItem(documentId) as DropdownItem[] | null;
-
- const publishPageToWorkspace = usePageStore((s) => s.publishPageToWorkspace);
- const setPageVisibility = usePageStore((s) => s.setPageVisibility);
const activeWorkspaceId = useActiveWorkspaceId();
const currentUserId = useUserStore(userProfileSelectors.userId);
// Visibility toggles are creator-only — the backend rejects non-owner writes,
// but the menu entry itself is the wrong affordance on someone else's page.
const isOwnPage = Boolean(currentUserId && pageDocument?.userId === currentUserId);
- const canPublish = Boolean(
- activeWorkspaceId && isOwnPage && pageDocument?.visibility === 'private' && canEditPage,
- );
+ const transferMenuItems = useDocumentTransferMenuItem(documentId, {
+ defaultTargetVisibility: pageDocument?.visibility === 'public' ? 'public' : 'private',
+ preferCurrentWorkspace: Boolean(activeWorkspaceId && isOwnPage && canEditPage),
+ transferLabel: t('pageEditor.menu.move'),
+ }) as DropdownItem[] | null;
+
+ const setPageVisibility = usePageStore((s) => s.setPageVisibility);
const canMakePrivate = Boolean(
activeWorkspaceId && isOwnPage && pageDocument?.visibility === 'public' && canEditPage,
);
@@ -99,25 +89,6 @@ export const useMenu = (): { menuItems: any[] } => {
}
}, [canCreatePage, documentId, duplicateDocument, message, t]);
- const handlePublish = useCallback(() => {
- if (!canPublish || !documentId) return;
- confirmModal({
- cancelText: t('cancel', { ns: 'common' }),
- content: <VisibilityConfirmContent variant="publish" />,
- okText: t('continue', { ns: 'common' }),
- onOk: async () => {
- try {
- await publishPageToWorkspace(documentId);
- message.success(t('pageList.publishSuccess'));
- } catch (error) {
- console.error('Failed to publish page:', error);
- message.error(t('pageList.publishError'));
- }
- },
- title: t('pageList.publishConfirm.title'),
- });
- }, [canPublish, documentId, publishPageToWorkspace, message, t]);
-
const handleMakePrivate = useCallback(() => {
if (!canMakePrivate || !documentId) return;
confirmModal({
@@ -230,16 +201,6 @@ export const useMenu = (): { menuItems: any[] } => {
type: 'divider' as const,
},
...((transferMenuItems ?? []) as DropdownItem[]),
- ...(canPublish
- ? [
- {
- icon: <Icon icon={UsersIcon} />,
- key: 'publish-to-workspace',
- label: t('pageList.publishToWorkspace'),
- onClick: handlePublish,
- } as DropdownItem,
- ]
- : []),
...(canMakePrivate
? [
{
@@ -271,20 +232,19 @@ export const useMenu = (): { menuItems: any[] } => {
},
{
disabled: true,
- icon: authorName ? <Icon icon={UserRound} /> : undefined,
key: 'page-info',
label: (
<span style={{ color: cssVar.colorTextTertiary, fontSize: 12, lineHeight: 1.6 }}>
- {[
- authorName,
- lastUpdatedTime
+ {authorName && lastUpdatedTime
+ ? t('pageEditor.editedAtBy', {
+ name: authorName,
+ time: formatPageEditorInfoTime(lastUpdatedTime, dateLocale),
+ })
+ : lastUpdatedTime
? t('pageEditor.editedAt', {
time: formatPageEditorInfoTime(lastUpdatedTime, dateLocale),
})
- : '',
- ]
- .filter(Boolean)
- .join(' · ')}
+ : t('pageEditor.editedBy', { name: authorName })}
</span>
),
},
@@ -296,7 +256,6 @@ export const useMenu = (): { menuItems: any[] } => {
authorName,
canCreatePage,
canEditPage,
- canPublish,
canMakePrivate,
storeApi,
t,
@@ -308,7 +267,6 @@ export const useMenu = (): { menuItems: any[] } => {
togglePageAgentPanel,
showViewModeSwitch,
handleDuplicate,
- handlePublish,
handleMakePrivate,
handleExportMarkdown,
transferMenuItems,
diff --git a/src/features/Pages/PageLayout/Body/List/Item/useDropdownMenu.test.tsx b/src/features/Pages/PageLayout/Body/List/Item/useDropdownMenu.test.tsx
index cea1956a378..72a1d042e47 100644
--- a/src/features/Pages/PageLayout/Body/List/Item/useDropdownMenu.test.tsx
+++ b/src/features/Pages/PageLayout/Body/List/Item/useDropdownMenu.test.tsx
@@ -13,6 +13,8 @@ const permissionMock = vi.hoisted(() => ({
const CURRENT_USER_ID = vi.hoisted(() => 'user-1');
+const useDocumentTransferMenuItemMock = vi.hoisted(() => vi.fn(() => []));
+
const storeMock = vi.hoisted(() => ({
activeWorkspaceId: undefined as string | undefined,
document: undefined as
@@ -111,7 +113,7 @@ vi.mock('@/business/client/hooks/useActiveWorkspaceSlug', () => ({
}));
vi.mock('@/business/client/hooks/useDocumentTransferMenuItem', () => ({
- useDocumentTransferMenuItem: () => [],
+ useDocumentTransferMenuItem: useDocumentTransferMenuItemMock,
}));
const getMenuItem = (
@@ -121,12 +123,21 @@ const getMenuItem = (
describe('Page list item dropdown menu', () => {
beforeEach(() => {
+ vi.clearAllMocks();
permissionMock.create_content = true;
permissionMock.edit_own_content = true;
storeMock.activeWorkspaceId = undefined;
storeMock.document = undefined;
});
+ it('labels the page transfer action as Move', () => {
+ renderHook(() => useDropdownMenu({ pageId: 'page-1', toggleEditing: vi.fn() }));
+
+ expect(useDocumentTransferMenuItemMock).toHaveBeenCalledWith('page-1', {
+ transferLabel: 'pageEditor.menu.move',
+ });
+ });
+
it('disables page management actions for workspace viewers', () => {
permissionMock.create_content = false;
permissionMock.edit_own_content = false;
diff --git a/src/features/Pages/PageLayout/Body/List/Item/useDropdownMenu.tsx b/src/features/Pages/PageLayout/Body/List/Item/useDropdownMenu.tsx
index b3602c77c4f..2cbb6e90523 100644
--- a/src/features/Pages/PageLayout/Body/List/Item/useDropdownMenu.tsx
+++ b/src/features/Pages/PageLayout/Body/List/Item/useDropdownMenu.tsx
@@ -43,7 +43,9 @@ export const useDropdownMenu = ({
const publishPageToWorkspace = usePageStore((s) => s.publishPageToWorkspace);
const setPageVisibility = usePageStore((s) => s.setPageVisibility);
const document = usePageStore((s) => pageSelectors.getDocumentById(pageId)(s));
- const transferMenuItems = useDocumentTransferMenuItem(pageId);
+ const transferMenuItems = useDocumentTransferMenuItem(pageId, {
+ transferLabel: t('pageEditor.menu.move', { ns: 'file' }),
+ });
const currentUserId = useUserStore(userProfileSelectors.userId);
const isPrivate = document?.visibility === 'private';
diff --git a/src/features/SettingsSearch/items.ts b/src/features/SettingsSearch/items.ts
index 4b903901fe7..dca6ff82c0f 100644
--- a/src/features/SettingsSearch/items.ts
+++ b/src/features/SettingsSearch/items.ts
@@ -568,8 +568,9 @@ export const SETTINGS_SEARCH_ITEMS: SettingsSearchItem[] = [
},
{
anchor: 'usage-overview',
- keywords: ['usage', 'quota'],
- labelKey: 'usage.title',
+ descKey: 'usage.credit.desc',
+ keywords: ['usage', 'quota', 'credit'],
+ labelKey: 'usage.credit.title',
ns: 'subscription',
tab: SettingsTabs.Usage,
},
diff --git a/src/features/User/UserPanel/PanelContent.tsx b/src/features/User/UserPanel/PanelContent.tsx
index e4e8658027a..9bb06939265 100644
--- a/src/features/User/UserPanel/PanelContent.tsx
+++ b/src/features/User/UserPanel/PanelContent.tsx
@@ -4,7 +4,7 @@ import { type FC } from 'react';
import BusinessPanelContent from '@/business/client/features/User/BusinessPanelContent';
import UserPanelStatistics from '@/business/client/features/User/UserPanelStatistics';
import UserPanelWorkspaceSection from '@/business/client/features/User/UserPanelWorkspaceSection';
-import Menu from '@/components/Menu';
+import Menu, { type MenuProps } from '@/components/Menu';
import { isDesktop } from '@/const/version';
import UserInfo from '@/features/User/UserInfo';
import { navigateToDesktopOnboarding } from '@/routes/(desktop)/desktop-onboarding/navigation';
@@ -14,7 +14,6 @@ import { useUserStore } from '@/store/user';
import { authSelectors } from '@/store/user/selectors';
import UserLoginOrSignup from '../UserLoginOrSignup';
-import LangButton from './LangButton';
import { useMenu } from './useMenu';
const PanelContent: FC<{ closePopover: () => void }> = ({ closePopover }) => {
@@ -48,6 +47,15 @@ const PanelContent: FC<{ closePopover: () => void }> = ({ closePopover }) => {
closePopover();
};
+ const handleMenuClick: MenuProps['onClick'] = ({ key }) => {
+ if (key === 'logout') {
+ void handleSignOut();
+ return;
+ }
+
+ closePopover();
+ };
+
return (
<Flexbox gap={2} style={{ minWidth: 300 }}>
{isDesktop || isLoginWithAuth ? (
@@ -61,9 +69,7 @@ const PanelContent: FC<{ closePopover: () => void }> = ({ closePopover }) => {
<UserLoginOrSignup onClick={handleSignIn} />
)}
- <Menu items={mainItems} onClick={closePopover} />
- <LangButton placement={'right' as any} />
- <Menu items={logoutItems} onClick={handleSignOut} />
+ <Menu items={[...(mainItems ?? []), ...(logoutItems ?? [])]} onClick={handleMenuClick} />
</Flexbox>
);
};
diff --git a/src/features/User/__tests__/PanelContent.test.tsx b/src/features/User/__tests__/PanelContent.test.tsx
index 9fc6a8ee58d..3b41ca2ae0e 100644
--- a/src/features/User/__tests__/PanelContent.test.tsx
+++ b/src/features/User/__tests__/PanelContent.test.tsx
@@ -20,7 +20,7 @@ vi.mock('@/components/Menu', () => ({
<div>
Mocked Menu
{items.map((item: any) => (
- <button key={item.key} type={'button'} onClick={onClick}>
+ <button key={item.key} type={'button'} onClick={() => onClick({ key: item.key })}>
{item.label}
</button>
))}
@@ -54,6 +54,10 @@ vi.mock('../UserLoginOrSignup', () => ({
)),
}));
+vi.mock('../UserPanel/LangButton', () => ({
+ default: () => <div>Language chooser</div>,
+}));
+
vi.mock('../DataStatistics', () => ({
default: vi.fn(() => <div>Mocked DataStatistics</div>),
}));
@@ -103,14 +107,15 @@ describe('PanelContent', () => {
expect(screen.queryByText('Mocked UserInfo')).not.toBeInTheDocument();
});
- it('should render logout items when user is signed in', () => {
+ it('should render profile actions in a single menu when user is signed in', () => {
act(() => {
useUserStore.setState({ isSignedIn: true });
});
renderWithRouter(<PanelContent closePopover={closePopover} />);
- expect(screen.getAllByText('Mocked Menu').length).toBe(2);
+ expect(screen.getAllByText('Mocked Menu')).toHaveLength(1);
+ expect(screen.getByText('Logout')).toBeInTheDocument();
});
it('should render SignInBlock when user is not signed in', () => {
@@ -128,5 +133,6 @@ describe('PanelContent', () => {
renderWithRouter(<PanelContent closePopover={closePopover} />);
expect(screen.getAllByText('Mocked Menu').length).toBeGreaterThan(0);
+ expect(screen.queryByText('Language chooser')).not.toBeInTheDocument();
});
});
diff --git a/src/features/WorkspaceSetting/Title.tsx b/src/features/WorkspaceSetting/Title.tsx
new file mode 100644
index 00000000000..78ba5ded223
--- /dev/null
+++ b/src/features/WorkspaceSetting/Title.tsx
@@ -0,0 +1,12 @@
+import { Text } from '@lobehub/ui';
+import { memo, type PropsWithChildren } from 'react';
+
+const WorkspaceSettingsTitle = memo<PropsWithChildren>(({ children }) => (
+ <Text strong as="h2" style={{ fontSize: 20, margin: 0 }}>
+ {children}
+ </Text>
+));
+
+WorkspaceSettingsTitle.displayName = 'WorkspaceSettingsTitle';
+
+export default WorkspaceSettingsTitle;
diff --git a/src/layout/SPAGlobalProvider/Locale.tsx b/src/layout/SPAGlobalProvider/Locale.tsx
index a53bd26c9f5..2889086a6fd 100644
--- a/src/layout/SPAGlobalProvider/Locale.tsx
+++ b/src/layout/SPAGlobalProvider/Locale.tsx
@@ -63,6 +63,24 @@ const Locale = memo<LocaleLayoutProps>(({ children, defaultLang, antdLocale }) =
if (defaultLang) updateDayjs(defaultLang);
}, [defaultLang]);
+ // Load the antd locale for the initial language too — `languageChanged` can fire
+ // before the listener below is registered, leaving ConfigProvider without a locale
+ // (antd then falls back to en_US, and pro-components intl to zh-CN)
+ useEffect(() => {
+ if (locale || !defaultLang) return;
+ let canceled = false;
+ getAntdLocale(defaultLang)
+ .then((initialLocale) => {
+ if (!canceled) setLocale((prev: any) => prev ?? initialLocale);
+ })
+ .catch((error) => {
+ console.error(`antd locale for ${defaultLang} not found`, error);
+ });
+ return () => {
+ canceled = true;
+ };
+ }, [defaultLang, locale]);
+
if (!i18n.instance.isInitialized)
i18n.init().then(async () => {
const resolvedLang = i18n.instance.language || defaultLang;
diff --git a/src/routes/(main)/(create)/features/GenerationInput/GenerationMediaModeSegment.test.tsx b/src/routes/(main)/(create)/features/GenerationInput/GenerationMediaModeSegment.test.tsx
new file mode 100644
index 00000000000..738fdd4ca07
--- /dev/null
+++ b/src/routes/(main)/(create)/features/GenerationInput/GenerationMediaModeSegment.test.tsx
@@ -0,0 +1,86 @@
+/**
+ * @vitest-environment happy-dom
+ */
+import { act, render, screen } from '@testing-library/react';
+import type { ReactNode } from 'react';
+import { describe, expect, it, vi } from 'vitest';
+
+import GenerationMediaModeSegment from './GenerationMediaModeSegment';
+
+interface SegmentedCapture {
+ classNames?: { item?: string; itemLabel?: string };
+ onChange?: (value: string) => void;
+ options?: Array<{ icon?: ReactNode; label?: ReactNode; value: string }>;
+ value?: string;
+}
+
+const componentMocks = vi.hoisted(() => ({
+ navigate: vi.fn(),
+ segmented: undefined as SegmentedCapture | undefined,
+}));
+
+vi.mock('@lobehub/ui', () => ({
+ Flexbox: ({ children }: { children: ReactNode }) => <div>{children}</div>,
+ Icon: () => <span data-testid="mode-icon" />,
+}));
+
+vi.mock('@lobehub/ui/base-ui', () => ({
+ Segmented: (props: SegmentedCapture) => {
+ componentMocks.segmented = props;
+ return (
+ <div data-testid="mode-toggle-group">
+ {props.options?.map((option) => (
+ <span key={option.value}>{option.icon}</span>
+ ))}
+ </div>
+ );
+ },
+ Select: () => <div data-testid="mode-select" />,
+}));
+
+vi.mock('antd-style', () => ({
+ createStaticStyles: () => ({
+ heroSelect: 'hero-select',
+ heroText: 'hero-text',
+ toolbarItem: 'toolbar-item',
+ toolbarLabel: 'toolbar-label',
+ }),
+}));
+
+vi.mock('@/features/Workspace/useWorkspaceAwareNavigate', () => ({
+ useWorkspaceAwareNavigate: () => componentMocks.navigate,
+}));
+
+vi.mock('react-i18next', () => ({
+ useTranslation: () => ({ t: (key: string) => key }),
+}));
+
+describe('GenerationMediaModeSegment', () => {
+ it('uses an icon-only toggle group in the composer toolbar', () => {
+ render(<GenerationMediaModeSegment mode="image" />);
+
+ expect(screen.getByTestId('mode-toggle-group')).toBeInTheDocument();
+ expect(screen.queryByTestId('mode-select')).not.toBeInTheDocument();
+ expect(screen.getAllByTestId('mode-icon')).toHaveLength(2);
+ expect(screen.queryByText('tab.image')).not.toBeInTheDocument();
+ expect(screen.queryByText('tab.video')).not.toBeInTheDocument();
+ expect(componentMocks.segmented?.options?.map((option) => option.label)).toEqual([
+ 'tab.image',
+ 'tab.video',
+ ]);
+ expect(componentMocks.segmented?.classNames).toEqual({
+ item: 'toolbar-item',
+ itemLabel: 'toolbar-label',
+ });
+
+ act(() => componentMocks.segmented?.onChange?.('video'));
+ expect(componentMocks.navigate).toHaveBeenCalledWith('/video');
+ });
+
+ it('keeps the labeled select in the hero title', () => {
+ render(<GenerationMediaModeSegment layout="hero" mode="image" />);
+
+ expect(screen.getByTestId('mode-select')).toBeInTheDocument();
+ expect(screen.queryByTestId('mode-toggle-group')).not.toBeInTheDocument();
+ });
+});
diff --git a/src/routes/(main)/(create)/features/GenerationInput/GenerationMediaModeSegment.tsx b/src/routes/(main)/(create)/features/GenerationInput/GenerationMediaModeSegment.tsx
index cda11488bc8..dae7aec8443 100644
--- a/src/routes/(main)/(create)/features/GenerationInput/GenerationMediaModeSegment.tsx
+++ b/src/routes/(main)/(create)/features/GenerationInput/GenerationMediaModeSegment.tsx
@@ -1,7 +1,7 @@
'use client';
import { Flexbox, Icon } from '@lobehub/ui';
-import { Select, type SelectProps } from '@lobehub/ui/base-ui';
+import { Segmented, type SegmentedOptions, Select, type SelectProps } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { ImageIcon, Video } from 'lucide-react';
import { memo, useCallback, useMemo } from 'react';
@@ -10,15 +10,12 @@ import { useTranslation } from 'react-i18next';
import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
export interface GenerationMediaModeSegmentProps {
- /** `hero`: large inline headline select (cyan, borderless). `toolbar`: compact control in the input bar. */
+ /** `hero`: large labeled headline select. `toolbar`: compact icon-only toggle group. */
layout?: 'hero' | 'toolbar';
mode: 'image' | 'video';
}
-const styles = createStaticStyles(({ css, cssVar }) => ({
- lite: css`
- height: 36px;
- `,
+const styles = createStaticStyles(({ css }) => ({
heroSelect: css`
width: auto;
font-size: inherit;
@@ -29,6 +26,14 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
font-weight: 600;
line-height: 1.2;
`,
+ toolbarItem: css`
+ width: 30px;
+ height: 30px;
+ padding-inline: 0;
+ `,
+ toolbarLabel: css`
+ display: none;
+ `,
}));
const GenerationMediaModeSegment = memo<GenerationMediaModeSegmentProps>(
@@ -37,13 +42,12 @@ const GenerationMediaModeSegment = memo<GenerationMediaModeSegmentProps>(
const navigate = useWorkspaceAwareNavigate();
const isHero = layout === 'hero';
- const options = useMemo<SelectProps['options']>(
+ const heroOptions = useMemo<SelectProps['options']>(
() => [
{
label: (
<Flexbox horizontal align="center" gap={8}>
- {!isHero && <Icon icon={ImageIcon} />}
- <span className={isHero ? styles.heroText : undefined}>{t('tab.image')}</span>
+ <span className={styles.heroText}>{t('tab.image')}</span>
</Flexbox>
),
value: 'image',
@@ -51,42 +55,50 @@ const GenerationMediaModeSegment = memo<GenerationMediaModeSegmentProps>(
{
label: (
<Flexbox horizontal align="center" gap={8}>
- {!isHero && <Icon icon={Video} />}
- <span className={isHero ? styles.heroText : undefined}>{t('tab.video')}</span>
+ <span className={styles.heroText}>{t('tab.video')}</span>
</Flexbox>
),
value: 'video',
},
],
- [t, isHero],
+ [t],
+ );
+
+ const toolbarOptions = useMemo<SegmentedOptions<'image' | 'video'>>(
+ () => [
+ {
+ icon: <Icon icon={ImageIcon} size={16} />,
+ label: t('tab.image'),
+ title: t('tab.image'),
+ value: 'image',
+ },
+ {
+ icon: <Icon icon={Video} size={16} />,
+ label: t('tab.video'),
+ title: t('tab.video'),
+ value: 'video',
+ },
+ ],
+ [t],
);
const labelRender: SelectProps['labelRender'] = useCallback(
(props: any) => {
const v = String((props as { value?: string }).value ?? '');
- const isVideo = v === 'video';
- const text = isVideo ? t('tab.video') : t('tab.image');
- if (isHero) {
- return (
- <span
- style={{
- fontSize: 'inherit',
- fontWeight: 600,
- whiteSpace: 'nowrap',
- }}
- >
- {text}
- </span>
- );
- }
+ const text = v === 'video' ? t('tab.video') : t('tab.image');
return (
- <Flexbox horizontal align="center" gap={6}>
- <Icon icon={isVideo ? Video : ImageIcon} size={16} />
- <span style={{ whiteSpace: 'nowrap' }}>{text}</span>
- </Flexbox>
+ <span
+ style={{
+ fontSize: 'inherit',
+ fontWeight: 600,
+ whiteSpace: 'nowrap',
+ }}
+ >
+ {text}
+ </span>
);
},
- [isHero, t],
+ [t],
);
const handleChange = useCallback(
@@ -97,15 +109,26 @@ const GenerationMediaModeSegment = memo<GenerationMediaModeSegmentProps>(
[mode, navigate],
);
+ if (!isHero)
+ return (
+ <Segmented<'image' | 'video'>
+ classNames={{ item: styles.toolbarItem, itemLabel: styles.toolbarLabel }}
+ options={toolbarOptions}
+ size={'small'}
+ value={mode}
+ onChange={handleChange}
+ />
+ );
+
return (
<Select
- className={isHero ? styles.heroSelect : styles.lite}
+ className={styles.heroSelect}
labelRender={labelRender}
- options={options}
+ options={heroOptions}
popupMatchSelectWidth={false}
- size={isHero ? 'large' : 'middle'}
+ size={'large'}
value={mode}
- variant={isHero ? 'borderless' : 'filled'}
+ variant={'borderless'}
onChange={handleChange}
/>
);
diff --git a/src/routes/(main)/(create)/image/features/PromptInput/index.tsx b/src/routes/(main)/(create)/image/features/PromptInput/index.tsx
index 192e384a514..107dec9173a 100644
--- a/src/routes/(main)/(create)/image/features/PromptInput/index.tsx
+++ b/src/routes/(main)/(create)/image/features/PromptInput/index.tsx
@@ -271,11 +271,6 @@ const PromptInput = ({ showTitle = false }: PromptInputProps) => {
style={canCreate ? undefined : { opacity: 0.5, pointerEvents: 'none' }}
>
<GenerationMediaModeSegment mode={'image'} />
- <GenerationVisibilitySelector
- disabledReason={visibilityLockedReason}
- visibility={displayVisibility}
- onChange={setNewGenerationTopicVisibility}
- />
<ModelSwitchPanel
ModelItemComponent={ImageModelItem}
enabledList={enabledImageModelList}
@@ -368,15 +363,22 @@ const PromptInput = ({ showTitle = false }: PromptInputProps) => {
hasRefImages ? t('config.prompt.placeholderWithRef') : t('config.prompt.placeholder')
}
rightActions={
- <PromptTransformAction
- mode={'image'}
- prompt={value}
- onPromptChange={(next) => {
- if (!canCreate) return;
-
- setValue(next as any);
- }}
- />
+ <>
+ <PromptTransformAction
+ mode={'image'}
+ prompt={value}
+ onPromptChange={(next) => {
+ if (!canCreate) return;
+
+ setValue(next as any);
+ }}
+ />
+ <GenerationVisibilitySelector
+ disabledReason={visibilityLockedReason}
+ visibility={displayVisibility}
+ onChange={setNewGenerationTopicVisibility}
+ />
+ </>
}
onGenerate={handleGenerate}
onValueChange={setValue}
diff --git a/src/routes/(main)/(create)/video/features/PromptInput/index.tsx b/src/routes/(main)/(create)/video/features/PromptInput/index.tsx
index 3a2be86924e..42072e3a728 100644
--- a/src/routes/(main)/(create)/video/features/PromptInput/index.tsx
+++ b/src/routes/(main)/(create)/video/features/PromptInput/index.tsx
@@ -514,11 +514,6 @@ const PromptInput = ({ showTitle = false }: PromptInputProps) => {
style={canCreate ? undefined : { opacity: 0.5, pointerEvents: 'none' }}
>
<GenerationMediaModeSegment mode={'video'} />
- <GenerationVisibilitySelector
- disabledReason={visibilityLockedReason}
- visibility={displayVisibility}
- onChange={setNewGenerationTopicVisibility}
- />
<ModelSwitchPanel
ModelItemComponent={VideoModelItem}
enabledList={enabledVideoModelList}
@@ -613,15 +608,22 @@ const PromptInput = ({ showTitle = false }: PromptInputProps) => {
hasRefImages ? t('config.prompt.placeholderWithRef') : t('config.prompt.placeholder')
}
rightActions={
- <PromptTransformAction
- mode={'video'}
- prompt={value}
- onPromptChange={(next) => {
- if (!canCreate) return;
-
- setValue(next as any);
- }}
- />
+ <>
+ <PromptTransformAction
+ mode={'video'}
+ prompt={value}
+ onPromptChange={(next) => {
+ if (!canCreate) return;
+
+ setValue(next as any);
+ }}
+ />
+ <GenerationVisibilitySelector
+ disabledReason={visibilityLockedReason}
+ visibility={displayVisibility}
+ onChange={setNewGenerationTopicVisibility}
+ />
+ </>
}
onGenerate={handleGenerate}
onValueChange={setValue}
diff --git a/src/routes/(main)/[workspaceSlug]/settings/devices/index.tsx b/src/routes/(main)/[workspaceSlug]/settings/devices/index.tsx
index 0b23238f435..ba3351da412 100644
--- a/src/routes/(main)/[workspaceSlug]/settings/devices/index.tsx
+++ b/src/routes/(main)/[workspaceSlug]/settings/devices/index.tsx
@@ -8,7 +8,7 @@ import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { DeviceConnectModal, DeviceManager } from '@/features/DeviceManager';
-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';
+import WorkspaceSettingsTitle from '@/features/WorkspaceSetting/Title';
/**
* Workspace device settings: two pools behind tabs (LOBE-11690) —
@@ -24,12 +24,8 @@ const WorkspaceDevicesSetting = memo(() => {
return (
<>
- <SettingHeader title={t('tab.devices')} />
-
- {/* Tabs and the device list form one unit: group them so the settings
- Container's 36px section gap applies once, instead of stacking
- between the tabs and the list they control. */}
<Flexbox gap={16}>
+ <WorkspaceSettingsTitle>{t('tab.devices')}</WorkspaceSettingsTitle>
<Tabs
activeKey={visibility}
items={[
diff --git a/src/routes/(main)/[workspaceSlug]/settings/stats/index.test.tsx b/src/routes/(main)/[workspaceSlug]/settings/stats/index.test.tsx
index 779c1df2187..f9ae44441dd 100644
--- a/src/routes/(main)/[workspaceSlug]/settings/stats/index.test.tsx
+++ b/src/routes/(main)/[workspaceSlug]/settings/stats/index.test.tsx
@@ -7,6 +7,7 @@ import { describe, expect, it, vi } from 'vitest';
import WorkspaceStatsSetting from './index';
const useFetchWorkspaceMembersMock = vi.hoisted(() => vi.fn());
+const statsPagePropsMock = vi.hoisted(() => vi.fn());
vi.mock('@/business/client/hooks/useFetchWorkspaceMembers', () => ({
useFetchWorkspaceMembers: useFetchWorkspaceMembersMock,
@@ -24,11 +25,12 @@ vi.mock('react-i18next', () => ({
}));
vi.mock('@/routes/(main)/settings/stats', () => ({
- default: ({
- resolveUser,
- }: {
+ default: (props: {
resolveUser: (userId: string) => { avatar?: string | null; name: string };
+ showSettingHeader?: boolean;
}) => {
+ statsPagePropsMock(props);
+ const { resolveUser } = props;
const activeUser = resolveUser('user-1');
const removedUser = resolveUser('user-2');
const noAvatarUser = resolveUser('user-3');
@@ -88,5 +90,9 @@ describe('WorkspaceStatsSetting', () => {
expect(screen.getByText('https://example.com/avatar.png')).toBeInTheDocument();
expect(screen.getByText('grace (Removed)')).toBeInTheDocument();
expect(screen.getByText('alan')).toBeInTheDocument();
+ expect(screen.getByRole('heading', { name: 'tab.stats' })).toBeInTheDocument();
+ expect(statsPagePropsMock).toHaveBeenCalledWith(
+ expect.objectContaining({ showSettingHeader: false }),
+ );
});
});
diff --git a/src/routes/(main)/[workspaceSlug]/settings/stats/index.tsx b/src/routes/(main)/[workspaceSlug]/settings/stats/index.tsx
index 8bea1f81e7a..ed54be2d9eb 100644
--- a/src/routes/(main)/[workspaceSlug]/settings/stats/index.tsx
+++ b/src/routes/(main)/[workspaceSlug]/settings/stats/index.tsx
@@ -1,9 +1,11 @@
'use client';
+import { Flexbox } from '@lobehub/ui';
import { useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useFetchWorkspaceMembers } from '@/business/client/hooks/useFetchWorkspaceMembers';
+import WorkspaceSettingsTitle from '@/features/WorkspaceSetting/Title';
import Page from '@/routes/(main)/settings/stats';
import WorkspaceWelcome from '@/routes/(main)/settings/stats/features/overview/WorkspaceWelcome';
import { type UserDisplay } from '@/routes/(main)/settings/stats/types';
@@ -23,6 +25,7 @@ interface WorkspaceStatsMember {
const WorkspaceStatsSetting = () => {
const { t } = useTranslation('auth');
+ const { t: tSetting } = useTranslation('setting');
const { data: members = [] } = useFetchWorkspaceMembers({ includeDeleted: true });
@@ -45,7 +48,17 @@ const WorkspaceStatsSetting = () => {
[memberMap],
);
- return <Page enableUserDimension headerNode={<WorkspaceWelcome />} resolveUser={resolveUser} />;
+ return (
+ <Flexbox gap={16}>
+ <WorkspaceSettingsTitle>{tSetting('tab.stats')}</WorkspaceSettingsTitle>
+ <Page
+ enableUserDimension
+ headerNode={<WorkspaceWelcome />}
+ resolveUser={resolveUser}
+ showSettingHeader={false}
+ />
+ </Flexbox>
+ );
};
WorkspaceStatsSetting.displayName = 'WorkspaceStatsSetting';
diff --git a/src/routes/(main)/agent/profile/features/ProfileEditor/CloudHeterogeneousConfig.tsx b/src/routes/(main)/agent/profile/features/ProfileEditor/CloudHeterogeneousConfig.tsx
index 9d36c57dc98..712f860b545 100644
--- a/src/routes/(main)/agent/profile/features/ProfileEditor/CloudHeterogeneousConfig.tsx
+++ b/src/routes/(main)/agent/profile/features/ProfileEditor/CloudHeterogeneousConfig.tsx
@@ -369,7 +369,7 @@ const CloudHeterogeneousConfig = memo<CloudHeterogeneousConfigProps>(
{t('heterogeneousStatus.cloud.githubLabel')}
</span>
</Flexbox>
- <span className={styles.manageLink} onClick={() => navigate('/settings/creds')}>
+ <span className={styles.manageLink} onClick={() => navigate('/settings/credential')}>
{t('heterogeneousStatus.cloud.manageCredentials')}
</span>
</Flexbox>
diff --git a/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/agentMenuVisibility.test.ts b/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/agentMenuVisibility.test.ts
new file mode 100644
index 00000000000..667e31e481f
--- /dev/null
+++ b/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/agentMenuVisibility.test.ts
@@ -0,0 +1,14 @@
+// @vitest-environment node
+
+import { describe, expect, it } from 'vitest';
+
+import { shouldShowAgentDeleteMenuItem } from './agentMenuVisibility';
+
+describe('shouldShowAgentDeleteMenuItem', () => {
+ it('shows Delete only when the agent can be edited and managed', () => {
+ expect(shouldShowAgentDeleteMenuItem({ canEdit: true, canManage: true })).toBe(true);
+ expect(shouldShowAgentDeleteMenuItem({ canEdit: false, canManage: true })).toBe(false);
+ expect(shouldShowAgentDeleteMenuItem({ canEdit: true, canManage: false })).toBe(false);
+ expect(shouldShowAgentDeleteMenuItem({ canEdit: false, canManage: false })).toBe(false);
+ });
+});
diff --git a/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/agentMenuVisibility.ts b/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/agentMenuVisibility.ts
new file mode 100644
index 00000000000..ad52f9c4ddf
--- /dev/null
+++ b/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/agentMenuVisibility.ts
@@ -0,0 +1,7 @@
+interface AgentDeleteMenuVisibility {
+ canEdit: boolean;
+ canManage: boolean;
+}
+
+export const shouldShowAgentDeleteMenuItem = ({ canEdit, canManage }: AgentDeleteMenuVisibility) =>
+ canEdit && canManage;
diff --git a/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.tsx b/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.tsx
index 909039c83d0..7883cfbdc48 100644
--- a/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.tsx
+++ b/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.tsx
@@ -1,7 +1,7 @@
import { BUILTIN_AGENT_SLUGS } from '@lobechat/builtin-agents';
import { SessionDefaultGroup, type SidebarVisibility } from '@lobechat/types';
import { type MenuProps } from '@lobehub/ui';
-import { Icon, Tooltip } from '@lobehub/ui';
+import { Icon } from '@lobehub/ui';
import { confirmModal } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import isEqual from 'fast-deep-equal';
@@ -36,6 +36,7 @@ import { userProfileSelectors } from '@/store/user/selectors';
import { isForbiddenError } from '@/utils/forbiddenError';
import { useRevealSidebarSection } from '../../../../hooks';
+import { shouldShowAgentDeleteMenuItem } from './agentMenuVisibility';
const BUILTIN_SLUGS = new Set<string>(Object.values(BUILTIN_AGENT_SLUGS));
@@ -107,10 +108,10 @@ export const useAgentDropdownMenu = ({
!!currentUserId &&
userId === currentUserId;
- // Viewer has no write permissions on agents — disable every mutating menu
- // item (pin/rename/duplicate/move/delete) while keeping the menu visible
- // so they can still inspect what actions exist. `openInNewWindow` is a
- // pure read so it stays enabled.
+ // Viewer has no write permissions on agents — disable non-destructive
+ // mutating items while keeping the menu visible so they can still inspect
+ // what actions exist. Delete is hidden entirely when unavailable.
+ // `openInNewWindow` is a pure read so it stays enabled.
const { allowed: canEdit } = usePermission('edit_own_content');
const { allowed: canCreate } = usePermission('create_content');
@@ -118,6 +119,7 @@ export const useAgentDropdownMenu = ({
// owner may rename or delete a shared agent — mirrors the server-side
// enforcement.
const canManage = useResourceManageable(userId);
+ const showDeleteAction = shouldShowAgentDeleteMenuItem({ canEdit, canManage });
// Cross-workspace Transfer to… / Copy to… items (null when workspace
// feature is off or the viewer lacks permission for this agent)
@@ -214,11 +216,10 @@ export const useAgentDropdownMenu = ({
key: 'moveGroup',
label: t('sessionGroup.moveGroup'),
},
- { type: 'divider' },
- ...(transferMenuItems ?? []),
- ...(transferMenuItems?.length ? [{ type: 'divider' as const }] : []),
+ ...(transferMenuItems?.length ? [{ type: 'divider' as const }, ...transferMenuItems] : []),
...(showPublishAction
? [
+ { type: 'divider' as const },
{
disabled: !canEdit,
icon: <Icon icon={GlobeIcon} />,
@@ -256,11 +257,11 @@ export const useAgentDropdownMenu = ({
});
},
},
- { type: 'divider' as const },
]
: []),
...(showMakePrivateAction
? [
+ { type: 'divider' as const },
{
disabled: !canEdit,
icon: <Icon icon={EyeOffIcon} />,
@@ -289,45 +290,42 @@ export const useAgentDropdownMenu = ({
});
},
},
- { type: 'divider' as const },
]
: []),
- {
- danger: true,
- disabled: !canEdit || !canManage,
- icon: <Icon icon={Trash} />,
- key: 'delete',
- label: canManage ? (
- t('delete', { ns: 'common' })
- ) : (
- <Tooltip title={t('manageOnlyCreator', { ns: 'common' })}>
- <span>{t('delete', { ns: 'common' })}</span>
- </Tooltip>
- ),
- onClick: ({ domEvent }: any) => {
- domEvent.stopPropagation();
- if (!canEdit || !canManage) return;
- confirmModal({
- cancelText: t('cancel', { ns: 'common' }),
- content: t('confirmRemoveSessionItemAlert'),
- okButtonProps: { danger: true },
- okText: t('delete', { ns: 'common' }),
- onOk: async () => {
- try {
- await removeAgent(id);
- message.success(t('confirmRemoveSessionSuccess'));
- } catch (error) {
- message.error(
- isForbiddenError(error)
- ? t('manageOnlyCreator', { ns: 'common' })
- : t('operationFailed', { ns: 'common' }),
- );
- }
+ ...(showDeleteAction
+ ? [
+ { type: 'divider' as const },
+ {
+ danger: true,
+ icon: <Icon icon={Trash} />,
+ key: 'delete',
+ label: t('delete', { ns: 'common' }),
+ onClick: ({ domEvent }: any) => {
+ domEvent.stopPropagation();
+ if (!canEdit || !canManage) return;
+ confirmModal({
+ cancelText: t('cancel', { ns: 'common' }),
+ content: t('confirmRemoveSessionItemAlert'),
+ okButtonProps: { danger: true },
+ okText: t('delete', { ns: 'common' }),
+ onOk: async () => {
+ try {
+ await removeAgent(id);
+ message.success(t('confirmRemoveSessionSuccess'));
+ } catch (error) {
+ message.error(
+ isForbiddenError(error)
+ ? t('manageOnlyCreator', { ns: 'common' })
+ : t('operationFailed', { ns: 'common' }),
+ );
+ }
+ },
+ title: t('delete', { ns: 'common' }),
+ });
+ },
},
- title: t('delete', { ns: 'common' }),
- });
- },
- },
+ ]
+ : []),
] as MenuProps['items'],
[
anchor,
@@ -347,6 +345,7 @@ export const useAgentDropdownMenu = ({
transferMenuItems,
showPublishAction,
showMakePrivateAction,
+ showDeleteAction,
refreshAgentList,
revealSidebarSection,
t,
diff --git a/src/routes/(main)/home/_layout/Body/Agent/useDropdownMenu.test.tsx b/src/routes/(main)/home/_layout/Body/Agent/useDropdownMenu.test.tsx
new file mode 100644
index 00000000000..2ada94afba8
--- /dev/null
+++ b/src/routes/(main)/home/_layout/Body/Agent/useDropdownMenu.test.tsx
@@ -0,0 +1,60 @@
+/**
+ * @vitest-environment happy-dom
+ */
+import { renderHook } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+
+import { useAgentActionsDropdownMenu } from './useDropdownMenu';
+
+const updateSystemStatusMock = vi.hoisted(() => vi.fn());
+
+vi.mock('@lobehub/ui', () => ({
+ Icon: () => null,
+}));
+
+vi.mock('react-i18next', () => ({
+ useTranslation: () => ({
+ t: (key: string) => key,
+ }),
+}));
+
+vi.mock('@/routes/(main)/home/_layout/Body/CustomizeSidebarModal', () => ({
+ openCustomizeSidebarModal: vi.fn(),
+}));
+
+vi.mock('@/store/global', () => ({
+ useGlobalStore: (selector: (state: Record<string, unknown>) => unknown) =>
+ selector({
+ agentPageSize: 10,
+ updateSystemStatus: updateSystemStatusMock,
+ }),
+}));
+
+vi.mock('@/store/global/selectors', () => ({
+ systemStatusSelectors: {
+ agentPageSize: (state: { agentPageSize: number }) => state.agentPageSize,
+ },
+}));
+
+vi.mock('../../hooks', () => ({
+ useCreateMenuItems: () => ({
+ configMenuItem: () => ({ key: 'config', label: 'sessionGroup.manageCategory' }),
+ createSessionGroupMenuItem: () => ({ key: 'addSessionGroup' }),
+ }),
+}));
+
+describe('useAgentActionsDropdownMenu', () => {
+ it('omits section reordering from the Agent category header', () => {
+ const { result } = renderHook(() =>
+ useAgentActionsDropdownMenu({ openConfigGroupModal: vi.fn() }),
+ );
+
+ const keys = result.current?.flatMap((item) =>
+ item && typeof item === 'object' && 'key' in item && item.key ? [item.key] : [],
+ );
+
+ expect(keys).toEqual(['addSessionGroup', 'config', 'show', 'customizeSidebar']);
+ expect(keys).not.toContain('moveUp');
+ expect(keys).not.toContain('moveDown');
+ });
+});
diff --git a/src/routes/(main)/home/_layout/Body/Agent/useDropdownMenu.tsx b/src/routes/(main)/home/_layout/Body/Agent/useDropdownMenu.tsx
index 41ddd7ec83e..5688889e870 100644
--- a/src/routes/(main)/home/_layout/Body/Agent/useDropdownMenu.tsx
+++ b/src/routes/(main)/home/_layout/Body/Agent/useDropdownMenu.tsx
@@ -1,14 +1,12 @@
import { type MenuProps } from '@lobehub/ui';
import { Icon } from '@lobehub/ui';
-import { ArrowDownIcon, ArrowUpIcon, Hash, LucideCheck, SlidersHorizontalIcon } from 'lucide-react';
-import { useCallback, useMemo } from 'react';
+import { Hash, LucideCheck, SlidersHorizontalIcon } from 'lucide-react';
+import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
-import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';
import { openCustomizeSidebarModal } from '@/routes/(main)/home/_layout/Body/CustomizeSidebarModal';
import { useGlobalStore } from '@/store/global';
import { systemStatusSelectors } from '@/store/global/selectors';
-import { reorderSidebarItems } from '@/store/global/selectors/systemStatus';
import { useCreateMenuItems } from '../../hooks';
@@ -21,30 +19,9 @@ export const useAgentActionsDropdownMenu = ({
}: AgentActionsDropdownMenuProps): MenuProps['items'] => {
const { t } = useTranslation('common');
- const activeWorkspaceId = useActiveWorkspaceId();
const agentPageSize = useGlobalStore(systemStatusSelectors.agentPageSize);
- const sidebarItems = useGlobalStore(systemStatusSelectors.sidebarItems(activeWorkspaceId));
- const hiddenSections = useGlobalStore(
- systemStatusSelectors.hiddenSidebarSections(activeWorkspaceId),
- );
const updateSystemStatus = useGlobalStore((s) => s.updateSystemStatus);
- const visibleItems = sidebarItems.filter((k) => !hiddenSections.includes(k));
- const visibleIndex = visibleItems.indexOf('agent');
- const isFirst = visibleIndex === 0;
- const isLast = visibleIndex === visibleItems.length - 1;
-
- const moveSection = useCallback(
- (direction: 'up' | 'down') => {
- const idx = sidebarItems.indexOf('agent');
- if (idx === -1) return;
- const next = reorderSidebarItems(sidebarItems, idx, direction === 'up' ? idx - 1 : idx + 1);
- if (next === sidebarItems) return;
- updateSystemStatus({ sidebarItems: next });
- },
- [sidebarItems, updateSystemStatus],
- );
-
// Create menu items
const { createSessionGroupMenuItem, configMenuItem } = useCreateMenuItems();
@@ -73,20 +50,6 @@ export const useAgentActionsDropdownMenu = ({
key: 'show',
label: t('navPanel.show'),
},
- {
- disabled: isFirst,
- icon: <Icon icon={ArrowUpIcon} />,
- key: 'moveUp',
- label: t('navPanel.moveUp'),
- onClick: () => moveSection('up'),
- },
- {
- disabled: isLast,
- icon: <Icon icon={ArrowDownIcon} />,
- key: 'moveDown',
- label: t('navPanel.moveDown'),
- onClick: () => moveSection('down'),
- },
{ type: 'divider' as const },
{
icon: <Icon icon={SlidersHorizontalIcon} />,
@@ -101,10 +64,6 @@ export const useAgentActionsDropdownMenu = ({
createSessionGroupMenuItem,
configMenuItem,
openConfigGroupModal,
- isFirst,
- isLast,
- moveSection,
- visibleItems.length,
t,
]);
};
diff --git a/src/routes/(main)/home/_layout/Header/components/InboxDrawer/NotificationItem.tsx b/src/routes/(main)/home/_layout/Header/components/InboxDrawer/NotificationItem.tsx
index f0599da8945..1bac2d8b717 100644
--- a/src/routes/(main)/home/_layout/Header/components/InboxDrawer/NotificationItem.tsx
+++ b/src/routes/(main)/home/_layout/Header/components/InboxDrawer/NotificationItem.tsx
@@ -3,13 +3,13 @@
import { Block, Flexbox, Icon, Text } from '@lobehub/ui';
import { ContextMenuTrigger } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
-import dayjs from 'dayjs';
import { ArchiveIcon, BellIcon, ImageIcon, MegaphoneIcon, VideoIcon } from 'lucide-react';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
+import { formatNotificationRelativeTime } from './formatNotificationRelativeTime';
import { createNotificationDetailModal } from './NotificationDetailModal';
const styles = createStaticStyles(({ css }) => ({
@@ -61,9 +61,10 @@ const NotificationItem = memo<NotificationItemProps>(
onMarkAsRead,
onArchive,
}) => {
- const { t } = useTranslation('notification');
+ const { i18n, t } = useTranslation('notification');
const navigate = useWorkspaceAwareNavigate();
const TypeIcon = TYPE_ICON_MAP[type] || BellIcon;
+ const dateLocale = i18n.resolvedLanguage || i18n.language;
const handleClick = useCallback(() => {
if (!isRead) onMarkAsRead(id);
@@ -120,7 +121,7 @@ const NotificationItem = memo<NotificationItemProps>(
<Flexbox flex={1} gap={4} style={{ overflow: 'hidden' }}>
<Text style={{ whiteSpace: 'pre-wrap', wordBreak: 'break-word' }}>{content}</Text>
<Text fontSize={12} type="secondary">
- {dayjs(createdAt).fromNow()}
+ {formatNotificationRelativeTime(createdAt, dateLocale)}
</Text>
</Flexbox>
</Flexbox>
diff --git a/src/routes/(main)/home/_layout/Header/components/InboxDrawer/formatNotificationRelativeTime.test.ts b/src/routes/(main)/home/_layout/Header/components/InboxDrawer/formatNotificationRelativeTime.test.ts
new file mode 100644
index 00000000000..80c26b9bbe0
--- /dev/null
+++ b/src/routes/(main)/home/_layout/Header/components/InboxDrawer/formatNotificationRelativeTime.test.ts
@@ -0,0 +1,35 @@
+import dayjs from 'dayjs';
+import relativeTime from 'dayjs/plugin/relativeTime';
+import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest';
+
+import { formatNotificationRelativeTime } from './formatNotificationRelativeTime';
+
+dayjs.extend(relativeTime);
+
+describe('formatNotificationRelativeTime', () => {
+ beforeAll(async () => {
+ await import('dayjs/locale/en');
+ await import('dayjs/locale/zh-cn');
+ vi.useFakeTimers();
+ vi.setSystemTime(new Date('2026-07-16T12:00:00Z'));
+ });
+
+ afterAll(() => {
+ dayjs.locale('en');
+ vi.useRealTimers();
+ });
+
+ it('uses the requested English locale when the global locale is Chinese', () => {
+ dayjs.locale('zh-cn');
+
+ expect(formatNotificationRelativeTime('2026-07-16T10:00:00Z', 'en-US')).toBe('2 hours ago');
+ });
+
+ it('keeps Chinese relative dates for the Chinese UI', () => {
+ expect(formatNotificationRelativeTime('2026-07-16T10:00:00Z', 'zh-CN')).toBe('2 小时前');
+ });
+
+ it('returns an empty string for an invalid date', () => {
+ expect(formatNotificationRelativeTime('invalid date', 'en-US')).toBe('');
+ });
+});
diff --git a/src/routes/(main)/home/_layout/Header/components/InboxDrawer/formatNotificationRelativeTime.ts b/src/routes/(main)/home/_layout/Header/components/InboxDrawer/formatNotificationRelativeTime.ts
new file mode 100644
index 00000000000..dd57b49046b
--- /dev/null
+++ b/src/routes/(main)/home/_layout/Header/components/InboxDrawer/formatNotificationRelativeTime.ts
@@ -0,0 +1,14 @@
+import dayjs from 'dayjs';
+
+import { normalizeDayjsLocale } from '@/utils/dayjsLocale';
+
+export const formatNotificationRelativeTime = (
+ createdAt: Date | string,
+ locale?: string,
+): string => {
+ const date = dayjs(createdAt);
+
+ if (!date.isValid()) return '';
+
+ return locale ? date.locale(normalizeDayjsLocale(locale)).fromNow() : date.fromNow();
+};
diff --git a/src/routes/(main)/home/_layout/hooks/useCreateMenuItems.test.tsx b/src/routes/(main)/home/_layout/hooks/useCreateMenuItems.test.tsx
index 65f73d85c05..f61c942b3db 100644
--- a/src/routes/(main)/home/_layout/hooks/useCreateMenuItems.test.tsx
+++ b/src/routes/(main)/home/_layout/hooks/useCreateMenuItems.test.tsx
@@ -201,6 +201,18 @@ describe('useCreateMenuItems', () => {
expect(navigateMock).toHaveBeenCalledWith('/community/agent');
});
+ it('uses an action-oriented label for category management', () => {
+ const { result } = renderHook(() => useCreateMenuItems());
+
+ const configItem = result.current.configMenuItem(vi.fn());
+
+ if (!isActionItem(configItem)) {
+ throw new Error('Expected category management menu item');
+ }
+
+ expect(configItem.label).toBe('sessionGroup.manageCategory');
+ });
+
it('creates the Claude Code agent normally when the CLI is available', async () => {
const { result } = renderHook(() => useCreateMenuItems());
diff --git a/src/routes/(main)/home/_layout/hooks/useCreateMenuItems.tsx b/src/routes/(main)/home/_layout/hooks/useCreateMenuItems.tsx
index 26febc0e4a3..cb9b033d5de 100644
--- a/src/routes/(main)/home/_layout/hooks/useCreateMenuItems.tsx
+++ b/src/routes/(main)/home/_layout/hooks/useCreateMenuItems.tsx
@@ -384,7 +384,7 @@ export const useCreateMenuItems = () => {
(onOpenConfig: () => void): ItemType => ({
icon: <Icon icon={FolderCogIcon} />,
key: 'config',
- label: t('sessionGroup.config'),
+ label: t('sessionGroup.manageCategory'),
onClick: (info) => {
info.domEvent?.stopPropagation();
onOpenConfig();
diff --git a/src/routes/(main)/settings/about/index.tsx b/src/routes/(main)/settings/about/index.tsx
index 459133f7238..51570c9c214 100644
--- a/src/routes/(main)/settings/about/index.tsx
+++ b/src/routes/(main)/settings/about/index.tsx
@@ -5,11 +5,16 @@ import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';
import About from './features/About';
import Analytics from './features/Analytics';
-const Page = ({ mobile }: { mobile?: boolean }) => {
+interface PageProps {
+ mobile?: boolean;
+ showSettingHeader?: boolean;
+}
+
+const Page = ({ mobile, showSettingHeader = true }: PageProps) => {
const { t } = useTranslation('setting');
return (
<>
- <SettingHeader title={t('tab.about')} />
+ {showSettingHeader && <SettingHeader title={t('tab.about')} />}
<About mobile={mobile} />
<Analytics />
</>
diff --git a/src/routes/(main)/settings/apikey/index.tsx b/src/routes/(main)/settings/apikey/index.tsx
index f713641c67f..51ebe19acb3 100644
--- a/src/routes/(main)/settings/apikey/index.tsx
+++ b/src/routes/(main)/settings/apikey/index.tsx
@@ -4,11 +4,15 @@ import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';
import ApiKey from './features/ApiKey';
-const Page = () => {
+interface PageProps {
+ showSettingHeader?: boolean;
+}
+
+const Page = ({ showSettingHeader = true }: PageProps) => {
const { t } = useTranslation('setting');
return (
<>
- <SettingHeader title={t('tab.apikey')} />
+ {showSettingHeader && <SettingHeader title={t('tab.apikey')} />}
<ApiKey />
</>
);
diff --git a/src/routes/(main)/settings/appearance/features/Desktop.tsx b/src/routes/(main)/settings/appearance/features/Desktop.tsx
index dc204bdd623..7e8b73558ed 100644
--- a/src/routes/(main)/settings/appearance/features/Desktop.tsx
+++ b/src/routes/(main)/settings/appearance/features/Desktop.tsx
@@ -41,7 +41,6 @@ const Desktop = memo(() => {
}}
/>
),
- desc: t('settingAppearance.appTray.desc'),
label: (
<SettingsSearchAnchor id={'appearance-app-tray'}>
{t('settingAppearance.appTray.title')}
diff --git a/src/routes/(main)/settings/appearance/index.tsx b/src/routes/(main)/settings/appearance/index.tsx
index 7face6bac1a..95321a39ee5 100644
--- a/src/routes/(main)/settings/appearance/index.tsx
+++ b/src/routes/(main)/settings/appearance/index.tsx
@@ -7,11 +7,15 @@ import Appearance from '../common/features/Appearance';
import Common from '../common/features/Common/Common';
import Desktop from './features/Desktop';
-const Page = () => {
+interface PageProps {
+ showSettingHeader?: boolean;
+}
+
+const Page = ({ showSettingHeader = true }: PageProps) => {
const { t } = useTranslation('setting');
return (
<>
- <SettingHeader title={t('tab.appearance')} />
+ {showSettingHeader && <SettingHeader title={t('tab.appearance')} />}
<Common />
<Appearance />
<Desktop />
diff --git a/src/routes/(main)/settings/chat-appearance/features/ChatAppearance/index.tsx b/src/routes/(main)/settings/chat-appearance/features/ChatAppearance/index.tsx
index bf7860ff844..72f2079c1b2 100644
--- a/src/routes/(main)/settings/chat-appearance/features/ChatAppearance/index.tsx
+++ b/src/routes/(main)/settings/chat-appearance/features/ChatAppearance/index.tsx
@@ -49,7 +49,6 @@ const ChatAppearance = memo(() => {
<>
<FormGroup
collapsible={false}
- desc={t('settingChatAppearance.transitionMode.desc')}
gap={16}
title={t('settingChatAppearance.transitionMode.title')}
variant={'filled'}
@@ -83,7 +82,6 @@ const ChatAppearance = memo(() => {
<FormGroup
active={false}
collapsible={false}
- desc={t('settingChatAppearance.autoScrollOnStreaming.desc')}
title={t('settingChatAppearance.autoScrollOnStreaming.title')}
variant={'filled'}
extra={
@@ -101,7 +99,6 @@ const ChatAppearance = memo(() => {
<FormGroup
collapsible={false}
- desc={t('settingChatAppearance.linkIcon.desc')}
gap={16}
title={t('settingChatAppearance.linkIcon.title')}
variant={'filled'}
@@ -120,7 +117,6 @@ const ChatAppearance = memo(() => {
<FormGroup
collapsible={false}
- desc={t('settingChatAppearance.fontSize.desc')}
gap={16}
variant={'filled'}
extra={
diff --git a/src/routes/(main)/settings/common/features/Appearance/index.tsx b/src/routes/(main)/settings/common/features/Appearance/index.tsx
index fefd12d75c2..538f8c050eb 100644
--- a/src/routes/(main)/settings/common/features/Appearance/index.tsx
+++ b/src/routes/(main)/settings/common/features/Appearance/index.tsx
@@ -33,7 +33,6 @@ const Appearance = memo(() => {
},
{
children: <ThemeSwatchesPrimary />,
- desc: t('settingAppearance.primaryColor.desc'),
label: (
<SettingsSearchAnchor id={'appearance-primary-color'}>
{t('settingAppearance.primaryColor.title')}
@@ -44,7 +43,6 @@ const Appearance = memo(() => {
},
{
children: <ThemeSwatchesNeutral />,
- desc: t('settingAppearance.neutralColor.desc'),
label: (
<SettingsSearchAnchor id={'appearance-neutral-color'}>
{t('settingAppearance.neutralColor.title')}
diff --git a/src/routes/(main)/settings/common/features/Common/Common.tsx b/src/routes/(main)/settings/common/features/Common/Common.tsx
index 200abb95df6..e28bd3af047 100644
--- a/src/routes/(main)/settings/common/features/Common/Common.tsx
+++ b/src/routes/(main)/settings/common/features/Common/Common.tsx
@@ -125,7 +125,6 @@ const Common = memo(() => {
]}
/>
),
- desc: t('settingAppearance.animationMode.desc'),
label: (
<SettingsSearchAnchor id={'appearance-animation'}>
{t('settingAppearance.animationMode.title')}
@@ -152,7 +151,6 @@ const Common = memo(() => {
]}
/>
),
- desc: t('settingAppearance.contextMenuMode.desc'),
label: (
<SettingsSearchAnchor id={'appearance-context-menu'}>
{t('settingAppearance.contextMenuMode.title')}
@@ -180,7 +178,6 @@ const Common = memo(() => {
/>
</Flexbox>
),
- desc: t('settingCommon.responseLanguage.desc'),
label: (
<SettingsSearchAnchor id={'appearance-response-language'}>
{t('settingCommon.responseLanguage.title')}
diff --git a/src/routes/(main)/settings/creds/features/useCredsApi.ts b/src/routes/(main)/settings/creds/features/useCredsApi.ts
index eb85fb90196..8ea99d8d67c 100644
--- a/src/routes/(main)/settings/creds/features/useCredsApi.ts
+++ b/src/routes/(main)/settings/creds/features/useCredsApi.ts
@@ -7,7 +7,7 @@ import { lambdaClient, lambdaQuery } from '@/libs/trpc/client';
/**
* Personal vs workspace creds API binding.
*
- * The personal page (`/settings/creds`) and the workspace page
+ * The personal page (`/settings/credential`) and the workspace page
* (`/[workspaceSlug]/settings/creds`) share UI components but talk to
* different tRPC routers — `market.creds` (Market user account) versus
* `workspaceCreds` (Market organization mirroring the cloud workspace).
diff --git a/src/routes/(main)/settings/creds/index.tsx b/src/routes/(main)/settings/creds/index.tsx
index c8677dd869b..a6867f63a85 100644
--- a/src/routes/(main)/settings/creds/index.tsx
+++ b/src/routes/(main)/settings/creds/index.tsx
@@ -1,19 +1,24 @@
'use client';
-import { Icon, Tooltip } from '@lobehub/ui';
+import { Flexbox, Icon, Text, Tooltip } from '@lobehub/ui';
import { Button } from '@lobehub/ui/base-ui';
import { Plus } from 'lucide-react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
+import NavHeader from '@/features/NavHeader';
+import SettingContainer from '@/features/Setting/SettingContainer';
import { usePermission } from '@/hooks/usePermission';
-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';
import { createCreateCredModal } from './features/CreateCredModal';
import CredsList from './features/CredsList';
import { useCredsApi } from './features/useCredsApi';
-const Page = () => {
+interface PageProps {
+ mobile?: boolean;
+}
+
+const Page = ({ mobile }: PageProps) => {
const { t } = useTranslation('setting');
const { allowed: canManageCredentials, reason } = usePermission('manage_provider_key');
const [refreshKey, setRefreshKey] = useState(0);
@@ -27,24 +32,39 @@ const Page = () => {
});
};
+ const createButton = (
+ <Tooltip title={reason}>
+ <Button
+ disabled={!canManageCredentials}
+ icon={<Icon icon={Plus} />}
+ size={mobile ? 'large' : 'small'}
+ type={'primary'}
+ onClick={handleCreate}
+ >
+ {t('creds.create')}
+ </Button>
+ </Tooltip>
+ );
+
+ if (mobile) {
+ return (
+ <>
+ <Flexbox horizontal justify={'flex-end'} padding={16}>
+ {createButton}
+ </Flexbox>
+ <CredsList key={refreshKey} />
+ </>
+ );
+ }
+
return (
<>
- <SettingHeader
- title={t('tab.creds')}
- extra={
- <Tooltip title={reason}>
- <Button
- disabled={!canManageCredentials}
- icon={<Icon icon={Plus} />}
- size={'large'}
- onClick={handleCreate}
- >
- {t('creds.create')}
- </Button>
- </Tooltip>
- }
- />
- <CredsList key={refreshKey} />
+ <NavHeader right={createButton} styles={{ center: { alignItems: 'center' } }}>
+ <Text weight={500}>{t('tab.creds')}</Text>
+ </NavHeader>
+ <SettingContainer maxWidth={1024} paddingBlock={'24px 128px'} paddingInline={24}>
+ <CredsList key={refreshKey} />
+ </SettingContainer>
</>
);
};
diff --git a/src/routes/(main)/settings/devices/index.tsx b/src/routes/(main)/settings/devices/index.tsx
index 7028fb26e2e..4b4b6a91af9 100644
--- a/src/routes/(main)/settings/devices/index.tsx
+++ b/src/routes/(main)/settings/devices/index.tsx
@@ -6,7 +6,11 @@ import { useTranslation } from 'react-i18next';
import { DeviceConnectModal, DeviceManager } from '@/features/DeviceManager';
import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';
-const Page = memo(() => {
+interface PageProps {
+ showSettingHeader?: boolean;
+}
+
+const Page = memo<PageProps>(({ showSettingHeader = true }) => {
const { t } = useTranslation('setting');
const [open, setOpen] = useState(false);
const [initialTab, setInitialTab] = useState<'cli' | 'desktop'>();
@@ -20,7 +24,7 @@ const Page = memo(() => {
<>
{/* "Connect device" moved into the device list header (next to Refresh) —
keep the page header to the title only. */}
- <SettingHeader title={t('devices.title')} />
+ {showSettingHeader && <SettingHeader title={t('devices.title')} />}
<DeviceManager scope={'personal'} onConnect={handleConnect} />
diff --git a/src/routes/(main)/settings/features/SettingsContent.tsx b/src/routes/(main)/settings/features/SettingsContent.tsx
index 18c32d9ed43..05b3d68da0d 100644
--- a/src/routes/(main)/settings/features/SettingsContent.tsx
+++ b/src/routes/(main)/settings/features/SettingsContent.tsx
@@ -1,6 +1,8 @@
'use client';
+import { Text } from '@lobehub/ui';
import { Fragment, useEffect } from 'react';
+import { useTranslation } from 'react-i18next';
import NavHeader from '@/features/NavHeader';
import SettingContainer from '@/features/Setting/SettingContainer';
@@ -9,6 +11,7 @@ import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwar
import { SettingsTabs } from '@/store/global/initialState';
import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';
+import { ManageMemoryButton } from '../memory/features/ManageMemoryButton';
import { componentMap } from './componentMap';
const REDIRECT_MAP: Record<string, string> = {
@@ -19,15 +22,52 @@ const REDIRECT_MAP: Record<string, string> = {
[SettingsTabs.Image]: SettingsTabs.ServiceModel,
};
+const COMPACT_HEADER_TABS = [
+ SettingsTabs.About,
+ SettingsTabs.APIKey,
+ SettingsTabs.Appearance,
+ SettingsTabs.Billing,
+ SettingsTabs.Credits,
+ SettingsTabs.Devices,
+ SettingsTabs.Hotkey,
+ SettingsTabs.Memory,
+ SettingsTabs.Notification,
+ SettingsTabs.Plans,
+ SettingsTabs.Profile,
+ SettingsTabs.Referral,
+ SettingsTabs.ServiceModel,
+ SettingsTabs.Stats,
+ SettingsTabs.Storage,
+] as const;
+
interface SettingsContentProps {
activeTab?: string;
mobile?: boolean;
}
const SettingsContent = ({ mobile, activeTab }: SettingsContentProps) => {
+ const { t } = useTranslation(['auth', 'setting', 'subscription']);
const enableBusinessFeatures = useServerConfigStore(serverConfigSelectors.enableBusinessFeatures);
const navigate = useWorkspaceAwareNavigate();
+ const compactHeaderTitles: Partial<Record<SettingsTabs, string>> = {
+ [SettingsTabs.About]: t('setting:tab.about'),
+ [SettingsTabs.APIKey]: t('setting:tab.apikey'),
+ [SettingsTabs.Appearance]: t('setting:tab.appearance'),
+ [SettingsTabs.Billing]: t('subscription:tab.billing'),
+ [SettingsTabs.Credits]: t('subscription:tab.credits'),
+ [SettingsTabs.Devices]: t('setting:devices.title'),
+ [SettingsTabs.Hotkey]: t('setting:tab.hotkey'),
+ [SettingsTabs.Memory]: t('setting:tab.memory'),
+ [SettingsTabs.Notification]: t('setting:tab.notification'),
+ [SettingsTabs.Plans]: t('subscription:tab.plans'),
+ [SettingsTabs.Profile]: t('auth:profile.title'),
+ [SettingsTabs.Referral]: t('subscription:tab.referral'),
+ [SettingsTabs.ServiceModel]: t('setting:tab.serviceModel'),
+ [SettingsTabs.Stats]: t('auth:tab.stats'),
+ [SettingsTabs.Storage]: t('setting:tab.storage'),
+ };
+
useSettingsAnchorScroll();
useEffect(() => {
@@ -43,7 +83,10 @@ const SettingsContent = ({ mobile, activeTab }: SettingsContentProps) => {
const Component = componentMap[tab as keyof typeof componentMap] || componentMap.appearance;
if (!Component) return null;
- const componentProps: { mobile?: boolean } = {};
+ const componentProps: { mobile?: boolean; showSettingHeader?: boolean } = {};
+ if (COMPACT_HEADER_TABS.includes(tab as (typeof COMPACT_HEADER_TABS)[number])) {
+ componentProps.showSettingHeader = false;
+ }
if (
[
SettingsTabs.About,
@@ -52,6 +95,7 @@ const SettingsContent = ({ mobile, activeTab }: SettingsContentProps) => {
SettingsTabs.Profile,
SettingsTabs.Stats,
SettingsTabs.Usage,
+ SettingsTabs.Creds,
SettingsTabs.Security,
...(enableBusinessFeatures
? [SettingsTabs.Plans, SettingsTabs.Credits, SettingsTabs.Billing, SettingsTabs.Referral]
@@ -76,13 +120,23 @@ const SettingsContent = ({ mobile, activeTab }: SettingsContentProps) => {
const isFullWidth =
tabKey === SettingsTabs.Provider ||
tabKey === SettingsTabs.Skill ||
- tabKey === SettingsTabs.Connector;
+ tabKey === SettingsTabs.Connector ||
+ tabKey === SettingsTabs.Creds ||
+ tabKey === SettingsTabs.Usage;
if (activeTab !== tabKey) return null;
const content = renderComponent(tabKey);
if (isFullWidth) return <Fragment key={tabKey}>{content}</Fragment>;
+ const compactHeaderTitle = compactHeaderTitles[tabKey as SettingsTabs];
+ const compactHeaderExtra =
+ tabKey === SettingsTabs.Memory ? <ManageMemoryButton /> : undefined;
return (
<Fragment key={tabKey}>
- <NavHeader />
+ <NavHeader
+ right={compactHeaderExtra}
+ styles={compactHeaderTitle ? { center: { alignItems: 'center' } } : undefined}
+ >
+ {compactHeaderTitle && <Text weight={500}>{compactHeaderTitle}</Text>}
+ </NavHeader>
<SettingContainer maxWidth={1024} paddingBlock={'24px 128px'} paddingInline={24}>
{content}
</SettingContainer>
diff --git a/src/routes/(main)/settings/hotkey/features/Conversation.tsx b/src/routes/(main)/settings/hotkey/features/Conversation.tsx
index 24986386895..3ae78abf953 100644
--- a/src/routes/(main)/settings/hotkey/features/Conversation.tsx
+++ b/src/routes/(main)/settings/hotkey/features/Conversation.tsx
@@ -12,11 +12,12 @@ import { HOTKEYS_REGISTRATION } from '@/const/hotkeys';
import { FORM_STYLE } from '@/const/layoutTokens';
import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';
import { useSaveState } from '@/hooks/useSaveState';
-import hotkeyMeta from '@/locales/default/hotkey';
import { useUserStore } from '@/store/user';
import { settingsSelectors } from '@/store/user/selectors';
import { type HotkeyItem } from '@/types/hotkey';
+import { hotkeyFormStyles } from './styles';
+
const HotkeySetting = memo(() => {
const { t } = useTranslation(['setting', 'hotkey']);
const [form] = Form.useForm();
@@ -54,7 +55,6 @@ const HotkeySetting = memo(() => {
onClear={() => void clearHotkeyBinding(item.id)}
/>
),
- desc: hotkeyMeta[`${item.id}.desc`] ? t(`${item.id}.desc`, { ns: 'hotkey' }) : undefined,
label: t(`${item.id}.title`, { ns: 'hotkey' }),
name: item.id,
};
@@ -64,7 +64,10 @@ const HotkeySetting = memo(() => {
children: HOTKEYS_REGISTRATION.filter(
(item) => item.group === HotkeyGroupEnum.Conversation,
).map((item) => mapHotkeyItem(item)),
- extra: <AutoSaveHint lastUpdatedTime={lastSavedAt} saveStatus={saveStatus} onRetry={retry} />,
+ extra:
+ saveStatus === 'idle' ? undefined : (
+ <AutoSaveHint lastUpdatedTime={lastSavedAt} saveStatus={saveStatus} onRetry={retry} />
+ ),
title: (
<SettingsSearchAnchor id={'hotkey-conversation'}>
{t('hotkey.group.conversation')}
@@ -74,6 +77,7 @@ const HotkeySetting = memo(() => {
return (
<Form
+ classNames={{ item: hotkeyFormStyles.item }}
collapsible={false}
form={form}
initialValues={hotkey}
diff --git a/src/routes/(main)/settings/hotkey/features/Desktop.tsx b/src/routes/(main)/settings/hotkey/features/Desktop.tsx
index fe7cbb00c51..24d79600da3 100644
--- a/src/routes/(main)/settings/hotkey/features/Desktop.tsx
+++ b/src/routes/(main)/settings/hotkey/features/Desktop.tsx
@@ -11,11 +11,12 @@ import { useTranslation } from 'react-i18next';
import { DESKTOP_HOTKEYS_REGISTRATION } from '@/const/desktopGlobalShortcuts';
import { FORM_STYLE } from '@/const/layoutTokens';
import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';
-import hotkeyMeta from '@/locales/default/hotkey';
import { useElectronStore } from '@/store/electron';
import { desktopHotkeysSelectors } from '@/store/electron/selectors';
import { type DesktopHotkeyItem } from '@/types/hotkey';
+import { hotkeyFormStyles } from './styles';
+
const HotkeySetting = memo(() => {
const { t } = useTranslation(['setting', 'hotkey']);
const [form] = Form.useForm();
@@ -65,10 +66,7 @@ const HotkeySetting = memo(() => {
/>
),
- desc: hotkeyMeta[`desktop.${item.id}.desc` as keyof typeof hotkeyMeta]
- ? t(`desktop.${item.id}.desc` as keyof typeof hotkeyMeta, { ns: 'hotkey' })
- : undefined,
- label: t(`desktop.${item.id}.title` as keyof typeof hotkeyMeta, { ns: 'hotkey' }),
+ label: t(`desktop.${item.id}.title`, { ns: 'hotkey' }),
name: item.id,
});
@@ -82,6 +80,7 @@ const HotkeySetting = memo(() => {
return (
<Form
+ classNames={{ item: hotkeyFormStyles.item }}
collapsible={false}
form={form}
initialValues={hotkeys}
diff --git a/src/routes/(main)/settings/hotkey/features/Essential.tsx b/src/routes/(main)/settings/hotkey/features/Essential.tsx
index ac4f9c5aa0b..649286ab3b5 100644
--- a/src/routes/(main)/settings/hotkey/features/Essential.tsx
+++ b/src/routes/(main)/settings/hotkey/features/Essential.tsx
@@ -12,11 +12,12 @@ import { HOTKEYS_REGISTRATION } from '@/const/hotkeys';
import { FORM_STYLE } from '@/const/layoutTokens';
import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';
import { useSaveState } from '@/hooks/useSaveState';
-import hotkeyMeta from '@/locales/default/hotkey';
import { useUserStore } from '@/store/user';
import { settingsSelectors } from '@/store/user/selectors';
import { type HotkeyItem } from '@/types/hotkey';
+import { hotkeyFormStyles } from './styles';
+
const HotkeySetting = memo(() => {
const { t } = useTranslation(['setting', 'hotkey']);
const [form] = Form.useForm();
@@ -54,7 +55,6 @@ const HotkeySetting = memo(() => {
onClear={() => void clearHotkeyBinding(item.id)}
/>
),
- desc: hotkeyMeta[`${item.id}.desc`] ? t(`${item.id}.desc`, { ns: 'hotkey' }) : undefined,
label: t(`${item.id}.title`, { ns: 'hotkey' }),
name: item.id,
};
@@ -64,7 +64,10 @@ const HotkeySetting = memo(() => {
children: HOTKEYS_REGISTRATION.filter((item) => item.group === HotkeyGroupEnum.Essential).map(
(item) => mapHotkeyItem(item),
),
- extra: <AutoSaveHint lastUpdatedTime={lastSavedAt} saveStatus={saveStatus} onRetry={retry} />,
+ extra:
+ saveStatus === 'idle' ? undefined : (
+ <AutoSaveHint lastUpdatedTime={lastSavedAt} saveStatus={saveStatus} onRetry={retry} />
+ ),
title: (
<SettingsSearchAnchor id={'hotkey-essential'}>
{t('hotkey.group.essential')}
@@ -74,6 +77,7 @@ const HotkeySetting = memo(() => {
return (
<Form
+ classNames={{ item: hotkeyFormStyles.item }}
collapsible={false}
form={form}
initialValues={hotkey}
diff --git a/src/routes/(main)/settings/hotkey/features/styles.ts b/src/routes/(main)/settings/hotkey/features/styles.ts
new file mode 100644
index 00000000000..ac3b3d94c0f
--- /dev/null
+++ b/src/routes/(main)/settings/hotkey/features/styles.ts
@@ -0,0 +1,10 @@
+import { createStaticStyles } from 'antd-style';
+
+export const hotkeyFormStyles = createStaticStyles(({ css }) => ({
+ item: css`
+ .ant-form-item-label > label {
+ align-items: center;
+ min-block-size: 36px;
+ }
+ `,
+}));
diff --git a/src/routes/(main)/settings/hotkey/index.tsx b/src/routes/(main)/settings/hotkey/index.tsx
index efaa16681ed..7218b1ca5f6 100644
--- a/src/routes/(main)/settings/hotkey/index.tsx
+++ b/src/routes/(main)/settings/hotkey/index.tsx
@@ -7,11 +7,15 @@ import Conversation from './features/Conversation';
import Desktop from './features/Desktop';
import Essential from './features/Essential';
-const Page = () => {
+interface PageProps {
+ showSettingHeader?: boolean;
+}
+
+const Page = ({ showSettingHeader = true }: PageProps) => {
const { t } = useTranslation('setting');
return (
<>
- <SettingHeader title={t('tab.hotkey')} />
+ {showSettingHeader && <SettingHeader title={t('tab.hotkey')} />}
{isDesktop && <Desktop />}
<Essential />
<Conversation />
diff --git a/src/routes/(main)/settings/memory/features/ManageMemoryButton.tsx b/src/routes/(main)/settings/memory/features/ManageMemoryButton.tsx
new file mode 100644
index 00000000000..1dfb2473c6a
--- /dev/null
+++ b/src/routes/(main)/settings/memory/features/ManageMemoryButton.tsx
@@ -0,0 +1,27 @@
+'use client';
+
+import { isDesktop } from '@lobechat/const';
+import { Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
+import { BrainCircuit } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
+
+import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
+
+export const ManageMemoryButton = () => {
+ const { t } = useTranslation('setting');
+ const navigate = useWorkspaceAwareNavigate();
+
+ // The `/memory` manager route is registered in the desktop router only.
+ if (!isDesktop) return null;
+
+ return (
+ <Button
+ icon={<Icon icon={BrainCircuit} />}
+ size={'small'}
+ onClick={() => navigate('/memory', { escape: true })}
+ >
+ {t('memory.manageEntry')}
+ </Button>
+ );
+};
diff --git a/src/routes/(main)/settings/memory/index.tsx b/src/routes/(main)/settings/memory/index.tsx
index 44f1088cc6c..450a80b64d9 100644
--- a/src/routes/(main)/settings/memory/index.tsx
+++ b/src/routes/(main)/settings/memory/index.tsx
@@ -1,42 +1,23 @@
'use client';
-import { isDesktop } from '@lobechat/const';
-import { Icon } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
-import { BrainCircuit } from 'lucide-react';
import { useTranslation } from 'react-i18next';
-import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';
+import { ManageMemoryButton } from './features/ManageMemoryButton';
import Memory from './features/Memory';
-const Page = () => {
+interface PageProps {
+ showSettingHeader?: boolean;
+}
+
+const Page = ({ showSettingHeader = true }: PageProps) => {
const { t } = useTranslation('setting');
- const navigate = useWorkspaceAwareNavigate();
return (
<>
- <SettingHeader
- title={t('tab.memory')}
- // Config and management live on separate surfaces — give this settings
- // page the entry to actually view / edit / clear memory that its copy
- // promises, instead of dead-ending at a toggle + slider.
- // Desktop-only: the `/memory` manager route is registered in the desktop
- // router, not the mobile one (mobile renders this same tab via its
- // generic settings route but has no `/memory`). Linking on mobile would
- // hit an unmatched route / blank page.
- extra={
- isDesktop ? (
- <Button
- icon={<Icon icon={BrainCircuit} />}
- size={'small'}
- onClick={() => navigate('/memory', { escape: true })}
- >
- {t('memory.manageEntry')}
- </Button>
- ) : undefined
- }
- />
+ {showSettingHeader && (
+ <SettingHeader extra={<ManageMemoryButton />} title={t('tab.memory')} />
+ )}
<Memory />
</>
);
diff --git a/src/routes/(main)/settings/profile/index.tsx b/src/routes/(main)/settings/profile/index.tsx
index 53995c1206b..70ebc73e222 100644
--- a/src/routes/(main)/settings/profile/index.tsx
+++ b/src/routes/(main)/settings/profile/index.tsx
@@ -33,7 +33,11 @@ const SkeletonRow = () => (
</ProfileRow>
);
-const ProfileSetting = () => {
+interface ProfileSettingProps {
+ showSettingHeader?: boolean;
+}
+
+const ProfileSetting = ({ showSettingHeader = true }: ProfileSettingProps) => {
const isLogin = useUserStore(authSelectors.isLogin);
const [userProfile, isUserLoaded] = useUserStore((s) => [
userProfileSelectors.userProfile(s),
@@ -69,7 +73,7 @@ const ProfileSetting = () => {
return (
<>
- <SettingHeader title={t('profile.title')} />
+ {showSettingHeader && <SettingHeader title={t('profile.title')} />}
<FormGroup collapsible={false} gap={16} title={t('profile.account')} variant={'filled'}>
<Flexbox style={{ display: isLoading ? 'flex' : 'none' }}>
<SkeletonRow />
diff --git a/src/routes/(main)/settings/provider/(list)/Footer.tsx b/src/routes/(main)/settings/provider/(list)/Footer.tsx
deleted file mode 100644
index 450d2f846f2..00000000000
--- a/src/routes/(main)/settings/provider/(list)/Footer.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-'use client';
-
-import { Center } from '@lobehub/ui';
-import { cssVar } from 'antd-style';
-import { memo } from 'react';
-import { Trans, useTranslation } from 'react-i18next';
-
-import { MORE_MODEL_PROVIDER_REQUEST_URL } from '@/const/url';
-
-const Footer = memo(() => {
- const { t } = useTranslation('setting');
- return (
- <Center
- width={'100%'}
- style={{
- background: cssVar.colorFillQuaternary,
- border: `1px dashed ${cssVar.colorFillSecondary}`,
- borderRadius: cssVar.borderRadiusLG,
- padding: 12,
- }}
- >
- <div style={{ color: cssVar.colorTextSecondary, fontSize: 12, textAlign: 'center' }}>
- <Trans
- i18nKey="llm.waitingForMore"
- ns={'setting'}
- components={[
- <span key="0" />,
- <a
- aria-label={t('llm.waitingForMoreLinkAriaLabel')}
- href={MORE_MODEL_PROVIDER_REQUEST_URL}
- key="1"
- rel="noreferrer"
- target="_blank"
- />,
- ]}
- />
- </div>
- </Center>
- );
-});
-
-export default Footer;
diff --git a/src/routes/(main)/settings/provider/(list)/index.tsx b/src/routes/(main)/settings/provider/(list)/index.tsx
index 99fd542ebec..d844c1dfd3f 100644
--- a/src/routes/(main)/settings/provider/(list)/index.tsx
+++ b/src/routes/(main)/settings/provider/(list)/index.tsx
@@ -3,13 +3,9 @@
import { useMemo, useState } from 'react';
import { useSearchParams } from 'react-router';
-import { isCustomBranding } from '@/const/version';
-
import DesktopLayout from '../_layout/Desktop';
import MobileLayout from '../_layout/Mobile';
import ProviderDetailPage from '../detail';
-import { shouldShowProviderFooter } from '../features/providerSettings';
-import Footer from './Footer';
const Page = (props: { mobile?: boolean }) => {
const [SearchParams, setSearchParams] = useSearchParams();
@@ -26,12 +22,7 @@ const Page = (props: { mobile?: boolean }) => {
return <ProviderDetailPage id={provider} onProviderSelect={setProvider} />;
}, [provider]);
- return (
- <ProviderLayout onProviderSelect={setProvider}>
- {ProviderListPage}
- {shouldShowProviderFooter({ isCustomBranding, providerId: provider }) && <Footer />}
- </ProviderLayout>
- );
+ return <ProviderLayout onProviderSelect={setProvider}>{ProviderListPage}</ProviderLayout>;
};
export default Page;
diff --git a/src/routes/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/normalizeProviderSettings.test.ts b/src/routes/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/normalizeProviderSettings.test.ts
index bc8e005562f..668bd8cdcf3 100644
--- a/src/routes/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/normalizeProviderSettings.test.ts
+++ b/src/routes/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/normalizeProviderSettings.test.ts
@@ -1,10 +1,6 @@
import { describe, expect, it } from 'vitest';
-import {
- isResponsesApiSupportedSdkType,
- normalizeProviderSettings,
- shouldShowProviderFooter,
-} from '../../providerSettings';
+import { isResponsesApiSupportedSdkType, normalizeProviderSettings } from '../../providerSettings';
describe('isResponsesApiSupportedSdkType', () => {
it('should return true for openai and router sdk types', () => {
@@ -18,27 +14,6 @@ describe('isResponsesApiSupportedSdkType', () => {
});
});
-describe('shouldShowProviderFooter', () => {
- it('should hide the footer for OAuth device flow providers', () => {
- expect(shouldShowProviderFooter({ isCustomBranding: false, providerId: 'supergrok' })).toBe(
- false,
- );
- });
-
- it('should hide the footer for custom branding', () => {
- expect(shouldShowProviderFooter({ isCustomBranding: true, providerId: 'openai' })).toBe(false);
- });
-
- it('should show the footer for regular providers', () => {
- expect(shouldShowProviderFooter({ isCustomBranding: false, providerId: 'openai' })).toBe(true);
- });
-
- it('should show the footer on the provider list where no provider is selected', () => {
- expect(shouldShowProviderFooter({ isCustomBranding: false, providerId: 'all' })).toBe(true);
- expect(shouldShowProviderFooter({ isCustomBranding: false })).toBe(true);
- });
-});
-
describe('normalizeProviderSettings', () => {
it('should keep supportResponsesApi when switching from router to openai', () => {
const result = normalizeProviderSettings({
diff --git a/src/routes/(main)/settings/provider/features/providerSettings.ts b/src/routes/(main)/settings/provider/features/providerSettings.ts
index ce7000cf973..cdbc906217b 100644
--- a/src/routes/(main)/settings/provider/features/providerSettings.ts
+++ b/src/routes/(main)/settings/provider/features/providerSettings.ts
@@ -1,5 +1,3 @@
-import { isProviderOAuthDeviceFlow } from 'model-bank/modelProviders';
-
import { type AiProviderSDKType, type AiProviderSettings } from '@/types/aiProvider';
const RESPONSE_API_SUPPORTED_SDK_TYPES = new Set<AiProviderSDKType>(['openai', 'router']);
@@ -10,18 +8,6 @@ export const isResponsesApiSupportedSdkType = (sdkType?: AiProviderSDKType) => {
return RESPONSE_API_SUPPORTED_SDK_TYPES.has(sdkType);
};
-interface ShouldShowProviderFooterParams {
- isCustomBranding: boolean;
- providerId?: string;
-}
-
-// Subscription OAuth providers source models from the user's own account,
-// so the "more providers coming" footer reads as a misleading model roadmap there.
-export const shouldShowProviderFooter = ({
- isCustomBranding,
- providerId,
-}: ShouldShowProviderFooterParams) => !isCustomBranding && !isProviderOAuthDeviceFlow(providerId);
-
interface NormalizeProviderSettingsParams {
nextSettings?: AiProviderSettings;
previousSettings?: AiProviderSettings;
diff --git a/src/routes/(main)/settings/provider/index.tsx b/src/routes/(main)/settings/provider/index.tsx
index 55a1fa3b20e..005f37ec936 100644
--- a/src/routes/(main)/settings/provider/index.tsx
+++ b/src/routes/(main)/settings/provider/index.tsx
@@ -4,19 +4,15 @@ import { Flexbox } from '@lobehub/ui';
import { memo } from 'react';
import { Outlet, useParams } from 'react-router';
-import { isCustomBranding } from '@/const/version';
import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
import DesktopLayoutContainer from './_layout/Desktop/Container';
-import Footer from './(list)/Footer';
import ProviderDetailPageComponent from './detail';
-import { shouldShowProviderFooter } from './features/providerSettings';
import ProviderMenu from './ProviderMenu';
// Layout component that wraps provider pages with navigation
export const ProviderLayout = memo(() => {
const navigate = useWorkspaceAwareNavigate();
- const { providerId } = useParams<{ providerId: string }>();
const handleProviderSelect = (providerKey: string) => {
navigate(`/settings/provider/${providerKey}`);
@@ -33,7 +29,6 @@ export const ProviderLayout = memo(() => {
<ProviderMenu mobile={false} onProviderSelect={handleProviderSelect} />
<DesktopLayoutContainer>
<Outlet />
- {shouldShowProviderFooter({ isCustomBranding, providerId }) && <Footer />}
</DesktopLayoutContainer>
</Flexbox>
);
diff --git a/src/routes/(main)/settings/service-model/index.tsx b/src/routes/(main)/settings/service-model/index.tsx
index 2ecbacb848a..f9d3add1d31 100644
--- a/src/routes/(main)/settings/service-model/index.tsx
+++ b/src/routes/(main)/settings/service-model/index.tsx
@@ -9,12 +9,16 @@ import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfi
import Image from '../image/features/Image';
import OpenAI from '../tts/features/OpenAI';
-const Page = () => {
+interface PageProps {
+ showSettingHeader?: boolean;
+}
+
+const Page = ({ showSettingHeader = true }: PageProps) => {
const { t } = useTranslation('setting');
const { enableSTT, showAiImage } = useServerConfigStore(featureFlagsSelectors);
return (
<>
- <SettingHeader title={t('tab.serviceModel')} />
+ {showSettingHeader && <SettingHeader title={t('tab.serviceModel')} />}
<ModelAssignmentsForm />
{enableSTT && <OpenAI />}
{showAiImage && <Image />}
diff --git a/src/routes/(main)/settings/stats/index.tsx b/src/routes/(main)/settings/stats/index.tsx
index 084cf7ab5bb..693553130ed 100644
--- a/src/routes/(main)/settings/stats/index.tsx
+++ b/src/routes/(main)/settings/stats/index.tsx
@@ -46,10 +46,12 @@ interface StatsSettingProps {
mobile?: boolean;
/** Resolve userId → display info. Required when `enableUserDimension` is true. */
resolveUser?: UserDisplayResolver;
+ /** Render the standard personal-settings title and divider. */
+ showSettingHeader?: boolean;
}
const StatsSetting = memo<StatsSettingProps>(
- ({ mobile, headerNode, enableUserDimension, resolveUser }) => {
+ ({ mobile, headerNode, enableUserDimension, resolveUser, showSettingHeader = true }) => {
const { t, i18n } = useTranslation('auth');
dayjs.locale(i18n.language);
@@ -80,7 +82,7 @@ const StatsSetting = memo<StatsSettingProps>(
return (
<>
- <SettingHeader title={t('tab.stats')} />
+ {showSettingHeader && <SettingHeader title={t('tab.stats')} />}
{/* ========== Header Section ========== */}
<FormGroup
collapsible={false}
diff --git a/src/routes/(main)/settings/storage/index.tsx b/src/routes/(main)/settings/storage/index.tsx
index 14ea96695ba..90c5586f448 100644
--- a/src/routes/(main)/settings/storage/index.tsx
+++ b/src/routes/(main)/settings/storage/index.tsx
@@ -10,7 +10,11 @@ import { authSelectors } from '@/store/user/selectors';
import Advanced from './features/Advanced';
-const Page = () => {
+interface PageProps {
+ showSettingHeader?: boolean;
+}
+
+const Page = ({ showSettingHeader = true }: PageProps) => {
const { t } = useTranslation('setting');
const serverConfigInit = useServerConfigStore((s) => s.serverConfigInit);
const isUserLoaded = useUserStore(authSelectors.isLoaded);
@@ -19,7 +23,7 @@ const Page = () => {
return (
<>
- <SettingHeader title={t('tab.storage')} />
+ {showSettingHeader && <SettingHeader title={t('tab.storage')} />}
<Flexbox style={{ display: isLoading ? 'flex' : 'none' }}>
<FormGroup collapsible={false} title={t('storage.actions.title')} variant="filled">
<Skeleton active paragraph={{ rows: 4 }} />
diff --git a/src/services/chat/mecha/skillPreload.ts b/src/services/chat/mecha/skillPreload.ts
index 0d41c734664..2ad72cf09ef 100644
--- a/src/services/chat/mecha/skillPreload.ts
+++ b/src/services/chat/mecha/skillPreload.ts
@@ -88,7 +88,7 @@ const mapToCredSummary = (cred: UserCredSummary): CredSummary => ({
*/
const buildCredsContext = (userCreds?: UserCredSummary[]): UserCredsContext => ({
creds: (userCreds || []).map(mapToCredSummary),
- settingsUrl: '/settings/creds',
+ settingsUrl: '/settings/credential',
});
const loadSkillContent = async (
diff --git a/src/spa/router/desktopRouter.config.desktop.tsx b/src/spa/router/desktopRouter.config.desktop.tsx
index 20552561361..ee1771af746 100644
--- a/src/spa/router/desktopRouter.config.desktop.tsx
+++ b/src/spa/router/desktopRouter.config.desktop.tsx
@@ -671,6 +671,10 @@ export const desktopRoutes: RouteObject[] = [
handle: { settingsTab: SettingsTabs.Memory },
path: 'memory',
},
+ {
+ element: redirectElement('/settings/credential'),
+ path: 'creds',
+ },
// Other settings tabs
{
element: <SettingsTabPage />,
diff --git a/src/spa/router/desktopRouter.config.tsx b/src/spa/router/desktopRouter.config.tsx
index 792ce826afc..51b38456a04 100644
--- a/src/spa/router/desktopRouter.config.tsx
+++ b/src/spa/router/desktopRouter.config.tsx
@@ -772,6 +772,10 @@ export const desktopRoutes: RouteObject[] = [
handle: { settingsTab: SettingsTabs.Memory },
path: 'memory',
},
+ {
+ element: redirectElement('/settings/credential'),
+ path: 'creds',
+ },
// Other settings tabs
{
element: dynamicElement(
diff --git a/src/spa/router/mobileRouter.config.tsx b/src/spa/router/mobileRouter.config.tsx
index f848efe081c..db6314af485 100644
--- a/src/spa/router/mobileRouter.config.tsx
+++ b/src/spa/router/mobileRouter.config.tsx
@@ -308,6 +308,10 @@ export const mobileRoutes: RouteObject[] = [
),
path: 'provider',
},
+ {
+ element: redirectElement('/settings/credential'),
+ path: 'creds',
+ },
// Other settings tabs (common, agent, memory, tts, about, etc.)
{
element: dynamicElement(
diff --git a/src/store/global/initialState.ts b/src/store/global/initialState.ts
index 19e3e99d9f9..fc5f069bc51 100644
--- a/src/store/global/initialState.ts
+++ b/src/store/global/initialState.ts
@@ -62,7 +62,7 @@ export enum SettingsTabs {
Common = 'common',
Connector = 'connector',
Credits = 'credits',
- Creds = 'creds',
+ Creds = 'credential',
Devices = 'devices',
Hotkey = 'hotkey',
/** @deprecated Use ServiceModel instead */