fix(canvas): soften design conversation

This commit is contained in:
inman
2026-09-07 17:24:15 +08:00
parent 6a05992e18
commit bb8a19eecf
6 changed files with 90 additions and 65 deletions

View File

@@ -115,6 +115,10 @@ describe('AI Design Canvas page', () => {
render(<ImageCanvas />);
const conversation = screen.getByTestId('image-workspace-conversation');
expect(conversation).toHaveClass('bg-background');
expect(conversation).not.toHaveClass('bg-surface-subtle/45');
expect(within(conversation).getByTestId('design-message-composer')).toHaveClass('max-w-[50rem]');
expect(within(conversation).getByTestId('design-message-composer-surface')).toHaveClass('chat-composer-surface');
expect(within(conversation).queryByRole('heading', { name: '和 AI 一起完善创作' })).not.toBeInTheDocument();
expect(within(conversation).getByRole('heading', { name: '制作方案' })).toBeInTheDocument();
expect(within(conversation).getByRole('textbox', { name: '创作提示词' })).toHaveValue(
@@ -317,7 +321,7 @@ describe('AI Design Canvas page', () => {
render(<ImageCanvas />);
const conversation = screen.getByTestId('image-workspace-conversation');
expect(within(conversation).getByRole('heading', { name: '先把脑中的画面说出来' })).toBeInTheDocument();
expect(within(conversation).getByRole('heading', { name: '你想让麦洛和你一起创作什么?' })).toBeInTheDocument();
expect(within(conversation).queryByText('画面想要什么感觉?')).not.toBeInTheDocument();
fireEvent.click(within(conversation).getByRole('button', { name: '我想做一张热闹的社团招新海报' }));
expect(within(conversation).getByRole('textbox', { name: '告诉 AI 你想创作什么' })).toHaveValue(
@@ -381,7 +385,7 @@ describe('AI Design Canvas page', () => {
fireEvent.change(screen.getByRole('textbox', { name: '告诉 AI 你想创作什么' }), {
target: { value: '画一只会做饭的机器人' },
});
fireEvent.click(screen.getByRole('button', { name: '发送消息' }));
fireEvent.click(screen.getByRole('button', { name: '发送' }));
await waitFor(() => {
expect(toastErrorMock).toHaveBeenCalledWith(

View File

@@ -120,9 +120,11 @@ describe('YouthCreationCard', () => {
useImageWorkspaceStore.getState().reset();
});
it('puts the editable creator prompt and compact visible parameters in one plan card', () => {
it('keeps the editable prompt and visible parameters in a lightweight inline plan', () => {
renderCard();
expect(screen.getByTestId('youth-creation-card')).toHaveClass('py-2');
expect(screen.getByTestId('youth-creation-card')).not.toHaveClass('border', 'shadow-sm');
expect(screen.getByRole('heading', { name: '制作方案' })).toBeInTheDocument();
expect(screen.getByRole('textbox', { name: '创作提示词' })).toHaveValue(
'把便携咖啡机呈现为城市通勤中的精密工具',
@@ -131,6 +133,7 @@ describe('YouthCreationCard', () => {
expect(screen.getByRole('combobox', { name: '画幅' })).toHaveValue('3:4');
expect(screen.getByRole('button', { name: '增加数量' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '准备制作方案' })).toBeInTheDocument();
expect(screen.queryByRole('region', { name: '参考图' })).not.toBeInTheDocument();
expect(screen.queryByText('查看画面细节')).not.toBeInTheDocument();
expect(screen.queryByText('手动调整')).not.toBeInTheDocument();
});