Compare commits

...

1 Commits

Author SHA1 Message Date
Christoph Wagner
82479fb8c7 fix: correct DOM element IDs for move history and captured pieces
Some checks failed
CI Pipeline / Code Linting (pull_request) Successful in 13s
CI Pipeline / Run Tests (pull_request) Failing after 19s
CI Pipeline / Build Verification (pull_request) Has been skipped
CI Pipeline / Generate Quality Report (pull_request) Failing after 19s
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>
2025-11-23 15:04:34 +01:00

View File

@ -182,7 +182,7 @@ class ChessApp {
* Update move history display * Update move history display
*/ */
updateMoveHistory() { updateMoveHistory() {
const moveList = document.getElementById('move-list'); const moveList = document.getElementById('move-history');
const history = this.game.gameState.moveHistory; const history = this.game.gameState.moveHistory;
if (history.length === 0) { if (history.length === 0) {
@ -211,8 +211,8 @@ class ChessApp {
* Update captured pieces display * Update captured pieces display
*/ */
updateCapturedPieces() { updateCapturedPieces() {
const whiteCaptured = document.getElementById('white-captured'); const whiteCaptured = document.getElementById('captured-white-pieces');
const blackCaptured = document.getElementById('black-captured'); const blackCaptured = document.getElementById('captured-black-pieces');
const captured = this.game.gameState.capturedPieces; const captured = this.game.gameState.capturedPieces;