ArneVogel/listudy

feature request: open study position in lichess

Closed this issue · 16 comments

It would be useful to have an option to open a position in lichess.
This will allow several outcomes:
review the previous state of the position (back button)
see the score of the position
see engine recommendation

FYI. This has now been implemented.

In my case this feature does not work. I get a standard position in lichess analysis, not the one from the study.

thanks, works for me

In my case this feature does not work. I get a standard position in lichess analysis, not the one from the study.

You have to play to a position and then click on the Analysis link. Let us know if it doesn't work.

In my case this feature does not work. I get a standard position in lichess analysis, not the one from the study.

You have to play to a position and then click on the Analysis link. Let us know if it doesn't work.

Not sure if I understand correctly "play to a position", but during studying an opening i click on the Anlysis link, I can see that URL has some PGN and FEN settings in but still I am getting standard position in lichess analysis.

This is what I mean? This doesn't work for you? If it doesn't, what browser and version of that browser are you using? And would it be possible to share the study with us? Could you send the url you are taken to in Lichess?

Analysis.link.mp4

This is what I mean? This doesn't work for you? If it doesn't, what browser and version of that browser are you using? And would it be possible to share the study with us? Could you send the url you are taken to in Lichess?

Analysis.link.mp4

I am using Chrome 108.0.5359.95 64. The study is

https://listudy.org/en/studies/ras5g4-italian-game-two-knigths-open-variation

This is the URL I am taken to lichess:
https://lichess.org/analysis/pgn/%5BSetUp%20%221%22%5D%0A%5BFEN%20%22r1bqkb1r%2Fpppp1ppp%2F2n2n2%2F4p3%2F2BPP3%2F5N2%2FPPP2PPP%2FRNBQK2R%20b%20KQkq%20-%200%204%22%5D%0A%0A4.%20...%20exd4%205.%20e5%20d5%206.%20Bb5%20Ne4%207.%20Nxd4%20Bd7%208.%20Bxc6%20bxc6%209.%20O-O%20Rb8?color=white

This is a recording of what I am doing:

Italian.game.-.two.knigths.open.variation.-.Listudy.-.Google.Chrome.2022-12-06.19-45-02.mp4

Ok, I know now why it doesn't work. It's because your study doesn't start at the starting position, and apparently it has to or it stops working, at least for the Lichess url that takes a PGN that we currently use. Now, they also provide a url that accepts a FEN (a position). However, if you change to this using the FEN url instead you loose the ability to step through the game when on the analysis board. Which I think is a neat feature because it allows you to go back a few moves and re-evaluate the position if you had made a different choice a move or two back. But I will see if I can find a way to identify this situation in LiStudy and be smart about which url to use.

Could you make your Lichess study public enough so that I can access it, or attach the PGN file here?

starting

I made it public. I see that many PGN parsing software has problem with custom positions set from FEN strings.
I am currently working on program that creates such studies, it is very convenient to use fen strings to analyse board positions. I will try to implement a move stack before variations to study. Thanks!

Sorry. I realize I wasn't specific enough, and asked for the wrong thing. What I was thinking was the study in Lichess.org (where I assumed you had created this one, which was wrong of me). But you don't have to do that. Also I realize I might not be necessarily able to extract the PGN file from there anyway.

If you can provide a PGN of just a single chapter with a starting FEN that should be enough? I didn't find any such PGN file from a quick Googling. And even if I was able to construct one myself it would be good I think with an example from the real world. :)

Yeah sure, here is the first chapter of this study:
lichess_study_italian-game-two-knights-open-variation_overview-of-variations_by_KurKucy_2022.12.03.txt

Github doesn't support PGN format so I changed it into txt.

A PR to fix this is waiting for code review.

It should be live now!

It works!

Thanks Olle for the work!