From db1a46af3937b914a50fdfb4b4be62ad97a9920e Mon Sep 17 00:00:00 2001 From: "DESKTOP-72TV0V4\\caoxiaozhu" Date: Wed, 25 Mar 2026 15:45:10 +0800 Subject: [PATCH] Update agents hierarchy canvas interactions Expand the agents page into a three-tier org chart, refine zoom and active route feedback, and cover the hierarchy behavior with targeted tests. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/pages/agents/agentsPage.test.ts | 29 + frontend/src/pages/agents/index.vue | 834 ++++++++++++------- 2 files changed, 559 insertions(+), 304 deletions(-) diff --git a/frontend/src/pages/agents/agentsPage.test.ts b/frontend/src/pages/agents/agentsPage.test.ts index 9cdda37..e60e513 100644 --- a/frontend/src/pages/agents/agentsPage.test.ts +++ b/frontend/src/pages/agents/agentsPage.test.ts @@ -64,6 +64,24 @@ describe('agents page pcb command center', () => { beforeEach(() => { vi.clearAllMocks() vi.useFakeTimers() + vi.stubGlobal('ResizeObserver', class { + observe() {} + disconnect() {} + unobserve() {} + }) + Object.defineProperty(window, 'matchMedia', { + writable: true, + value: vi.fn().mockImplementation(() => ({ + matches: true, + media: '(prefers-reduced-motion: no-preference)', + onchange: null, + addListener: vi.fn(), + removeListener: vi.fn(), + addEventListener: vi.fn(), + removeEventListener: vi.fn(), + dispatchEvent: vi.fn(), + })), + }) mocks.getHierarchyStats.mockResolvedValue(hierarchyStats) mocks.updateConfig.mockResolvedValue({}) }) @@ -92,6 +110,17 @@ describe('agents page pcb command center', () => { expect(routeTelemetry.text()).toContain('STEPS') }) + it('renders child agents beneath the four main roles in the same hierarchy canvas', async () => { + const wrapper = mount(AgentsPage) + await Promise.resolve() + await Promise.resolve() + + expect(wrapper.get('[data-testid="agent-chip-planner_scope"]').text()).toContain('SCOPE') + expect(wrapper.get('[data-testid="agent-chip-planner_steps"]').text()).toContain('STEPS') + expect(wrapper.get('[data-testid="agent-chip-executor_tasks"]').text()).toContain('TASK OPS') + expect(wrapper.get('[data-testid="agent-chip-analyst_insights"]').text()).toContain('INSIGHTS') + }) + it('keeps the configuration drawer available when selecting a main agent chip', async () => { const wrapper = mount(AgentsPage) await Promise.resolve() diff --git a/frontend/src/pages/agents/index.vue b/frontend/src/pages/agents/index.vue index ea7ee79..5ac1d55 100644 --- a/frontend/src/pages/agents/index.vue +++ b/frontend/src/pages/agents/index.vue @@ -1,13 +1,11 @@