From 624b5eb284b5fa87a6c5517975bf732a0cd7cb29 Mon Sep 17 00:00:00 2001 From: cc Date: Wed, 24 Jun 2026 21:37:00 +0800 Subject: [PATCH] fix(photo-wall): preserve saved layouts during async photo load (merge, not replace) Co-Authored-By: Claude Opus 4.8 --- Client/src/components/PhotoWallPage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Client/src/components/PhotoWallPage.tsx b/Client/src/components/PhotoWallPage.tsx index c14d40e..5cad78b 100644 --- a/Client/src/components/PhotoWallPage.tsx +++ b/Client/src/components/PhotoWallPage.tsx @@ -229,7 +229,9 @@ export function PhotoWallPage({ onExit, token }: PhotoWallPageProps) { const t = setTimeout(() => { try { const decorations = els.filter((e) => e.type !== 'photo') - const photoLayout: Record = {} + // 从已知排版起步而非清空:未加载完/取图失败的照片其排版得以保留, + // 已加载或移动过的照片在下面覆盖各自的 key(删除时 removeEl 已从 layoutRef 删键)。 + const photoLayout: Record = { ...layoutRef.current } for (const e of els) { if (e.type === 'photo' && e.photoId) { photoLayout[e.photoId] = {