fix: correct DOM element IDs for move history and captured pieces
All checks were successful
CI Pipeline / Code Linting (pull_request) Successful in 13s
CI Pipeline / Run Tests (pull_request) Successful in 23s
CI Pipeline / Build Verification (pull_request) Successful in 13s
CI Pipeline / Generate Quality Report (pull_request) Successful in 20s

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 <noreply@anthropic.com>
This commit is contained in:
Christoph Wagner 2025-11-23 15:04:34 +01:00
parent bf6d8615ab
commit b44f071630

View File

@ -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;