Page MenuHomePhabricator

Make it possible to specify initial state of playboard
Closed, ResolvedPublic

Description

Would be cool if you could code the <pgn> with an attribute which determines the initial position to render.

Event Timeline

Wugapodes triaged this task as Medium priority.Sep 9 2021, 6:50 PM
Wugapodes moved this task from Needs triage to Planned Features on the ChessBrowser board.
Wugapodes subscribed.

Change 720837 had a related patch set uploaded (by Wugapodes; author: Wugapodes):

[mediawiki/extensions/ChessBrowser@master] Add XML args for starting state and perspective

https://gerrit.wikimedia.org/r/720837

Change 720837 merged by jenkins-bot:

[mediawiki/extensions/ChessBrowser@master] Add XML args for starting state and perspective

https://gerrit.wikimedia.org/r/720837

description should be expanded to cover ply and swap.

also, this changes the way boards are displayed by default: before this change last position was shown, now it shows a "virgin" chess board.
i think this is not good default.
for readers who do not wish to interact, showing the initial position is just noise. showing the last one makes more sense.
of course, having the ply= is important, but the default was made worse.
if me.data.init will default to 0 instead of 1, the viewer will show the last position..

@Wugapodes , was this intentional? if so, it's worth discussion, i think. otherwise, need fixin`

(also) made a comment - i think there is missing space before {{swap}} in the mustache file.

peace.

@Kipod the change was intentional. The final board state isn't any more helpful than the starting position, and the cases where it could be are better served by ply= or <fen></fen>. If an article is talking about the middle game, showing the checkmate position is not any more helpful than the starting position. If a reader isn't going to interact with it, then it's always going to be noise unless an editor sets the ply= parameter. In situations where that doesn't happen, defaulting to the start of the game is generally better. Chess games go forward, so having the game start at the beginning saves readers from having to click back to the beginning. The final board position might be a useful default for game fragments, but having editors specify the most useful ply is better than having a default that encourages them to cut the ends off of games.

beg to differ.
when ply is not defined, the final state of the game may or may not be useful to readers not using the interactivity, but the opening board is guaranteed to have zero value.
if you are 100% against showing the last ply, it would be better to declare ply= "mandatory" parameter, and show error when not defined, rather than defaulting to absolutely useless real estate on the page.

(later addition: this of course is meant when there is no "FEN" data. when there is FEN, e.g. for chess960, initial state may be useful)

peace.

Wugapodes claimed this task.