Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show 3-5 fold positions in analysis #15999

Merged
merged 12 commits into from
Sep 6, 2024
Merged

Conversation

kraktus
Copy link
Member

@kraktus kraktus commented Sep 3, 2024

A way for people to quickly see which positions implied the 3-5 fold repetition (for #13459 and the many forum posts about it)

This is a WIP for now, looking for feedback on two things:

  • Technically if it makes sense to do it on the frontend rather than on the backend, and if the way to mutate the tree when loading is the way to go
  • How the feedback should look (it's very unpolished for now, but the board design could be converted to SVG, and move in list could be stylised as inaccuracy/mistake/blunders)

First attempt using unicode fractions, unfortunately ³⁄₃ does not render well on Safari/Firefox
image
image
image

Another attempt
image
image
image

TODO: should not be shown in studies, only in games list

Another idea, list the positions at the end of the movelist (mockup, would be clickable)
image

@kraktus kraktus changed the title show 3-5 fold positions in analysis WIP: show 3-5 fold positions in analysis Sep 3, 2024
@schlawg
Copy link
Collaborator

schlawg commented Sep 3, 2024

If you're wanting the indicator to be a glyph on the moved piece, custom svgs can provide uniformity (like blunder/mistake/inaccuracies). But as a user, I probably prefer the move list annotations alone. "Why is there is a 3 on my queen, stop ruining lichess!"

ornicar and others added 6 commits September 5, 2024 15:32
Only checking for the last epd, which is the only one that could lead to three/five-fold repetition.

Previously code could be triggered on EPDs that were repeated 3 times, but where neither players claimed three-fold.
The function was unused until now
Only seems to be used to CSS, values found in `nodeClasses`, `lila/ui/analyse/src/treeView/common.ts`
```
    inaccuracy: glyphIds.includes(6),
    mistake: glyphIds.includes(2),
    blunder: glyphIds.includes(4),
    good: glyphIds.includes(1),
    brilliant: glyphIds.includes(3),
    interesting: glyphIds.includes(5),
```
@kraktus kraktus changed the title WIP: show 3-5 fold positions in analysis Show 3-5 fold positions in analysis Sep 5, 2024
@kraktus
Copy link
Member Author

kraktus commented Sep 5, 2024

Following feedback here: https://hq.lichess.ovh/#narrow/stream/1-general/topic/positions.20of.203-5.20fold.20repetitions/near/3445933 went for unicode number for now.

The styling can always be polished later like for puzzle feedback, for the SVG icon I was thinking about the number inside ♻️ or
image

Comment on lines 217 to 220
const mainline = treeOps.mainlineNodeList(this.tree.root);
if (this.data.game.status.name == 'draw') {
add3or5FoldGlyphs(mainline);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it's the correct place to put

@kraktus
Copy link
Member Author

kraktus commented Sep 5, 2024

Currently not showing on the game page, only analysis, not sure if it's good to add it there too
image

@ornicar ornicar merged commit f7b4d84 into lichess-org:master Sep 6, 2024
2 checks 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.

3 participants