Explorar el Código

修复桌面 Bot 列表滚动

Samien hace 1 mes
padre
commit
3354cbec5e

+ 2 - 2
docs/verification/2026-09-10-bot-panels/README.md

@@ -18,9 +18,9 @@
 ## 验证
 
 - 使用独立测试目录验证 Grok Bot 0.47.0 连接:状态读取成功,真实 shell 返回 Linux x86_64、box、/workspace,退出码 0;读取到 1280×800 PNG 桌面截图。未向真实云端发送桌面输入或改动工作文件。
-- Web Playwright 使用一次性 Hermes fixture,覆盖编辑基础机器人、真实网关请求记录、独立 Inspector、居中的电脑/定时任务入口、定时任务创建/立即执行/完成、群聊任务新建与切换、群聊移除电脑入口,以及 375px 深色/减少动态效果显示。这里验证应用链路,fixture 回复不作为真实模型推理证据。
+- Web Playwright 使用一次性 Hermes fixture,覆盖编辑基础机器人、真实网关请求记录、独立 Inspector、居中的电脑/定时任务入口、定时任务创建/立即执行/完成、群聊任务新建与切换、多机器人列表滚动、群聊移除电脑入口,以及 375px 深色/减少动态效果显示。这里验证应用链路,fixture 回复不作为真实模型推理证据。
 - 全量 Vitest:871 项通过、7 项按原配置跳过;生产构建通过。Web 完整侧栏流程 Playwright:1 项通过。iOS 本地签名模拟器:WorkspaceChatTests 33 项、界面测试 3 项通过。
-- `desktop-computer.png`、`desktop-inspector.png`、`desktop-group-task-picker.png`、`desktop-routines.png`、`phone-group-inspector.png` 均为本次 fixture 的实际浏览器截图。
+- `desktop-computer.png`、`desktop-inspector.png`、`desktop-group-task-picker.png`、`desktop-agent-list-scroll.png`、`desktop-routines.png`、`phone-group-inspector.png` 均为本次 fixture 的实际浏览器截图。
 
 ## 启用
 

BIN
docs/verification/2026-09-10-bot-panels/desktop-agent-list-scroll.png


BIN
docs/verification/2026-09-10-bot-panels/desktop-computer.png


BIN
docs/verification/2026-09-10-bot-panels/desktop-group-task-picker.png


BIN
docs/verification/2026-09-10-bot-panels/desktop-inspector.png


BIN
docs/verification/2026-09-10-bot-panels/desktop-routine-logs.png


BIN
docs/verification/2026-09-10-bot-panels/desktop-routines.png


+ 5 - 2
src/client/components/workspace/ConversationList.vue

@@ -42,8 +42,11 @@ function viewConversation(){emit('select',menuId.value);menuId.value=''}
   </div>
 </template>
 <style scoped>
-.conversation-list{display:flex;flex:1;flex-direction:column;min-height:0}
-.conversation-list :deep(.sidebar-list){padding:0 12px 18px;scrollbar-gutter:auto}
+.conversation-list{display:flex;height:100%;min-height:0;flex:1;flex-direction:column;overflow:hidden}
+.conversation-list :deep(.sidebar-list){padding:0 12px 18px;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--text-muted) 60%,transparent) transparent}
+.conversation-list :deep(.sidebar-list::-webkit-scrollbar){width:8px}
+.conversation-list :deep(.sidebar-list::-webkit-scrollbar-thumb){border:2px solid transparent;border-radius:999px;background:color-mix(in srgb,var(--text-muted) 60%,transparent);background-clip:padding-box}
+.conversation-list :deep(.sidebar-list:hover::-webkit-scrollbar-thumb){background:color-mix(in srgb,var(--text-muted) 82%,transparent);background-clip:padding-box}
 .conversation-list :deep(.sidebar-item){min-height:76px;padding:14px 8px;gap:16px;border-radius:12px}
 .conversation-list :deep(.sidebar-item__icon){width:44px;height:44px;flex-basis:44px}
 .conversation-list :deep(.sidebar-item__row strong){font-size:15px;font-weight:600;line-height:22px}

+ 13 - 0
tests/e2e/bot-panels.spec.ts

@@ -70,6 +70,19 @@ test('robot sidebar, source changes, requests, routines and group boundaries wor
  await expect(page).toHaveURL(/taskId=/)
  await expect(page.getByRole('combobox',{name:'当前任务',exact:true}).locator('option')).toHaveCount(optionCount+1)
  await page.screenshot({path:evidence+'/desktop-group-task-picker.png'})
+ for(let index=1;index<=12;index++){
+  const created=await page.request.post('/api/app/agents',{headers:{'X-CSRF-Token':capabilities.csrfToken,Origin:'http://127.0.0.1:18832'},data:{name:`滚动验收 ${index}`,profile:'default'}})
+  expect(created.ok(),await created.text()).toBe(true)
+ }
+ await page.reload()
+ const agentList=page.locator('.desktop-sidebar .sidebar-list')
+ await expect.poll(()=>agentList.evaluate(element=>element.scrollHeight-element.clientHeight)).toBeGreaterThan(0)
+ await agentList.evaluate(element=>{element.scrollTop=element.scrollHeight})
+ await expect.poll(()=>agentList.evaluate(element=>element.scrollTop)).toBeGreaterThan(0)
+ await expect(agentList).toHaveCSS('overflow-y','auto')
+ expect(await agentList.evaluate(element=>getComputedStyle(element,'::-webkit-scrollbar-thumb').backgroundColor)).not.toBe('rgba(0, 0, 0, 0)')
+ await agentList.hover()
+ await page.screenshot({path:evidence+'/desktop-agent-list-scroll.png'})
  await page.getByRole('button',{name:'Inspector',exact:true}).click()
  await expect(panel.locator(':scope > header')).toHaveCount(0)
  await expect(panel.getByRole('button',{name:'电脑',exact:true})).toHaveCount(0)