diff --git a/src/pages/ImageCanvas/DesignConversationPane.tsx b/src/pages/ImageCanvas/DesignConversationPane.tsx index 150c370..53ccc6d 100644 --- a/src/pages/ImageCanvas/DesignConversationPane.tsx +++ b/src/pages/ImageCanvas/DesignConversationPane.tsx @@ -4,7 +4,6 @@ import { Loader2, MessageSquareText, Send, - Sparkles, } from 'lucide-react'; import { toast } from 'sonner'; import { Button } from '@/components/ui/button'; @@ -121,16 +120,6 @@ export function DesignConversationPane({ data-testid="image-workspace-conversation" className="flex min-h-0 flex-1 flex-col bg-surface-subtle/45" > -
-
- -

和 AI 一起完善创作

-
-

- 前面的对话会逐步整理成下方可编辑的创作提示词。 -

-
-
{workspace.turns.length === 0 && pendingChatMessages.length === 0 && ( diff --git a/src/pages/ImageCanvas/DesignHistoryRail.tsx b/src/pages/ImageCanvas/DesignHistoryRail.tsx index 39a219d..31bac4b 100644 --- a/src/pages/ImageCanvas/DesignHistoryRail.tsx +++ b/src/pages/ImageCanvas/DesignHistoryRail.tsx @@ -1,4 +1,4 @@ -import { Clock3, Images } from 'lucide-react'; +import { Images } from 'lucide-react'; import { cn } from '@/lib/utils'; import type { DesignWorkspace } from '../../../shared/image-workspace'; import { DesignPlanHistory } from './DesignPlanHistory'; @@ -14,30 +14,26 @@ export function DesignHistoryRail({ workspace }: { workspace: DesignWorkspace | aria-label="历史作品" className="flex h-full min-h-0 w-[320px] shrink-0 flex-col border-l border-border/70 bg-background font-sans xl:w-[340px]" > -
+
-

+

{taskCount > 0 ? `${taskCount} 次制作 · ${resultCount} 个结果` : '当前设计项目的制作记录'}

- {workspace?.tasks.some((task) => task.status === 'queued' || task.status === 'running') ? ( - - - ) : null}
diff --git a/src/pages/ImageCanvas/index.tsx b/src/pages/ImageCanvas/index.tsx index c25361c..0e199b8 100644 --- a/src/pages/ImageCanvas/index.tsx +++ b/src/pages/ImageCanvas/index.tsx @@ -178,8 +178,8 @@ export function ImageCanvas() { return (
-
{ await expect(page.getByTestId('sidebar-image-workspace')).toBeVisible(); await expect(page.getByTestId('image-workspace-history-rail')).toBeVisible(); await expect(page.getByTestId('image-workspace-works-rail')).toHaveCount(0); - await expect(page.getByRole('heading', { name: '和 AI 一起完善创作' })).toBeVisible(); + await expect(page.getByRole('heading', { name: '和 AI 一起完善创作' })).toHaveCount(0); await expect(page.getByRole('heading', { name: '制作方案' })).toBeVisible(); await expect(page.getByRole('textbox', { name: '创作提示词' })).toHaveValue( '把便携咖啡机呈现为城市通勤中的精密工具', @@ -373,7 +373,11 @@ test.describe('AI Design V2 workspace', () => { ?.getBoundingClientRect(); const historyRail = document.querySelector('[data-testid="image-workspace-history-rail"]') ?.getBoundingClientRect(); - return conversation && projectSidebar && workspace && historyRail + const workspaceHeader = document.querySelector('[data-testid="image-workspace-header"]') + ?.getBoundingClientRect(); + const historyHeader = document.querySelector('[data-testid="image-workspace-history-header"]') + ?.getBoundingClientRect(); + return conversation && projectSidebar && workspace && historyRail && workspaceHeader && historyHeader ? { conversationHeight: conversation.height, conversationWidth: conversation.width, @@ -384,6 +388,10 @@ test.describe('AI Design V2 workspace', () => { historyTopGap: Math.abs(workspace.top - historyRail.top), historyBottomGap: Math.abs(workspace.bottom - historyRail.bottom), historyHorizontalGap: Math.abs(conversation.right - historyRail.left), + workspaceHeaderHeight: workspaceHeader.height, + historyHeaderHeight: historyHeader.height, + headerTopGap: Math.abs(workspaceHeader.top - historyHeader.top), + headerBottomGap: Math.abs(workspaceHeader.bottom - historyHeader.bottom), } : null; }); @@ -396,6 +404,10 @@ test.describe('AI Design V2 workspace', () => { expect(layout!.historyTopGap).toBeLessThanOrEqual(1); expect(layout!.historyBottomGap).toBeLessThanOrEqual(1); expect(layout!.historyHorizontalGap).toBeLessThanOrEqual(1); + expect(layout!.workspaceHeaderHeight).toBe(64); + expect(layout!.historyHeaderHeight).toBe(64); + expect(layout!.headerTopGap).toBeLessThanOrEqual(1); + expect(layout!.headerBottomGap).toBeLessThanOrEqual(1); expect(layout!.conversationWidth).toBeGreaterThan(600); const desktopViewport = page.viewportSize(); diff --git a/tests/unit/image-canvas-page.test.tsx b/tests/unit/image-canvas-page.test.tsx index b0b8688..1dfab88 100644 --- a/tests/unit/image-canvas-page.test.tsx +++ b/tests/unit/image-canvas-page.test.tsx @@ -115,7 +115,7 @@ describe('AI Design Canvas page', () => { render(); const conversation = screen.getByTestId('image-workspace-conversation'); - expect(within(conversation).getByRole('heading', { name: '和 AI 一起完善创作' })).toBeInTheDocument(); + expect(within(conversation).queryByRole('heading', { name: '和 AI 一起完善创作' })).not.toBeInTheDocument(); expect(within(conversation).getByRole('heading', { name: '制作方案' })).toBeInTheDocument(); expect(within(conversation).getByRole('textbox', { name: '创作提示词' })).toHaveValue( '把便携咖啡机呈现为城市通勤中的精密工具', @@ -132,6 +132,8 @@ describe('AI Design Canvas page', () => { const historyRail = screen.getByTestId('image-workspace-history-rail'); expect(historyRail).toHaveClass('h-full', 'border-l'); + expect(screen.getByTestId('image-workspace-header')).toHaveClass('h-16'); + expect(screen.getByTestId('image-workspace-history-header')).toHaveClass('h-16'); expect(within(historyRail).getByRole('heading', { name: '历史作品' })).toBeInTheDocument(); expect(within(historyRail).getByText('还没有历史作品')).toBeInTheDocument(); expect(screen.queryByTestId('image-workspace-works-rail')).not.toBeInTheDocument();