From 53311cbc95f66f6f7247ca5e6874df7bf16f234c Mon Sep 17 00:00:00 2001 From: Ilia Denisov Date: Tue, 7 Jul 2026 00:59:06 +0200 Subject: [PATCH] fix(hint): arm the vs_ai idle-gate from the warm cache so the lock shows without a delay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Entering a vs_ai game from the lobby armed the idle-hint countdown only in load() (after the gameState round-trip), so the lock popped in after a visible delay. Arm it on the instant warm-cache render in onMount too — the preloadGames-warmed StateView carries hint_unlock_left_seconds; load() then refreshes the snapshot. A first move (0 seconds left) stays open. --- ui/src/game/Game.svelte | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/src/game/Game.svelte b/ui/src/game/Game.svelte index c8c9334..09e884d 100644 --- a/ui/src/game/Game.svelte +++ b/ui/src/game/Game.svelte @@ -290,6 +290,9 @@ if (cached) { view = cached.view; moves = cached.moves; + // Arm the vs_ai idle-hint countdown from the cached seconds-left so the 🔒 shows at once on a + // warm open (no wait for load()); the cached value is a snapshot, refreshed by load() below. + armHintGate(cached.view.game.vsAi ? (cached.view.hintUnlockLeftSeconds ?? 0) : 0); // Apply the cached draft synchronously so a warm/preloaded open paints the pending tiles // already on the board (no full-rack-then-jump). load() then refreshes in the background. applyDraft(cached.view, cached.draft ?? '');