From 5c53d7f0e9973ecd48eb9050a8ba7da995dd71c8 Mon Sep 17 00:00:00 2001 From: Roe-xin Date: Mon, 5 Jan 2026 16:22:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=92=8C=E5=A2=9E=E5=8A=A0icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants/toolIcons.ts | 5 +++ src/views/agentModeSelector.ts | 57 +++++++++++++++++++++++++++------- 2 files changed, 50 insertions(+), 12 deletions(-) diff --git a/src/constants/toolIcons.ts b/src/constants/toolIcons.ts index 6fff308..6c35aac 100644 --- a/src/constants/toolIcons.ts +++ b/src/constants/toolIcons.ts @@ -82,6 +82,11 @@ export const agentIconSvg = ` */ export const plannerIconSvg = ``; +/** + * Ask 模式图标 SVG + */ +export const askIconSvg = ``; + /** * 保存知识库图标 SVG */ diff --git a/src/views/agentModeSelector.ts b/src/views/agentModeSelector.ts index 414fc49..71d36c6 100644 --- a/src/views/agentModeSelector.ts +++ b/src/views/agentModeSelector.ts @@ -8,6 +8,12 @@ * - Agent: 智能体自主,自动执行大部分操作 */ +import { + plannerIconSvg, + askIconSvg, + agentIconSvg, +} from "../constants/toolIcons"; + /** * 获取模式选择器的 HTML 内容 */ @@ -23,16 +29,25 @@ export function getModeSelectorContent(): string {
- Plan - 只读模式 +
+ ${plannerIconSvg} + Plan +
+ 仅根据需求生成设计文档,之后由用户决定下一步,可以提高工程质量
- Ask - 逐个确认 +
+ ${askIconSvg} + Ask +
+ 仅给与智能体读权限,用于依据项目回答用户问题,或者与用户进行探讨
- Agent - 智能体自主 +
+ ${agentIconSvg} + Agent +
+ 用于快速生成工程、调试修改现有代码
@@ -83,7 +98,8 @@ export function getModeSelectorStyles(): string { position: absolute; bottom: calc(100% + 2px); left: 0; - min-width: 140px; + min-width: 200px; + max-width: 300px; background: var(--vscode-dropdown-background); border: 1px solid var(--vscode-dropdown-border); border-radius: 4px; @@ -98,13 +114,12 @@ export function getModeSelectorStyles(): string { /* 模式选择器的选项样式 */ .mode-option { display: flex; - justify-content: space-between; - align-items: center; + flex-direction: column; + align-items: flex-start; padding: 8px 12px; font-size: 12px; cursor: pointer; transition: background 0.2s ease; - white-space: nowrap; } .mode-option:hover { background: rgba(128, 128, 128, 0.3); @@ -112,13 +127,31 @@ export function getModeSelectorStyles(): string { .mode-option.selected { background: rgba(64, 158, 255, 0.2); } + .mode-option-header { + display: flex; + align-items: center; + gap: 6px; + margin-bottom: 4px; + } + .mode-option-icon { + display: inline-flex; + align-items: center; + flex-shrink: 0; + } + .mode-option-icon svg { + width: 16px; + height: 16px; + display: block; + } .mode-option-label { font-weight: 500; } .mode-option-desc { font-size: 10px; color: var(--vscode-descriptionForeground); - margin-left: 12px; + line-height: 1.4; + word-wrap: break-word; + white-space: normal; } `; } @@ -159,7 +192,7 @@ export function getModeSelectorScript(): string { const tooltipMap = { 'plan': 'plan模式', 'ask': 'ask模式', - 'agent': 'agent模式', + 'agent': 'agent模式' }; modeTooltip.textContent = tooltipMap[value] || '切换模式'; }