From ca1d838afc39904c61f474e66d6032377e70040d Mon Sep 17 00:00:00 2001 From: imccyu Date: Sat, 1 Aug 2026 15:55:51 +0800 Subject: [PATCH] style(web): refine subagent navigation chrome --- .../tests/assembly-surfaces.spec.tsx | 13 ++++--- .../client/SubagentCatalogAction.module.css | 35 +++++++++++++++---- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/packages/client/ui-conversation/tests/assembly-surfaces.spec.tsx b/packages/client/ui-conversation/tests/assembly-surfaces.spec.tsx index 7c9e1834bb..7cae1606b9 100644 --- a/packages/client/ui-conversation/tests/assembly-surfaces.spec.tsx +++ b/packages/client/ui-conversation/tests/assembly-surfaces.spec.tsx @@ -20,7 +20,7 @@ * suite only proves the assembled wiring. */ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { cleanup, fireEvent, waitFor } from '@testing-library/react' +import { cleanup, fireEvent, waitFor, within } from '@testing-library/react' import { LocaleService } from '@deepseek-ai/dsh-client-locale/client' import type { ISession, SessionId, TodoItem, ToolResultNode } from '@deepseek-ai/dsh-client-runtime/client' import type { PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots' @@ -256,14 +256,17 @@ describe('prompt rejection through the assembled composer', () => { }) describe('title projection across assembled surfaces', () => { - it('one summary update re-labels the current-session heading', async () => { + it('one summary update re-labels the current-session crumb', async () => { const runtime = await bench([]) const view = runtime.renderRoot() - expect(view.getByRole('heading', { name: 'S', level: 1 })).toBeTruthy() + const hierarchy = view.getByRole('navigation', { name: '会话层级' }) + expect(within(hierarchy).getByRole('button', { name: 'S' }).hasAttribute('disabled')).toBe(true) await runtime.sessions.updateSummary(SID, { displayTitle: '修订标题', title: '修订标题' }) - await waitFor(() => { expect(view.getByRole('heading', { name: '修订标题', level: 1 })).toBeTruthy() }) - expect(view.queryByRole('heading', { name: 'S', level: 1 })).toBeNull() + await waitFor(() => { + expect(within(hierarchy).getByRole('button', { name: '修订标题' }).hasAttribute('disabled')).toBe(true) + }) + expect(within(hierarchy).queryByRole('button', { name: 'S' })).toBeNull() await runtime.dispose() }) }) diff --git a/packages/client/ui-subagent/src/client/SubagentCatalogAction.module.css b/packages/client/ui-subagent/src/client/SubagentCatalogAction.module.css index 573689526d..043e149e67 100644 --- a/packages/client/ui-subagent/src/client/SubagentCatalogAction.module.css +++ b/packages/client/ui-subagent/src/client/SubagentCatalogAction.module.css @@ -41,7 +41,7 @@ width: 336px; max-width: min(400px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 140px)); - padding: 6px; + padding: 4px; overflow: auto; border: 1px solid var(--dsw-alias-border-l2); border-radius: 12px; @@ -64,7 +64,7 @@ box-sizing: border-box; width: 100%; min-height: 50px; - padding: 7px 8px; + padding: 7px 8px 7px 3px; border: 0; border-radius: 8px; background: transparent; @@ -154,17 +154,40 @@ .children { position: relative; - margin-left: 15px; - padding-left: 11px; + margin-left: 10px; + padding-left: 4px; +} + +.children::before, +.children > .node::before { + content: ''; + position: absolute; + left: 0; border-left: 1px solid var(--dsw-alias-border-l2); } +.children::before { + top: -26px; + height: 26px; +} + +.children > .node::before { + top: 0; + bottom: 0; + left: -4px; +} + +.children > .node:last-child::before { + bottom: auto; + height: 25px; +} + .children > .node > .row::before { content: ''; position: absolute; top: 24px; - left: -12px; - width: 9px; + left: -4px; + width: 7px; border-top: 1px solid var(--dsw-alias-border-l2); }