Skip to content

Comments

Fix bug with board rendering#7

Merged
HappyPaul55 merged 2 commits intomainfrom
fix-bug-with-board-rendering
Dec 15, 2025
Merged

Fix bug with board rendering#7
HappyPaul55 merged 2 commits intomainfrom
fix-bug-with-board-rendering

Conversation

@HappyPaul55
Copy link
Owner

This pull request primarily addresses a bug in the chess board processing logic and makes a minor correction to HTML attribute casing for compatibility. The most important changes are grouped below:

Chess board processing logic fixes:

  • Corrected usage of the turn variable in processGame within lichess.ts to ensure the current turn is always retrieved from the chess instance, preventing stale or incorrect board state during undo operations.
  • Updated the assignment of the turn value in the returned board object to use chess.turn(), ensuring consistency with the actual game state.

HTML attribute casing correction:

  • Changed the http-equiv attribute to httpEquiv in the meta tag within pages/_document.tsx for React compatibility and to prevent potential rendering issues.

@HappyPaul55 HappyPaul55 requested a review from Copilot December 9, 2025 11:26
@vercel
Copy link

vercel bot commented Dec 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
me-chess-book Ready Ready Preview Comment Dec 9, 2025 11:26am

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes a critical bug in chess board rendering where the turn indicator was captured before undo operations, resulting in stale board state. It also corrects a React JSX attribute for proper compatibility.

  • Replaced stale turn variable with dynamic chess.turn() calls to reflect the current game state after undo operations
  • Updated JSX attribute from http-equiv to httpEquiv for React compatibility

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lichess.ts Fixed turn tracking by using chess.turn() dynamically instead of capturing it before undo operations, ensuring accurate board state at the position of interest
pages/_document.tsx Corrected meta tag attribute to use camelCase httpEquiv instead of http-equiv for proper React/JSX syntax

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@HappyPaul55 HappyPaul55 merged commit 00a96b8 into main Dec 15, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant