From 24560046cefc2496dae71e9ff25351f6709c401d Mon Sep 17 00:00:00 2001 From: lyingbug Date: Wed, 26 Aug 2026 18:29:59 +0800 Subject: [PATCH] ui(agent): unify skill naming and icon across editor and mentions (#2818) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ui(agent): unify skill naming and icon across editor and mentions Drop the bilingual "技能 Skills" label and mixed lightbulb/bookmark icons so the editor tab, @-mention menu, and chat chips share one name and glyph. Tighten the sandbox picker so configs show name plus type instead of parenthetical labels. * test(agent): follow the unified skills editor chrome The section no longer ships a help-circle; assert the shared skill icon and sandbox option layout instead. --- frontend/src/components/Input-field.vue | 4 +- frontend/src/components/MentionSelector.vue | 4 +- frontend/src/i18n/locales/en-US.ts | 23 ++-- frontend/src/i18n/locales/ko-KR.ts | 29 ++--- frontend/src/i18n/locales/ru-RU.ts | 25 ++-- frontend/src/i18n/locales/zh-CN.ts | 31 ++--- frontend/src/types/mention.ts | 3 + .../src/views/agent/AgentEditorModal.test.mjs | 3 +- frontend/src/views/agent/AgentEditorModal.vue | 114 +++++++++++------- frontend/src/views/chat/components/botmsg.vue | 3 +- .../src/views/chat/components/usermsg.vue | 3 +- 11 files changed, 140 insertions(+), 102 deletions(-) diff --git a/frontend/src/components/Input-field.vue b/frontend/src/components/Input-field.vue index f39dbbcc..c74fc5a2 100644 --- a/frontend/src/components/Input-field.vue +++ b/frontend/src/components/Input-field.vue @@ -41,7 +41,7 @@ import { type AgentNotReadyReasonKey, } from '@/utils/agent-readiness'; import { formatLocalizedList } from '@/utils/format-list'; -import type { MentionItem, MentionItemType, MentionRequestItem } from '@/types/mention'; +import { SKILL_ICON, type MentionItem, type MentionItemType, type MentionRequestItem } from '@/types/mention'; const route = useRoute(); const router = useRouter(); @@ -667,7 +667,7 @@ const getMentionIcon = (item: MentionItem) => { case 'file': return 'file'; case 'tag': return 'tag'; case 'mcp': return 'tools'; - case 'skill': return 'bookmark'; + case 'skill': return SKILL_ICON; default: return 'folder'; } }; diff --git a/frontend/src/components/MentionSelector.vue b/frontend/src/components/MentionSelector.vue index 14e2dc81..01abb67a 100644 --- a/frontend/src/components/MentionSelector.vue +++ b/frontend/src/components/MentionSelector.vue @@ -265,7 +265,7 @@ import { getKnowledgeBaseById } from '@/api/knowledge-base'; import { getKnowledgeDetails } from '@/api/knowledge-base'; import { useOrganizationStore } from '@/stores/organization'; import { useSettingsStore } from '@/stores/settings'; -import type { MentionItem, MentionItemType } from '@/types/mention'; +import { SKILL_ICON, type MentionItem, type MentionItemType } from '@/types/mention'; type DetailState = { loading: boolean; error?: string; data?: any }; @@ -317,7 +317,7 @@ const mentionGroupDefs = computed { const navItems = source.match(/const navItems = computed\(\(\) => \{([\s\S]*?)^\}\);/m)?.[1] assert.ok(navItems, 'expected to find the nav items computed') assert.match(navItems, /key: 'skills'/) + assert.match(navItems, /icon: SKILL_ICON/) assert.doesNotMatch(navItems, /key: 'sandbox'/) const capabilityGroup = source.match(/pickItems\(\['multimodal', 'tools', 'mcp', 'skills'\]\)/) @@ -123,6 +124,6 @@ test('skills and sandbox share one editor section', () => { assert.match(source, /sandbox: 'skills'/) assert.match(source, /formData\.config\.sandbox_config_id/) assert.match(source, /:disabled="!hasSandboxSelected"/) - assert.match(source, /name="help-circle"/) + assert.match(source, /sandbox-option/) assert.doesNotMatch(source, /skill-info-box/) }) diff --git a/frontend/src/views/agent/AgentEditorModal.vue b/frontend/src/views/agent/AgentEditorModal.vue index 6baad5a9..cab8dd12 100644 --- a/frontend/src/views/agent/AgentEditorModal.vue +++ b/frontend/src/views/agent/AgentEditorModal.vue @@ -1260,70 +1260,70 @@ - +
-
-

{{ $t('agent.editor.skillsConfig') }}

- - - - -
+

{{ $t('agent.editor.skillsConfig') }}

{{ $t('agent.editor.skillsConfigDesc') }}

-

{{ $t('agent.editor.sandboxBackendHint') }}

-
- +
+ - + +
+ {{ cfg.name }} + {{ backendLabel(cfg.sandbox_type) }} +
+
{{ $t('agent.editor.goSandboxSettings') }} +

+ {{ $t('agent.editor.sandboxNoConfigs') }} +

-
-
-

{{ $t('agent.editor.sandboxNoConfigs') }}

-
-
- -

{{ $t('agent.editor.skillsSelectionDesc') }}

-
+
{{ $t('agent.editor.skillsAll') }} {{ $t('agent.editor.skillsSelected') }} {{ $t('agent.editor.skillsNone') }} +

+ {{ $t('agent.editor.skillsNeedSandbox') }} +

+

+ {{ $t('agent.editor.noSkillsAvailable') }} +

-
@@ -1342,17 +1342,6 @@
- -
-
-

{{ $t('agent.editor.skillsNeedSandbox') }}

-
-
-
-
-

{{ $t('agent.editor.noSkillsAvailable') }}

-
-
@@ -1750,6 +1739,7 @@ import PromptTemplateSelector from '@/components/PromptTemplateSelector.vue'; import ModelSelector from '@/components/ModelSelector.vue'; import KBParserSettings, { type ParserEngineRule } from '@/views/knowledge/settings/KBParserSettings.vue'; import AgentShareSettings from '@/components/AgentShareSettings.vue'; +import { SKILL_ICON } from '@/types/mention'; import { listEmbedChannels } from '@/api/embed'; import { getRootZoom, rectToCssPx } from '@/utils/zoom'; import { integrationSectionKey } from '@/config/settingsRoute'; @@ -2345,7 +2335,7 @@ const navItems = computed(() => { if (isAgentMode.value) { items.push({ key: 'tools', icon: 'tools', label: t('agent.editor.toolsConfig') }); items.push({ key: 'mcp', icon: 'server', label: t('agentEditor.mcp.label') }); - items.push({ key: 'skills', icon: 'lightbulb', label: t('agent.editor.skillsConfig') }); + items.push({ key: 'skills', icon: SKILL_ICON, label: t('agent.editor.skillsConfig') }); } // 发布(仅编辑模式) if (editorMode.value === 'edit' && editorAgent.value?.id && !editorAgent.value?.is_builtin && !authStore.isLiteMode) { @@ -5018,6 +5008,37 @@ const handleSave = async () => { } } +.sandbox-select-control { + flex-direction: column; + align-items: flex-end; +} + +.sandbox-config-select { + width: 280px; +} + +.sandbox-option { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + width: 100%; + min-width: 0; +} + +.sandbox-option__name { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.sandbox-option__type { + flex-shrink: 0; + color: var(--td-text-color-placeholder); + font-size: 12px; +} + // 名称输入框带头像预览 .name-input-wrapper { display: flex; @@ -6095,6 +6116,13 @@ const handleSave = async () => { } } +.sandbox-config-select-popup { + .t-select-option { + height: auto; + padding: 6px 10px; + } +} + .agent-type-option { display: flex; flex-direction: column; diff --git a/frontend/src/views/chat/components/botmsg.vue b/frontend/src/views/chat/components/botmsg.vue index 32c72e9c..0f658420 100644 --- a/frontend/src/views/chat/components/botmsg.vue +++ b/frontend/src/views/chat/components/botmsg.vue @@ -130,6 +130,7 @@ import { refreshMarkdownEnhancements } from '@/utils/markdownEnhancements'; import { useChatCitationPopover } from '@/composables/useChatCitationPopover'; import { useTypewriter } from '@/composables/useTypewriter'; import { vStableHtml } from '@/directives/stableHtml'; +import { SKILL_ICON } from '@/types/mention'; ensureMermaidInitialized(); @@ -141,7 +142,7 @@ const mentionTagClass = (item) => { const mentionTagIcon = (item) => { if (item.type === 'tag') return 'tag'; if (item.type === 'mcp') return 'tools'; - if (item.type === 'skill') return 'bookmark'; + if (item.type === 'skill') return SKILL_ICON; return 'file'; }; diff --git a/frontend/src/views/chat/components/usermsg.vue b/frontend/src/views/chat/components/usermsg.vue index 6dd0f2e4..c85c6e0e 100644 --- a/frontend/src/views/chat/components/usermsg.vue +++ b/frontend/src/views/chat/components/usermsg.vue @@ -53,6 +53,7 @@ import picturePreview from '@/components/picture-preview.vue'; import { useI18n } from 'vue-i18n'; import { useChatAttachmentPreviewDrawer } from '@/composables/useChatAttachmentPreviewDrawer'; import { isPreviewableAttachment, resolveAttachmentFileType } from '@/utils/attachmentPreview'; +import { SKILL_ICON } from '@/types/mention'; const { t } = useI18n(); @@ -64,7 +65,7 @@ const mentionTagClass = (item) => { const mentionTagIcon = (item) => { if (item.type === 'tag') return 'tag'; if (item.type === 'mcp') return 'tools'; - if (item.type === 'skill') return 'bookmark'; + if (item.type === 'skill') return SKILL_ICON; return 'file'; };