From 1af55291bb19c9e0addbb5c4dfa91864481dab25 Mon Sep 17 00:00:00 2001 From: 0xward <0xward.dev@gmail.com> Date: Sun, 2 Aug 2026 17:07:56 +0000 Subject: [PATCH] The half second of map that should not have been there MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OWNER: *"terus kejar yg 0.5 detik itu."* Outside MiniPay the world map was visible under the gate for about half a second, and no amount of React could fix it: the map is in the PRERENDERED HTML, so it paints before a single line of JavaScript has run. That is deliberate and worth keeping — it is what /game's LCP optimisation buys, and MiniPay players, who never see the gate, keep the whole benefit. So the fix is the only thing that can run earlier than React: an inline script in the document. When the gate is certain to appear it marks before the first paint and CSS hides the home screen; when it is not, it does nothing at all and the map paints exactly as it does today. It marks rather than appending an overlay, and that was measured, not assumed. The overlay version was written first and Next's hydration — which reconciles the children of
— deleted the node at 261ms, roughly 600ms before the gate was ready to cover anything. An attribute React never rendered is not part of that reconciliation and survives. Hiding by `visibility` rather than removing: the map's image request stays intact, so a player who skips the gate gets the map immediately instead of paying for it twice. Measured after the change, polling every 30ms for 5s: inside MiniPay no mark, home visible at 102ms (untouched) new player outside mark 144→509ms, home NEVER visible, gate 547ms returning (skipped once) no mark, home visible at 95ms (no black wait) This is a THIRD copy of the MiniPay rule, and the cost was accepted knowingly: every branch in the script can only decide "do not veil", so a drift between the copies costs a non-MiniPay player half a second of map and can never reach a MiniPay player at all. The 3s dead-man timer matters as much — if React never arrives, the mark lifts by itself rather than leaving somebody on a black screen. Verified: tsc clean, build unchanged at 142/242 kB, 41 assertions in test:privy including one that runs in CI on the default path, plus test:streak-ui, test:season-ui, test:pass-cards, check:copy, check:cssvars, check:market and audit. Lint 35. Co-Authored-By: Claude Opus 5