Skip to content

Conversation

@yafred
Copy link
Contributor

@yafred yafred commented Jun 15, 2025

fixes #17688 (with a new shortcut x)
related to #17722 (with a new shortcut alt x)

Considering the active square is the origin of the rays:

  • x announces pieces on each available diagonal rays
  • alt x announces pieces on each horizontal/vertical ray
  • shift x and alt shitf x does it counter clockwise

Example with following position from a black point of view:
x
d1: bottomRight: c2 white pawn
x
d1: bottomLeft: f3 white knight
x
d1: bottomRight: c2 white pawn
alt x
d1: bottom: d2 white pawn , d7 black pawn , d8 black queen
alt x
d1: left: e1 white king , f1 white bishop , h1 white rook
alt x
d1: right: c1 white bishop , b1 white knight , a1 white rook

Note that:

  • Only valid rays are announced
  • When using alt key after discovering a diagonal, next valid horizontal/vertical clockwise is announced.

image

@yafred yafred marked this pull request as ready for review June 17, 2025 21:16
@yafred yafred marked this pull request as draft June 18, 2025 17:16
Comment on lines 60 to 67
<string name="top" comment="direction of a ray">top</string>
<string name="topRight" comment="direction of a ray">top right</string>
<string name="right" comment="direction of a ray">right</string>
<string name="bottomRight" comment="direction of a ray">bottom right</string>
<string name="bottom" comment="direction of a ray">bottom</string>
<string name="bottomLeft" comment="direction of a ray">bottom left</string>
<string name="left" comment="direction of a ray">left</string>
<string name="topLeft" comment="direction of a ray">top left</string>
Copy link
Member

Choose a reason for hiding this comment

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

I'd be apprehensive about adding new (and so many!) translations along with new features. Let it bake for a month or two and if there's no bad feedback about wording, set a reminder and make a separate translations PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with you ... even in English I pondered over: top, up, north ...
I'll leave them hard coded for the moment.

@allanjoseph98
Copy link
Member

I'd also look into just doing all the ray stuff in chessops. This is right up its alley.

@yafred
Copy link
Contributor Author

yafred commented Jun 22, 2025

I'd also look into just doing all the ray stuff in chessops. This is right up its alley.

what is the difference between chessground and chessops ? (meaning: why are there 2 repositories and how do you decide to update one or the other ?)

@allanjoseph98
Copy link
Member

chessops is pure chess rules and logic. Chessground is the package we use to display a chessboard, pieces and anything GUI related to the chessboard. It contains no logic.

Relating to NVUI we use chessground instead of chessops because the legal moves (dests) are calculated and sent by the server so we can skip the logic bit and just use the dests that chessground also uses for legal moves. Although blind players do not see the same board we still "use" the same one for legal moves.

I said use chessops because it has a lot of helper and utility functions related to chess logic. It also uses bitboards under the hood so you can make use of them and all of the other ray functions that chessops uses to calculate the rays that you need.

@yafred
Copy link
Contributor Author

yafred commented Jun 22, 2025

I don't think we need chess logic here as it is just about announcing pieces on squares.

@yafred yafred marked this pull request as ready for review June 22, 2025 19:02
@nicvagn
Copy link
Contributor

nicvagn commented Jun 24, 2025

What is the status of translation of the nvui? I am working towards trying to make "Learn from your mistakes" usable from the nvui.

There are numerous NoTrans(str) calls in analysis.nvui.ts.

I know nothing about the translation effort, but want to look towards the future of the nvui.

@ornicar ornicar merged commit 0272790 into lichess-org:master Jun 25, 2025
3 checks passed
@ikrami1
Copy link

ikrami1 commented Jun 25, 2025

this also closes #17722 so i closed it from my end.
great job @yafred

@yafred yafred deleted the 17688-nvui-explore-diagonals branch June 25, 2025 11:06
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.

nvui - explore diagonals

5 participants