feat: Add visual check indicator when king is in check (#80)#81
Open
feat: Add visual check indicator when king is in check (#80)#81
Conversation
added 7 commits
January 11, 2026 01:28
Add engine/fixtures.py with predefined chess positions for testing: - Basic positions (starting, empty) - Checkmate scenarios - Special moves (en passant, castling) - Check scenarios - Pawn promotion positions - Stalemate and endgame positions
- Add load_fen() method to parse FEN strings and set board state - Add to_fen() method to export current position as FEN - Add WebSocket callbacks for load_fen, load_fixture, get_fixtures - Track en_passant_target for FEN compatibility - Include turn and FEN in game state JSON - Update en passant logic to work with FEN-loaded positions - Convert indentation from tabs to spaces
- Add loadFen() to load arbitrary FEN positions - Add loadFixture() to load named test fixtures - Add getFixtures() to request fixture list from server - Add reactive refs for turn, currentFen, and fixtures - Update data watcher to handle new state fields
- Display current game state (turn, player, move number) - Show current FEN with copy-to-clipboard button - FEN input field to load arbitrary positions - Dropdown with categorized test fixtures - Reset board button - Dark theme styling to match app
- Add DebugPanel component with toggle visibility - Press D key to show/hide debug panel - Add sidebar layout for debug panel - Ignore keypress when typing in input fields
walshb421
commented
Jan 23, 2026
src/composables/chess.js
Outdated
Comment on lines
29
to
33
| if(parsedData.turn \!== undefined) turn.value = parsedData.turn; | ||
| if(parsedData.fen) currentFen.value = parsedData.fen; | ||
| if(parsedData.fixtures) fixtures.value = parsedData.fixtures; | ||
| if(parsedData.in_check \!== undefined) inCheck.value = parsedData.in_check; | ||
| }) |
Owner
Author
There was a problem hiding this comment.
This is a syntax error, and does not run (Probably the escape character)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements issue #80 - Visual indication when a king is in check.
When a king is in check, the square containing the king is now highlighted with:
Changes Made
Frontend Changes
src/composables/chess.jsinCheckreactive ref to track check statein_checkfield from WebSocket game state updatesinCheckfor use in componentssrc/components/Board.vueisKingInCheck(square)helper function that checks if a square contains a king that is currently in checkin-checkclass binding to board squaressrc/assets/main.css.board-square.in-checkclass with red highlight styling@keyframes pulse-checkanimation for a subtle pulsing effectTest Plan
Test Positions (using Debug Panel)
Dependencies
Screenshots
The king's square will display with:
background-color: rgba(255, 0, 0, 0.6)box-shadowanimationCloses #80