fix: default replicate previews to portrait ratio

This commit is contained in:
2026-05-20 17:17:06 +08:00
parent 288b695de2
commit 94bca09305
2 changed files with 21 additions and 3 deletions

View File

@@ -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 (
<section className="project-brief-panel">