From 2004caa53c602b6da444165e0a9abe4d955915e1 Mon Sep 17 00:00:00 2001 From: davotoula Date: Mon, 23 Mar 2026 15:27:20 +0100 Subject: [PATCH] fix(chess): board interactive on mobile at game start The board was non-interactive for participants during pending challenges on Android because canMakeMoves factored in isPendingChallenge. Desktop passed isSpectator directly without the pending check, so it worked. Remove isPendingChallenge from the board interactivity gate to match Desktop behavior. The header still shows "Challenge Pending" status, and this also fixes a secondary issue where the isPendingChallenge flag could get stuck when replaceGameState preserved the old state via its open-challenge workaround. Co-Authored-By: Claude Opus 4.6 --- .../vitorpamplona/amethyst/commons/chess/LiveChessGame.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/chess/LiveChessGame.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/chess/LiveChessGame.kt index c04a06f36..3781f0162 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/chess/LiveChessGame.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/chess/LiveChessGame.kt @@ -210,8 +210,9 @@ fun LiveChessGameScreen( // Use override if provided, otherwise fall back to gameState flag val isSpectator = isSpectatorOverride ?: gameState.isSpectator - // Pending challenges and spectators cannot make moves - val canMakeMoves = !isSpectator && !gameState.isPendingChallenge + // Spectators cannot make moves; pending challenges still allow board interaction + // (matches Desktop behavior where board is always interactive for participants) + val canMakeMoves = !isSpectator // Track if game end overlay was dismissed var gameEndDismissed by remember { mutableStateOf(false) }