Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(desktop): 下拉菜单滚动兜底并修正侧栏守卫测试断言

Shinkue9aa6ee36573
diff --git a/apps/desktop/src/renderer/__tests__/orcaWorkflowRoute.test.ts b/apps/desktop/src/renderer/__tests__/orcaWorkflowRoute.test.ts
index 3d424c427f..fc69ef9a94 100644
--- a/apps/desktop/src/renderer/__tests__/orcaWorkflowRoute.test.ts
+++ b/apps/desktop/src/renderer/__tests__/orcaWorkflowRoute.test.ts
@@ -410,10 +410,11 @@ describe('OrcaWorkflowRoute source invariants', () => {
});
it('does not navigate the detached sidebar window to settings from the worker toolbar', () => {
- // 硬上限时 + 按钮跳转到协同设置(codex P1 逃生口),但分离侧栏窗口不能整壳替换成设置路由,
- // 因此 OrcaWorkerPanel 的 handleOpenSettings 用 isSidebarWindow() 守卫:侧栏窗口下不跳转。
+ // 硬上限时 + 按钮跳转到协同设置(codex P1 逃生口),但分离侧栏窗口不能整壳替换成设置路由。
+ // 实现用 onOpenSettings={isSidebarWindow() ? undefined : handleOpenSettings} 在调用处守卫:
+ // 侧栏窗口下传 undefined,+ 按钮回退为 disabled(不再呈现点了没反应的「设置 · 协同」按钮)。
expect(workerPanelSource).toContain("import { isSidebarWindow } from '@/lib/sidebarWindow';");
- expect(workerPanelSource).toContain('if (isSidebarWindow()) return;');
+ expect(workerPanelSource).toContain('onOpenSettings={isSidebarWindow() ? undefined : handleOpenSettings}');
expect(workerPanelSource).toContain("navigate('/settings?section=collaboration')");
expect(workerPanelSource).not.toContain('settingsEnabled');
expect(workersTabBodySource).toContain("import { isSidebarWindow } from '@/lib/sidebarWindow';");
diff --git a/apps/desktop/src/renderer/features/cc-agent/RolePillDropdown.tsx b/apps/desktop/src/renderer/features/cc-agent/RolePillDropdown.tsx
index b122515e02..91db8a6da5 100644
--- a/apps/desktop/src/renderer/features/cc-agent/RolePillDropdown.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/RolePillDropdown.tsx
@@ -1149,7 +1149,7 @@ export function RolePillDropdown({
<div
ref={popoverRef}
className={cn(
- 'absolute left-0 z-50 flex w-[320px] flex-col overflow-hidden rounded-xl border border-[var(--border-default)] bg-[var(--surface-elevated)]',
+ 'absolute left-0 z-50 flex w-[320px] flex-col overflow-y-auto overflow-x-hidden rounded-xl border border-[var(--border-default)] bg-[var(--surface-elevated)]',
menuPlacement?.placeAbove ? 'bottom-full mb-1' : 'top-full mt-1',
)}
style={{