fix(canvas): compact workspace toolbar

This commit is contained in:
inman
2026-09-07 15:53:49 +08:00
parent 0619327fbe
commit e98603435d
4 changed files with 21 additions and 71 deletions

View File

@@ -356,6 +356,9 @@ test.describe('AI Design V2 workspace', () => {
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 一起完善创作' })).toHaveCount(0);
await expect(page.getByText('当前设计项目的制作记录')).toHaveCount(0);
await expect(page.getByText('实时同步')).toHaveCount(0);
await expect(page.getByRole('button', { name: '刷新作品' })).toHaveCount(0);
await expect(page.getByRole('heading', { name: '制作方案' })).toBeVisible();
await expect(page.getByRole('textbox', { name: '创作提示词' })).toHaveValue(
'把便携咖啡机呈现为城市通勤中的精密工具',
@@ -404,8 +407,8 @@ 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!.workspaceHeaderHeight).toBe(48);
expect(layout!.historyHeaderHeight).toBe(48);
expect(layout!.headerTopGap).toBeLessThanOrEqual(1);
expect(layout!.headerBottomGap).toBeLessThanOrEqual(1);
expect(layout!.conversationWidth).toBeGreaterThan(600);

View File

@@ -132,22 +132,26 @@ 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(screen.getByTestId('image-workspace-header')).toHaveClass('h-12');
expect(screen.getByTestId('image-workspace-history-header')).toHaveClass('h-12');
expect(within(historyRail).getByRole('heading', { name: '历史作品' })).toBeInTheDocument();
expect(within(historyRail).queryByText('当前设计项目的制作记录')).not.toBeInTheDocument();
expect(within(historyRail).getByText('还没有历史作品')).toBeInTheDocument();
expect(screen.queryByTestId('image-workspace-works-rail')).not.toBeInTheDocument();
expect(screen.queryByRole('button', { name: '项目' })).not.toBeInTheDocument();
expect(screen.queryByText('实时同步')).not.toBeInTheDocument();
expect(screen.queryByRole('button', { name: '刷新作品' })).not.toBeInTheDocument();
});
it('prioritizes an offered current plan over older completed-work status', () => {
it('keeps an offered current plan actionable without a second header status row', () => {
setViewport(true);
prepareWorkspace({
form: designFormFixture({ activeQuotes: [designQuoteFixture()] }),
});
render(<ImageCanvas />);
expect(screen.getByText(/制作方案已准备好,确认前仍可修改/)).toBeInTheDocument();
expect(screen.getByRole('button', { name: '确认并开始制作' })).toBeInTheDocument();
expect(screen.queryByText(/制作方案已准备好,确认前仍可修改/)).not.toBeInTheDocument();
expect(screen.getByTestId('image-workspace-history-rail')).toBeInTheDocument();
expect(screen.queryByTestId('image-workspace-works-rail')).not.toBeInTheDocument();
});