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): 草稿页快速开始卡片与输入框同宽对齐 (#350)

Lizi60e7c6a9c5c5
diff --git a/apps/desktop/src/renderer/__tests__/newMakerCreateAgentVisualContract.test.ts b/apps/desktop/src/renderer/__tests__/newMakerCreateAgentVisualContract.test.ts
index af5b1e0c3e..5e8390ec30 100644
--- a/apps/desktop/src/renderer/__tests__/newMakerCreateAgentVisualContract.test.ts
+++ b/apps/desktop/src/renderer/__tests__/newMakerCreateAgentVisualContract.test.ts
@@ -62,8 +62,15 @@ describe('NewMakerDraftRoute CREATE AGENT visual contract', () => {
expect(source).toContain('style={{ maxWidth: inputWidth || 800 }}');
expect(source).not.toContain('max-w-[800px]');
expect(source).toContain('absolute right-0 top-[22px]');
- // 快捷入口只有 4 项,不随内容列铺满全宽——封顶 800px 左对齐,保持卡片紧凑比例。
- expect(source).toMatch(/data-testid="create-agent-quick-starts"[\s\S]*?style=\{\{ maxWidth: 800 \}\}/);
+ // 快捷入口与输入框同宽(w-full 跟随父列 inputWidth),左右两缘对齐 ChatInput;
+ // 旧 800px 封顶在宽窗口下右缘短一截,2026-07-24 用户反馈后摘除。
+ const quickStartsBlock = source.slice(
+ source.indexOf('data-testid="create-agent-quick-starts"'),
+ source.indexOf('data-testid="create-agent-quick-starts"') + 200,
+ );
+ expect(quickStartsBlock).toContain('w-full');
+ expect(quickStartsBlock).toContain('mt-[42px]');
+ expect(quickStartsBlock).not.toMatch(/maxWidth:\s*800/);
});
it('preserves New Maker behavior-critical props on ChatInput', () => {
diff --git a/apps/desktop/src/renderer/features/cc-agent/NewMakerDraftRoute.tsx b/apps/desktop/src/renderer/features/cc-agent/NewMakerDraftRoute.tsx
index e736ac7322..977d188f36 100644
--- a/apps/desktop/src/renderer/features/cc-agent/NewMakerDraftRoute.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/NewMakerDraftRoute.tsx
@@ -2278,15 +2278,11 @@ export function NewMakerDraftRoute() {
<ConnectProviderCard />
</div>
)}
- {/* 输入框跟随 inputWidth 变宽后,快捷入口只有 4 项,若也铺满全宽
- 会被撑成又宽又空的短卡。这里把卡片区封顶在 800px、左对齐(与输入框
- 左缘齐),保持每张卡当前的紧凑比例;输入框仍独立用满可用宽度。 */}
+ {/* 快捷入口与输入框同宽:左右两缘都与上方 ChatInput 对齐(父列已封顶
+ inputWidth)。此前封顶 800px 会在宽窗口下右缘短一截,视觉上没对齐
+ (2026-07-24 用户反馈)。 */}
{!showProviderOnboardingCard && (
- <div
- data-testid="create-agent-quick-starts"
- className="mt-[42px] w-full"
- style={{ maxWidth: 800 }}
- >
+ <div data-testid="create-agent-quick-starts" className="mt-[42px] w-full">
{/* 标题字号 12→14px(DESIGN §3 Caption),与卡片间距 16→10px 收近
(DESIGN §5 间距档)——用户改稿 2026-07-22。 */}
<div className="mb-2.5 px-0.5">