From cebc21aef214c4d723aa61df044f2034e2998cea Mon Sep 17 00:00:00 2001 From: figmar Date: Wed, 16 Sep 2026 02:44:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(c8):=20sidebar=20entry=20unity=20=E2=80=94?= =?UTF-8?q?=20DSH=20Icon*16=20+=20order=2040-50?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause of the visual split: 1. Icon system mismatch: apes used react-icons (FiCpu/FiGrid/FiUser, static 14px ReactNode) while native builtins use DSH's Icon*16 components (function form, host-controlled size). Two different icon libraries → inconsistent visual style. 2. Order 901-903 pushed apes tabs far after native builtins (10-35), creating two visually separate groups in the tab strip. Fix: - icon: react-icons Fi* → @deepseek-ai/dsh-client-ui-primitives Icon*16 (function form, same as builtins): agents → IconAgentPresetOutline16 apps → IconGaugeOutline16 profile → IconUserOutline16 - order: 901/902/903 → 40/45/50 (immediately after native builtins) - SIDEBAR_SERVICE_VERSION + dsh.plugin.json version → 1.1.0 (lockstep with package.json, required by manifest tests) Gate: typecheck ✓ / build ✓ / test 119 files · 1249 passed · 9 skipped · 0 failed ✓ --- dsh.plugin.json | 2 +- src/client/apes/tabs.tsx | 8 ++++---- src/client/service.ts | 2 +- tests/apes-tabs.spec.ts | 10 ++++++---- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/dsh.plugin.json b/dsh.plugin.json index d140fce..5c18d44 100644 --- a/dsh.plugin.json +++ b/dsh.plugin.json @@ -1,6 +1,6 @@ { "id": "dsh-external/dsh-apes-sidebar", - "version": "1.0.0", + "version": "1.1.0", "main": "./lib/index.js", "description": "VSCode 风格右侧侧边栏:文件资源管理器 / 编辑器 / 终端 / Git / 浏览器,按会话隔离。暴露服务供其他插件注册侧边栏页面和文件预览器", "engines": { diff --git a/src/client/apes/tabs.tsx b/src/client/apes/tabs.tsx index ec2e65e..392594d 100644 --- a/src/client/apes/tabs.tsx +++ b/src/client/apes/tabs.tsx @@ -26,7 +26,7 @@ */ import { useCallback, useMemo, useState, type CSSProperties } from 'react' import { useSyncExternalStore } from 'react' -import { FiCpu, FiGrid, FiUser } from 'react-icons/fi' +import { IconAgentPresetOutline16, IconGaugeOutline16, IconUserOutline16 } from '@deepseek-ai/dsh-client-ui-primitives' import type { TabComponentProps, TabDescriptor } from '../service.ts' import type { SidebarSessionList, @@ -231,7 +231,7 @@ function ApesAppsView(props: TabComponentProps) { * to `service.registerTab`. Information-layer tabs are single-instance. */ export const apesTabs: TabDescriptor[] = [ - { id: 'apes:agents', title: () => t('apesAgentsTitle'), icon: , order: 901, single: true, component: ApesAgentsView }, - { id: 'apes:apps', title: () => t('apesAppsTitle'), icon: , order: 902, single: true, component: ApesAppsView }, - { id: 'apes:profile', title: () => t('apesProfileTitle'), icon: , order: 903, single: true, component: ApesProfileView }, + { id: 'apes:agents', title: () => t('apesAgentsTitle'), icon: (size: number) => , order: 40, single: true, component: ApesAgentsView }, + { id: 'apes:apps', title: () => t('apesAppsTitle'), icon: (size: number) => , order: 45, single: true, component: ApesAppsView }, + { id: 'apes:profile', title: () => t('apesProfileTitle'), icon: (size: number) => , order: 50, single: true, component: ApesProfileView }, ] diff --git a/src/client/service.ts b/src/client/service.ts index c5f9d62..43ae55b 100644 --- a/src/client/service.ts +++ b/src/client/service.ts @@ -465,7 +465,7 @@ export function matchUrlTarget(tabs: readonly TabDescriptor[], url: URL): TabDes * The plugin version this service instance reports. Keep in lockstep with * `package.json`'s version — `tests/service.spec.ts` asserts the pair. */ -export const SIDEBAR_SERVICE_VERSION = '1.0.0' +export const SIDEBAR_SERVICE_VERSION = '1.1.0' /** * Monotonic capability list consumers use to gate new API usage (features diff --git a/tests/apes-tabs.spec.ts b/tests/apes-tabs.spec.ts index 0a36f07..547cc5a 100644 --- a/tests/apes-tabs.spec.ts +++ b/tests/apes-tabs.spec.ts @@ -60,7 +60,7 @@ describe('apes:* tab registrations', () => { } }) - it('apes tabs sort after the upstream builtins (order 900+)', () => { + it('apes tabs sort after the upstream builtins (order 40+)', () => { const { service, dispose } = setup() try { const orders = { @@ -68,9 +68,11 @@ describe('apes:* tab registrations', () => { apps: service.getTab('apes:apps')?.order, profile: service.getTab('apes:profile')?.order, } - expect(orders.agents).toBeGreaterThanOrEqual(900) - expect(orders.apps).toBeGreaterThanOrEqual(900) - expect(orders.profile).toBeGreaterThanOrEqual(900) + // C8: order 40-50 places apes tabs immediately after the native builtins + // (10-35), not in a far-away 900+ band — visual unity in the tab strip. + expect(orders.agents).toBeGreaterThanOrEqual(40) + expect(orders.apps).toBeGreaterThanOrEqual(40) + expect(orders.profile).toBeGreaterThanOrEqual(40) // Strictly ordered: agents < apps < profile. expect(orders.agents!).toBeLessThan(orders.apps!) expect(orders.apps!).toBeLessThan(orders.profile!)