Add visual aids in analysis board - #19037
Merged
ornicar merged 6 commits intoJan 12, 2026
Merged
Conversation
dav1312
force-pushed
the
pins-checkable-undefended-chessops-rebase
branch
from
January 5, 2026 11:15
1e64887 to
c61792b
Compare
dav1312
marked this pull request as draft
January 5, 2026 14:51
dav1312
force-pushed
the
pins-checkable-undefended-chessops-rebase
branch
from
January 5, 2026 16:57
56a2861 to
d9d7610
Compare
Collaborator
|
This looks great :) Let's go |
dav1312
force-pushed
the
pins-checkable-undefended-chessops-rebase
branch
from
January 11, 2026 19:24
d5cacc0 to
40dd539
Compare
…nalysis board - Introduces a new `boardAnalysis` module to detect motifs. - Adds `detectPins` to identify absolute and significant relative pins. - Adds `detectUndefended` using Static Exchange Evaluation (SEE) to find hanging or under-defended pieces. - Adds `detectCheckable` to highlight kings that can be put in check on the next move (including via promotion, castling, or en passant). - Adds a toggle for each aid. - Aids are disabled if engine eval is not allowed (e.g. correspondence analysis page). - Includes unit tests.
dav1312
force-pushed
the
pins-checkable-undefended-chessops-rebase
branch
from
January 11, 2026 19:35
40dd539 to
77ffc13
Compare
dav1312
marked this pull request as ready for review
January 11, 2026 19:55
Contributor
Author
because unprompted changes make people lose their mind
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.

Add visual aids for pins, undefended pieces, and checkable kings in analysis board
Introduces a new
boardAnalysismodule to detect motifs.detectPinsto identify absolute and significant relative pins.detectUndefendedusing Static Exchange Evaluation (SEE) to find hanging or under-defended pieces.detectCheckableto highlight kings that can be put in check on the next move (including via promotion, castling, or en passant).Adds a toggle for each aid.
Aids are disabled if engine eval is not allowed (e.g. correspondence analysis page).
To avoid unusual legal chess moves, aids are only available in
standard,chess960,fromPosition,kingOfTheHill,threeCheck, andracingKings,Includes unit tests.
This is how it currently looks.
The same piece can have multiple tags.
The functions return additional information that is not used for the shape creation but that could be useful in the future.
[ { "pinned": 27, "pinner": 59, "target": 3 } ] [ { "square": 22, "materialLoss": 2, "principalAttacker": 50 }, { "square": 37, "materialLoss": 1, "principalAttacker": 30 } ] [ { "king": 0, "check": { "from": 58, "to": 56 } }, { "king": 55, "check": { "from": 53, "to": 61, "promotion": "knight" } } ]Example of what could be done with the information provided by the functions: