From cf6e9129053539a71e001f4eca30e32c9b35fff4 Mon Sep 17 00:00:00 2001 From: Jose Luis Date: Sat, 21 Mar 2026 16:31:12 +0100 Subject: [PATCH] fix: auto-center viewport when puzzle level loads Call handleCenterView after level load with a short delay to let the DOM settle, so modules are centered on screen on both mobile and desktop. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/game/PuzzleView.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/game/PuzzleView.jsx b/src/game/PuzzleView.jsx index 8fae2c7..51c5c31 100644 --- a/src/game/PuzzleView.jsx +++ b/src/game/PuzzleView.jsx @@ -59,7 +59,10 @@ export default function PuzzleView({ level, levelIndex, worldLevels, onBack, onN useEffect(() => { loadLevel(); + // Center view on modules after level loads and DOM settles + const timer = setTimeout(() => handleCenterView(), 100); return () => { + clearTimeout(timer); stopAudio(); stopTarget(); };