From b44f071630080384df87d5bc948df0b67c87224d Mon Sep 17 00:00:00 2001 From: Christoph Wagner Date: Sun, 23 Nov 2025 15:04:34 +0100 Subject: [PATCH] fix: correct DOM element IDs for move history and captured pieces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #2 and #3 - DOM element ID mismatches causing UI features to fail Changes: - Update move history element ID from 'move-list' to 'move-history' (line 185) - Update white captured pieces ID from 'white-captured' to 'captured-white-pieces' (line 214) - Update black captured pieces ID from 'black-captured' to 'captured-black-pieces' (line 215) These changes align JavaScript DOM queries with the actual element IDs defined in index.html, enabling move history and captured pieces displays to function correctly. Impact: - Move history now displays correctly in the UI sidebar - Captured pieces now display correctly for both white and black - No changes to game logic or business rules - Zero regression risk (simple ID corrections) Testing: - ESLint passes with 0 errors (6 warnings pre-existing) - Changes verified against HTML element IDs in index.html 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- js/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/main.js b/js/main.js index b4a51e6..ddf6c73 100644 --- a/js/main.js +++ b/js/main.js @@ -182,7 +182,7 @@ class ChessApp { * Update move history display */ updateMoveHistory() { - const moveList = document.getElementById('move-list'); + const moveList = document.getElementById('move-history'); const history = this.game.gameState.moveHistory; if (history.length === 0) { @@ -211,8 +211,8 @@ class ChessApp { * Update captured pieces display */ updateCapturedPieces() { - const whiteCaptured = document.getElementById('white-captured'); - const blackCaptured = document.getElementById('black-captured'); + const whiteCaptured = document.getElementById('captured-white-pieces'); + const blackCaptured = document.getElementById('captured-black-pieces'); const captured = this.game.gameState.capturedPieces;