mliebelt / pgn-viewer

Simple PGN viewer with the necessary features to display chess games
GNU General Public License v3.0
164 stars 44 forks source link

Include move number in white move #416

Open braoult opened 1 year ago

braoult commented 1 year ago

We can see some games (inline mode) where the move number is displayed at the end of a line and white move on next line, or, when displaying moves "justified", space is taken between move number and white move, which is not very easy to read.

Maybe it could be possible to have white move defined as something like (for 1.e4):

<move id="boardMoves0" class=" white">
    <move-number data-value="1">1.</move-number>
    <san>e4</san>
</move>

instead of (current) :

<move-number data-value="1">1. </move-number>
<move id="boardMoves0" class=" white">
    <san>e4</san>
</move>

I am unsure of implications, or even if it is possible, however. Note: I think lichess is going this way, but I did not check other systems...

mliebelt commented 1 year ago

I will check which options we have. Of course CSS is able to do that, but I would like to find the least invasive solution, so that no other things are breaking.

braoult commented 1 year ago

Yes, I know breaking things is not an option ! This is why it is better to be cautious here, as you say...

Something else: I had a look to some chess magazines: Europe Echecs, Gambisco/Le Joueur d'Échecs, and Echec et Mat (official magazine of French Federation). All from late 90s, as was not in France after that; I believe all of they may have disappeared, unfortunately.

In these magazines, games were always printed in the equivalent of our inline mode, with white move attached to move number, for example : 1.e4 instead of 1. e4.

Lichess does not, but does the following:

<move>
   <index>1.</index>
   e4
</move>

Here, move index has the property padding-right: .2em;, a fixed distance between move number and white move, then.

Note: I will stop using lichess example alone, this is only one example between many where we can find games displayed; and one example is not an argument :-)

mliebelt commented 1 year ago

Do you have an example to reproduce that? I will give it a try, play with different sizes, to see that case happening.

braoult commented 1 year ago

Do you have an example to reproduce that? I will give it a try, play with different sizes, to see that case happening.

I believe any (long) PGN would show the issue. For example this one, which shows:

image

mliebelt commented 1 year ago

I added myself an example where you can see that as well. I have even seen linebreak in "O-O". So I think I will address that as well then. And yes, seems to be a problem with the flat structure of the moves/numbers. And yes, I have to look at the figurine as well, not had that into account.