From e2a90c0f343dddb68123ad96dfee6b85ac07b931 Mon Sep 17 00:00:00 2001 From: adlee-was-taken Date: Sun, 22 Feb 2026 19:37:33 -0500 Subject: [PATCH] Fix knocker highlight not showing on opponents markKnocker() was called before opponent areas were rebuilt by innerHTML='', so the is-knocker class and OUT badge were immediately destroyed. Move markKnocker to after opponent areas are created. Co-Authored-By: Claude Opus 4.6 --- client/app.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/client/app.js b/client/app.js index eb31dd7..a42cc49 100644 --- a/client/app.js +++ b/client/app.js @@ -3791,14 +3791,19 @@ class GolfGame { if (mobileTotal) mobileTotal.textContent = this.gameState.total_rounds; // Show/hide final turn badge with enhanced urgency + // Note: markKnocker() is deferred until after opponent areas are rebuilt below const isFinalTurn = this.gameState.phase === 'final_turn'; if (isFinalTurn) { - this.updateFinalTurnDisplay(); + this.gameScreen.classList.add('final-turn-active'); + this.finalTurnBadge.classList.remove('hidden'); + if (!this.finalTurnAnnounced) { + this.playSound('alert'); + this.finalTurnAnnounced = true; + } } else { this.finalTurnBadge.classList.add('hidden'); this.gameScreen.classList.remove('final-turn-active'); this.finalTurnAnnounced = false; - this.clearKnockerMark(); } // Toggle not-my-turn class to disable hover effects when it's not player's turn @@ -4164,6 +4169,13 @@ class GolfGame { // Update scoreboard panel this.updateScorePanel(); + // Mark knocker AFTER opponent areas are rebuilt (otherwise innerHTML='' wipes it) + if (this.gameState.phase === 'final_turn') { + this.markKnocker(this.gameState.finisher_id); + } else { + this.clearKnockerMark(); + } + // Initialize anime.js hover listeners on newly created cards if (window.cardAnimations) { window.cardAnimations.initHoverListeners(this.playerCards);