feat: Add move comments functionality with full round-trip support#56
Open
ysgrProgramming wants to merge 1 commit into
Open
feat: Add move comments functionality with full round-trip support#56ysgrProgramming wants to merge 1 commit into
ysgrProgramming wants to merge 1 commit into
Conversation
- Add comment field to Move type (optional string)
- Implement comment update action in gameState reducer
- Add comment export support in kifuExport (PGN-style {comment} format)
- Implement kifu import/parse functionality with comment parsing
- Add comment UI in MoveList component (display, edit, add)
- Add handleUpdateMoveComment API in GameStateContext
- Add comprehensive tests for comment functionality
- Update README with comment usage examples
All tests passing (266 tests). Comments are preserved through export/import cycles.
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.
Overview
This PR adds move comments functionality to the chess app, allowing users to add, edit, and remove comments for individual moves. Comments are preserved through export/import cycles.
TDD & Lint Verification
make testfails for the new tests.make testpasses.make lintand fixed all errors.All 266 tests passing.
Self-Walkthrough (Logical Reasoning)
Moveinterface with optionalcomment?: stringfieldsrc/lib/types.tsUPDATE_MOVE_COMMENTaction toGameActionand reducer logicsrc/lib/gameState.tsMoveListcomponentsrc/components/MoveList.tsxmovesToTextandmovesToPGNto include comments in PGN-style{comment}formatsrc/lib/kifuExport.tsparseKifuTextfunction to parse kifu text and extract commentssrc/lib/notation.tssrc/lib/kifuExport.ts,src/lib/notation.tshandleUpdateMoveCommenttoGameStateContextsrc/contexts/GameStateContext.tsxDecision Log
{comment}format for compatibility with standard chess notation tools.{}, quotes, newlines) in comments.Testing
gameState.test.tskifuExport.test.tsandnotation.test.tsMoveList.test.tsxDocumentation