-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
add option to show multiple games from a PGN #31
Conversation
@@ -2,7 +2,6 @@ import { Opts } from './interfaces'; | |||
|
|||
const defaults: Opts = { | |||
pgn: '*', // the PGN to render | |||
fen: undefined, // initial FEN, will append [FEN "initial FEN"] to the PGN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotta keep that somehow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's just keep the current behavior of adding the fen to the first game.
please stop force-pushing after the PR is published, as I'm committing to it too. |
… into multiple-games * 'multiple-games' of https://github.com/zamfofex/pgn-viewer: add option to show multiple games from a PGN
src/pgn.ts
Outdated
@@ -135,5 +135,6 @@ function makeMetadata(headers: Headers, lichess: Lichess): Metadata { | |||
isLichess: !!(lichess && site?.startsWith(lichess)), | |||
timeControl, | |||
orientation: orientation === 'white' || orientation === 'black' ? orientation : undefined, | |||
name: event ?? '?', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in a broadcast, all games will have the same event. Probably better to try with the player names first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be useful to display an index (+1) in the select options, to always allow distinguishing the games, whether they have distinct names or not.
src/pgnViewer.ts
Outdated
if (index !== this.selectedGame) { | ||
this.selectIndex(index); | ||
if (to === 'first') path = Path.root; | ||
if (to === 'last') path = this.game.pathAtMainlinePly('last'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first
and last
here are weird. They'll jump to the first or last game, but only if we're at the first or last ply of the current game. That doesn't seem intuitive.
it's unintuitive
looking good, almost there! |
Also takes away the option to set the FEN as an option (it can still be set with an explicit
[FEN "..."]
tag on the PGN, though).Here is a screenshot! (I took the PGN from here: https://lichess.org/study/ZglxzC5N)