From 94bca093058a3ab031e398f52a7d40697a28fa0a Mon Sep 17 00:00:00 2001 From: kang Date: Wed, 20 May 2026 17:17:06 +0800 Subject: [PATCH] fix: default replicate previews to portrait ratio --- .memory/worklog.json | 14 ++++++++++++++ src/app/page.tsx | 10 +++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.memory/worklog.json b/.memory/worklog.json index e0f6065..0b83407 100644 --- a/.memory/worklog.json +++ b/.memory/worklog.json @@ -1587,6 +1587,20 @@ "message": "auto-save 2026-05-20 17:11 (~2)", "hash": "36c93cd", "files_changed": 2 + }, + { + "ts": "2026-05-20T17:13:15+08:00", + "type": "commit", + "message": "fix: preserve primary image aspect ratio", + "hash": "288b695", + "files_changed": 2 + }, + { + "ts": "2026-05-20T17:17:06+08:00", + "type": "commit", + "message": "auto-save 2026-05-20 17:17 (~2)", + "hash": "1325a73", + "files_changed": 2 } ] } diff --git a/src/app/page.tsx b/src/app/page.tsx index 24b6bed..6ad5565 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -34,6 +34,10 @@ function projectTitle(session: GenSession) { return session.characterSpec?.name || session.prompt || '未命名项目'; } +function defaultPrimaryAspectRatio(session: GenSession) { + return session.inputMode === 'replicate' || session.inputMode === 'extend' ? '2 / 3' : '1 / 1'; +} + function imageSourcesForSession(session: GenSession) { const uploaded = session.uploadedImages?.map(image => ({ url: image.url, @@ -90,11 +94,11 @@ function ProjectBrief({ session }: { session: GenSession }) { const generatedAssets = (session.packs ?? []).reduce((sum, pack) => sum + pack.assets.length, 0); const totalSlots = packSlotTotal(); const [previewOpen, setPreviewOpen] = useState(false); - const [primaryAspectRatio, setPrimaryAspectRatio] = useState('1 / 1'); + const [primaryAspectRatio, setPrimaryAspectRatio] = useState(defaultPrimaryAspectRatio(session)); useEffect(() => { - setPrimaryAspectRatio('1 / 1'); - }, [primaryImage?.url]); + setPrimaryAspectRatio(defaultPrimaryAspectRatio(session)); + }, [primaryImage?.url, session.inputMode]); return (