Skip to content

Comments

fix regression caused by #2255#2272

Merged
veloce merged 1 commit intolichess-org:mainfrom
tom-anders:fix/2231
Oct 17, 2025
Merged

fix regression caused by #2255#2272
veloce merged 1 commit intolichess-org:mainfrom
tom-anders:fix/2231

Conversation

@tom-anders
Copy link
Collaborator

@tom-anders tom-anders commented Oct 17, 2025

I wrongly assumed that addMoveAt() already converts castling notation for us, but that function is only called when new nodes are added to the move tree in an active game, but not when parsing a study chapter.

This is why #2255 fixed the bug of a move being incorrectly interpreted as alt-castling, but it now broke the annotations if the move actually WAS a castling move.

Luckily, while in addMoveAt() there are some heuristics because we only have the UCI move, not the SAN move, in the AnalysisBoard we do have the SAN move, so we can just check for O-O/O-O-O to avoid false positives.

Resolves #2231

I wrongly assumed that addMoveAt() already converts castling notation
for us, but that function is only called when new nodes are added to the
move tree in an active game, but not when parsing a study chapter.

This is why lichess-org#2255 fixed the bug of a mve being incorrectly interpreted
as alt-castling, but it now broke the annotations if the move actually
WAS a castling move.

Luckily, while in addMoveAt() there are some heuristics because we only
have the UCI move, not the SAN move, in the AnalysisBoard we *do* have
the SAN move, so we can just check for O-O/O-O-O to avoid false
positives.

Resolves lichess-org#2231
@veloce veloce merged commit 3c55f67 into lichess-org:main Oct 17, 2025
1 check 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.

Blunder symbol in the analysis board is incorrectly displayed

2 participants