From f502d120a7cea8bbab4edb2f3867cb29ba7132db Mon Sep 17 00:00:00 2001 From: Adrian Bonpin Date: Tue, 28 Apr 2026 09:24:08 +0800 Subject: [PATCH] refactor: replace preset detail modal layoutId morph with bottom sheet slide-up + category crossfade MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove layoutId from preset card in game-page-client.tsx and modal in preset-detail-modal.tsx to eliminate text smearing during morph animation. - Replace modal scale/opacity spring animation with bottom sheet y-slide spring (y: 100% → 0). - Wrap settings table content in AnimatePresence mode='wait' with keyed motion.div for crossfade when switching categories. --- app/game/[id]/game-page-client.tsx | 1 - app/game/[id]/preset-detail-modal.tsx | 124 ++++++++++++++------------ 2 files changed, 66 insertions(+), 59 deletions(-) diff --git a/app/game/[id]/game-page-client.tsx b/app/game/[id]/game-page-client.tsx index 3f768b1..3be2a6c 100644 --- a/app/game/[id]/game-page-client.tsx +++ b/app/game/[id]/game-page-client.tsx @@ -751,7 +751,6 @@ export function GamePageClient({ return ( setSelectedPresetId(preset.id)} className={`shrink-0 w-72 flex flex-col gap-3 p-4 rounded-xl border transition-colors cursor-pointer hover:border-primary/30 ${ raw diff --git a/app/game/[id]/preset-detail-modal.tsx b/app/game/[id]/preset-detail-modal.tsx index 9de5e10..74c5f90 100644 --- a/app/game/[id]/preset-detail-modal.tsx +++ b/app/game/[id]/preset-detail-modal.tsx @@ -164,14 +164,13 @@ export function PresetDetailModal({ > {/* Modal card */} e.stopPropagation()} @@ -427,62 +426,71 @@ export function PresetDetailModal({ {/* Right panel */}
{hasCategories ? ( -
- {/* Category navigation */} -
- - - {currentCategory?.category}{" "} - - ({activeCategoryIndex + 1}/{categories.length}) + + + {/* Category navigation */} +
+ + + {currentCategory?.category}{" "} + + ({activeCategoryIndex + 1}/{categories.length}) + - - -
+ +
- {/* Settings table */} -
- - - - - - - - - {currentCategory?.settings.map((setting, sIdx) => ( - - - + {/* Settings table */} +
+
- Setting - - Value -
- {setting.title} - - {formatValue(setting.value)} -
+ + + + - ))} - -
+ Setting + + Value +
-
-
+ + + {currentCategory?.settings.map((setting, sIdx) => ( + + + {setting.title} + + + {formatValue(setting.value)} + + + ))} + + +
+
+ ) : (