From 36c93cddf8676a869d30bd744e1d4d5094c2371a Mon Sep 17 00:00:00 2001 From: kang Date: Wed, 20 May 2026 17:11:41 +0800 Subject: [PATCH] auto-save 2026-05-20 17:11 (~2) --- .memory/worklog.json | 7 +++++++ src/app/page.tsx | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.memory/worklog.json b/.memory/worklog.json index 1dc3460..f0079f4 100644 --- a/.memory/worklog.json +++ b/.memory/worklog.json @@ -1573,6 +1573,13 @@ "message": "fix: improve project brief preview layout", "hash": "61e597c", "files_changed": 3 + }, + { + "ts": "2026-05-20T16:48:47+08:00", + "type": "commit", + "message": "fix: improve project brief preview layout", + "hash": "8d4275f", + "files_changed": 3 } ] } diff --git a/src/app/page.tsx b/src/app/page.tsx index 3bc33c1..ec2cf54 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -90,6 +90,7 @@ 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'); return (
@@ -114,8 +115,18 @@ function ProjectBrief({ session }: { session: GenSession }) { onFocus={() => setPreviewOpen(true)} onBlur={() => setPreviewOpen(false)} > -
- 当前主方案 +
+ 当前主方案 { + const image = event.currentTarget; + if (image.naturalWidth && image.naturalHeight) { + setPrimaryAspectRatio(`${image.naturalWidth} / ${image.naturalHeight}`); + } + }} + />
Primary