Skip to content

feat: implement Game.MoveHistory() method#106

Merged
CorentinGS merged 2 commits into
mainfrom
feat/move-history
May 13, 2026
Merged

feat: implement Game.MoveHistory() method#106
CorentinGS merged 2 commits into
mainfrom
feat/move-history

Conversation

@CorentinGS
Copy link
Copy Markdown
Owner

Summary

  • Add MoveHistory struct with PrePosition, PostPosition, Move, and Comments fields
  • Add Game.MoveHistory() method traversing the main-line move tree
  • Add 7 tests covering empty games, main-line traversal, comments, variations exclusion, length consistency, and PGN integration
    Closes MoveHistory is not defined #78

@CorentinGS CorentinGS requested a review from Copilot May 13, 2026 15:01
@CorentinGS CorentinGS self-assigned this May 13, 2026
@CorentinGS CorentinGS added the enhancement New feature or request label May 13, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.18%. Comparing base (28504d8) to head (f1b1116).

Files with missing lines Patch % Lines
game.go 90.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #106      +/-   ##
==========================================
+ Coverage   70.09%   70.18%   +0.09%     
==========================================
  Files          27       27              
  Lines        4146     4166      +20     
==========================================
+ Hits         2906     2924      +18     
- Misses       1109     1110       +1     
- Partials      131      132       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

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

Implements a new Game.MoveHistory() API to expose main-line moves together with their pre-/post-move positions and any attached move comments, addressing the missing functionality referenced in #78.

Changes:

  • Added exported MoveHistory struct (pre-position, post-position, move, comments).
  • Added (*Game).MoveHistory() method that traverses the main line (first-child path), excluding variations.
  • Added unit tests covering empty games, main-line traversal, comment presence/absence, variation exclusion, length consistency vs Moves(), and PGN-loaded games.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
game.go Adds MoveHistory struct and Game.MoveHistory() main-line traversal implementation.
game_test.go Adds tests validating MoveHistory() behavior across several scenarios including PGN integration.

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

Comment thread game.go Outdated
@CorentinGS CorentinGS force-pushed the feat/move-history branch from fbb7aec to 201007e Compare May 13, 2026 15:10
@CorentinGS CorentinGS merged commit abc72cb into main May 13, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MoveHistory is not defined

2 participants