lichess-org / lichobile

lichess.org mobile application
https://lichess.org/mobile
GNU General Public License v3.0
2.03k stars 318 forks source link

OTB - Improve board coordinates for black #273

Closed JoelMon closed 7 years ago

JoelMon commented 8 years ago

Hello,

When playing over the board white can see the coordinates for the board just fine. When it's black's turn, the coordinates remain oriented for white. This is annoying for black since the letters and numbers are all upside down from their viewpoint making it hard if they would like to record the game or whatnot.

I propose an improvement for the coordinate markings on the board. Either:

I think having the coordinates printed along the sides for each player is the way to go since folks usually write down their move after they moved their piece.

veloce commented 8 years ago

Sure, I can do that.

Manuelp2 commented 8 years ago

Hi, I've worked on this issue and implemented a solution.

The last thing I need is to reload the board afterwards. In the /project/src/js/ui/otb/otbView.js Class.

m.redraw Doesn't change the board coordinates, yet getting out and into the OTB game again does the trick. But it isn't user-friendly.

@veloce Could you please provide any pointers on how to do it? Thanks.

Also, some modified files can't be found on github. For example: /project/node_modules/chessground-mobile/src/data.js /project/node_modules/chessground-mobile/src/view.js

veloce commented 8 years ago

@Manuelp2 sorry for the delayed response, I was on holidays.

For your last question, chessground-mobile is an external dependency, the code should be modified here.

Manuelp2 commented 8 years ago

@veloce Thanks for your comment, and no problem at all, holidays are a good thing :+1:

So I've made the pull request. The coordinates are done inside to save board space and not mess up the surrounding css. The preferences are stored as I saw would be more appropiate, but if you believe they should be on another place I can arrange that.

The only problem is that to update the board m.redraw is not enough, and it is required to get out of OTB and back in again for the changes to take effect. I'm clueless in that regard as to what to do.