Просмотр исходного кода

WIP: 覆盖会话大纲端到端导航

[gstack-context]
Decisions: 浏览器测试从右上角菜单进入大纲,验证问题、标题、精确定位、高亮与关闭
Remaining: 全量测试、真实会话视觉检查、重载 8800
Skill: /gitnexus-exploring + /frontend-skill
[/gstack-context]
samien 2 месяцев назад
Родитель
Сommit
1bdc49e3f1
2 измененных файлов с 13 добавлено и 2 удалено
  1. 12 1
      tests/e2e/workspace.spec.ts
  2. 1 1
      tests/fixtures/fake-hermes.mjs

+ 12 - 1
tests/e2e/workspace.spec.ts

@@ -194,6 +194,17 @@ test('keeps the canonical logo and yaoyao-webui composer geometry', async ({ pag
   await expect(page.getByRole('button', { name: '会话操作' })).toBeVisible()
   await page.getByRole('button', { name: '会话操作' }).click()
   const sessionMenu = page.getByRole('menu', { name: '会话操作' })
+  await expect(sessionMenu.getByText('会话大纲', { exact: true })).toBeVisible()
+  await sessionMenu.getByText('会话大纲', { exact: true }).click()
+  const outline = page.getByRole('navigation', { name: '会话大纲' })
+  await expect(outline).toBeVisible()
+  await expect(outline.getByText('请检查今天生成的产物。MEDIA:/brand/AppIcon-1024.png', { exact: true })).toBeVisible()
+  await expect(outline.getByText('验收摘要', { exact: true })).toBeVisible()
+  await outline.getByRole('button', { name: '跳转到 验收摘要' }).click()
+  await expect(page.locator('[data-message-id="message-assistant"]')).toHaveClass(/message--revealed/)
+  await page.getByRole('button', { name: '关闭会话大纲' }).click()
+  await expect(outline).toBeHidden()
+  await page.getByRole('button', { name: '会话操作' }).click()
   await expect(sessionMenu.getByText('取消置顶', { exact: true })).toBeVisible()
   const unpinIcon = sessionMenu.getByRole('menuitem', { name: '取消置顶' }).locator('.app-icon')
   await expect(unpinIcon.locator('path')).toHaveCount(2)
@@ -204,7 +215,7 @@ test('keeps the canonical logo and yaoyao-webui composer geometry', async ({ pag
   await expect(page.getByText('置顶会话', { exact: true })).toHaveCount(0)
   const menuBox = await sessionMenu.evaluate(element => element.getBoundingClientRect().toJSON())
   expect(menuBox.width).toBeLessThanOrEqual(220)
-  expect(menuBox.height).toBeLessThan(130)
+  expect(menuBox.height).toBeLessThan(165)
   await expect(page.locator('.session-action-layer')).toHaveCount(0)
   await sessionMenu.getByText('取消置顶', { exact: true }).click()
   await expect(page.locator('.desktop-sidebar').getByText('已置顶 1', { exact: true })).toHaveCount(0)

+ 1 - 1
tests/fixtures/fake-hermes.mjs

@@ -45,7 +45,7 @@ const messages = [
   { id: 'message-thinking-tool', role: 'assistant', content: '', reasoning_content: '先检索文件,再归纳结果。', tool_calls: [{ id: 'tool-thinking', type: 'function', function: { name: 'file_search', arguments: '{"query":"产物"}' } }], timestamp: now() - 177 },
   { id: 'message-tool-call', role: 'assistant', content: '', tool_calls: [{ id: 'tool-1', type: 'function', function: { name: 'file_search', arguments: '{"query":"产物"}' } }], timestamp: now() - 176 },
   { id: 'message-tool', role: 'tool', tool_name: 'file_search', tool_call_id: 'tool-1', summary: '扫描产物目录', result: { path: '/tmp/demo-report.pdf', count: 1 }, timestamp: now() - 175 },
-  { id: 'message-assistant', role: 'assistant', content: '已整理完成。下面是 **验收摘要**:\n\n- 普通聊天已连接\n- 群聊 v2 已就绪\n- [打开报告](https://example.com/report)', reasoning_content: '先核对会话与文件索引。', timestamp: now() - 170 },
+  { id: 'message-assistant', role: 'assistant', content: '已整理完成。下面是 **验收摘要**:\n\n## 验收摘要\n\n- 普通聊天已连接\n- 群聊 v2 已就绪\n- [打开报告](https://example.com/report)', reasoning_content: '先核对会话与文件索引。', timestamp: now() - 170 },
   { id: 'message-image', role: 'assistant', content: '预览图:![夭夭 Logo](/brand/AppIcon-1024.png)', timestamp: now() - 160 },
   { id: 'message-image-second', role: 'assistant', content: '第二张:![夭夭 Logo 2](/brand/AppIcon-1024.png?variant=2)', timestamp: now() - 155 },
   { id: 'message-legacy-media', role: 'assistant', content: '历史兼容:MEDIA:/brand/AppIcon-1024.png', timestamp: now() - 150 },