fix: toggle the teacher dock from the conversation header

This commit is contained in:
鲨鱼辣椒
2026-09-29 17:00:06 +08:00
parent 5de8ea823d
commit 2922f35e4b
6 changed files with 132 additions and 28 deletions

View File

@@ -1470,11 +1470,12 @@ test('Windows Code titlebar keeps browser actions clear of the logo and window c
if (width === 1280 && zoom === 1) {
await page.screenshot({ path: test.info().outputPath('windows-code-titlebar.png') });
}
await header.getByRole('button', { name: '打开开发浏览器' }).click();
await expect(page.getByTestId('agent-browser-panel')).toBeVisible();
await header.getByRole('button', { name: '展开老师对话栏' }).click();
await expect(page.locator('#coding-consultation-dock')).toBeVisible();
await expect(page.getByRole('tab', { name: '操作对话' })).toHaveAttribute('aria-selected', 'true');
await assertChromeClear();
await header.getByRole('button', { name: '关闭开发浏览器' }).click();
await expect(page.getByTestId('agent-browser-panel')).toHaveCount(0);
await header.getByRole('button', { name: '收起老师对话栏' }).click();
await expect(page.locator('#coding-consultation-dock')).toHaveCount(0);
}
await page.getByTestId('titlebar-sidebar-toggle').click();
await assertChromeClear();
@@ -1537,14 +1538,19 @@ test('PI feature UI isolates Conversations and exposes queue, interaction, model
await expect(conversationHeader.getByRole('button', { name: '归档' })).toHaveCount(0);
await expect(conversationHeader.getByRole('button', { name: '智能体设置' })).toHaveCount(0);
await expect(conversationHeader.getByRole('button', { name: '打开编程工具' })).toHaveCount(0);
const browserToggle = conversationHeader.getByRole('button', { name: '打开开发浏览器' });
await expect(browserToggle).toBeVisible();
const teacherToggle = conversationHeader.getByRole('button', { name: '展开老师对话栏' });
await expect(teacherToggle).toBeVisible();
if (process.platform === 'win32') {
const browserBounds = await browserToggle.boundingBox();
const browserBounds = await teacherToggle.boundingBox();
expect(browserBounds).not.toBeNull();
expect(browserBounds!.x + browserBounds!.width).toBeLessThanOrEqual(logoBounds!.x);
}
await browserToggle.click();
await teacherToggle.click();
await expect(page.locator('#coding-consultation-dock')).toBeVisible();
await expect(page.getByRole('tab', { name: '操作对话' })).toHaveAttribute('aria-selected', 'true');
await conversationHeader.getByRole('button', { name: '收起老师对话栏' }).click();
await expect(page.locator('#coding-consultation-dock')).toHaveCount(0);
await page.getByRole('tab', { name: '作品', exact: true }).click();
await expect(page.getByTestId('agent-browser-panel')).toBeVisible();
await expect(page.getByTestId('agent-browser-diagnostics')).toHaveCount(0);
await expect.poll(async () => {
@@ -1554,7 +1560,7 @@ test('PI feature UI isolates Conversations and exposes queue, interaction, model
expect((await readState(electronApp)).captured.some(
(request) => request.path === '/api/agent-browser/diagnostics',
)).toBe(false);
await page.getByRole('button', { name: '关闭开发浏览器' }).last().click();
await page.getByRole('tab', { name: '操作对话' }).click();
await expect(page.getByTestId('agent-browser-panel')).toHaveCount(0);
await expect(page.getByRole('button', { name: '项目设置' })).toHaveCount(1);
await expect(page.getByTestId('project-conversations')).toBeVisible();