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): 扩大按钮定位的测量范围

DavidShencf66e9ad17fb
diff --git a/apps/desktop/src/renderer/components/chat/__tests__/messageStreamIndicatorPosition.test.ts b/apps/desktop/src/renderer/components/chat/__tests__/messageStreamIndicatorPosition.test.ts
index b695886591..1d4b9e943a 100644
--- a/apps/desktop/src/renderer/components/chat/__tests__/messageStreamIndicatorPosition.test.ts
+++ b/apps/desktop/src/renderer/components/chat/__tests__/messageStreamIndicatorPosition.test.ts
@@ -26,12 +26,12 @@ describe('resolveMessageStreamIndicatorBottomOffset', () => {
expect(resolveMessageStreamIndicatorBottomOffset({ bottomPadding: 40 })).toBe(12);
});
- it('measures from the whole composer stack so plan mode stays above the indicator', () => {
+ it('measures from the outer composer stack so goal and plan indicators stay above the button', () => {
const composerStack = {
getBoundingClientRect: () => ({ top: 620 }),
} as HTMLElement;
const querySelector = vi.fn((selector: string) =>
- selector === '[data-chat-input-root]' ? composerStack : null,
+ selector === '[data-chat-composer-stack]' ? composerStack : null,
);
const overlay = {
querySelector,
@@ -39,6 +39,6 @@ describe('resolveMessageStreamIndicatorBottomOffset', () => {
} as unknown as HTMLElement;
expect(measureComposerStackTopOffset(overlay)).toBe(180);
- expect(querySelector).toHaveBeenCalledWith('[data-chat-input-root]');
+ expect(querySelector).toHaveBeenCalledWith('[data-chat-composer-stack]');
});
});
diff --git a/apps/desktop/src/renderer/components/chat/messageStreamIndicatorPosition.ts b/apps/desktop/src/renderer/components/chat/messageStreamIndicatorPosition.ts
index df20b748a2..485f7ded2b 100644
--- a/apps/desktop/src/renderer/components/chat/messageStreamIndicatorPosition.ts
+++ b/apps/desktop/src/renderer/components/chat/messageStreamIndicatorPosition.ts
@@ -17,7 +17,7 @@ export function resolveMessageStreamIndicatorBottomOffset({
}
export function measureComposerStackTopOffset(overlayEl: HTMLElement): number | undefined {
- const composerStack = overlayEl.querySelector<HTMLElement>('[data-chat-input-root]');
+ const composerStack = overlayEl.querySelector<HTMLElement>('[data-chat-composer-stack]');
if (!composerStack) return undefined;
return overlayEl.getBoundingClientRect().bottom - composerStack.getBoundingClientRect().top;
diff --git a/apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx b/apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx
index 61f7421648..7e22826289 100644
--- a/apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx
@@ -4154,6 +4154,7 @@ export function CCAgentSessionView({
<div
className="mx-auto flex flex-col items-center gap-[10px]"
style={{ width: inputWidth }}
+ data-chat-composer-stack
>
{/* FP-7 / F-PERM-2 / F7.4: mutually exclusive prompts.
Plan review takes precedence — the SDK won't interleave it with