diff --git a/src/components/image-editor/ImageCanvasBasicGenerationComposerView.tsx b/src/components/image-editor/ImageCanvasBasicGenerationComposerView.tsx index bd82047a3..d2255e2b5 100644 --- a/src/components/image-editor/ImageCanvasBasicGenerationComposerView.tsx +++ b/src/components/image-editor/ImageCanvasBasicGenerationComposerView.tsx @@ -14,7 +14,6 @@ import { PlatformFloatingMenuItem, } from '../common/PlatformFloatingMenu'; import { PlatformStatusMessage } from '../common/PlatformStatusMessage'; -import { PlatformTextField } from '../common/PlatformTextField'; import type { CharacterReferenceImage, GenerateDialogState, @@ -270,13 +269,11 @@ export function ImageCanvasBasicGenerationComposerView({ /> {dialog.mode === 'scene' && dialog.sceneStylePreset === CUSTOM_EDITOR_SCENE_STYLE_PRESET ? ( - setGenerateDialog((currentDialog) => diff --git a/src/components/image-editor/ImageCanvasGenerationComposerView.test.tsx b/src/components/image-editor/ImageCanvasGenerationComposerView.test.tsx index cc543a9f2..82424a46b 100644 --- a/src/components/image-editor/ImageCanvasGenerationComposerView.test.tsx +++ b/src/components/image-editor/ImageCanvasGenerationComposerView.test.tsx @@ -176,7 +176,11 @@ describe('ImageCanvasGenerationComposerView', () => { }); const panel = screen.getByRole('dialog', { name: '游戏场景生成器' }); - expect(within(panel).getByRole('textbox', { name: '画面内容' })).toBeTruthy(); + const sceneContent = within(panel).getByRole('textbox', { + name: '画面内容', + }); + expect(sceneContent.className).toContain('auto-grow-text-area'); + expect(sceneContent.className).not.toContain('platform-text-field'); expect( within(panel).getByRole('button', { name: '画风预设 日系动画' }), ).toBeTruthy(); @@ -186,6 +190,29 @@ describe('ImageCanvasGenerationComposerView', () => { expect(within(panel).queryByText('像素艺术')).toBeNull(); }); + it('让场景自定义画风使用可自增长的多行字段', () => { + renderComposer({ + mode: 'scene', + prompt: '', + status: 'idle', + composerOpen: true, + generationReferences: [], + sceneStylePreset: 'custom', + sceneCustomStyle: '', + imageModel: 'gemini-3.1-flash-image-preview', + aspectRatio: '16:9', + imageSize: '1K', + }); + + const panel = screen.getByRole('dialog', { name: '游戏场景生成器' }); + const customStyle = within(panel).getByRole('textbox', { + name: '自定义画风', + }); + expect(customStyle.tagName).toBe('TEXTAREA'); + expect(customStyle.className).toContain('auto-grow-text-area'); + expect(customStyle.className).not.toContain('platform-text-field'); + }); + it('让生成UI设计图面板复用普通图片生成面板的纵向结构', () => { const setGenerateDialog = vi.fn(); renderComposer({