mobile icon indicating copy to clipboard operation
mobile copied to clipboard

Possible opening explorer bug when swiped from analysis board

Open ijm8710 opened this issue 10 months ago • 8 comments

Unsure if this can be improved

Review a completed game. If I go straight to the 4th move in the game within analysis' "moves played" and then I swipe over to opening explorer, rarely will the sequence be named.

But if I start opening explorer from move 1, and proceed a few moves to move 4, that exact same Position will have an opening name

This causes a lot of positions to have no opening name unless I start the explorer from move 1 and move forward from the first move of the game. If the position is the same regardless if I move backwards or forwards, it is unclear to me why one sequence retrieves the opening name and the reverse does not

ijm8710 avatar Feb 24 '25 00:02 ijm8710

Curious to see if #1553 helps fix this

ijm8710 avatar Mar 18 '25 22:03 ijm8710

If I understood you correctly, I think this should work. Have you checked?

okmsbun avatar Mar 19 '25 19:03 okmsbun

Will update once it lands on TestFlight. iOS lags behind Android most times

ijm8710 avatar Mar 19 '25 20:03 ijm8710

Hey @okmsbun dont think it does (14.14 just landed on TestFlight)

What I've noticed is for the opening explorer that's within the analysis menu for a specific game, the opening name will stay for the entire duration of the game if you move forwards starting from move 1. But if you move from a backwards perspective and start at say move 5, a lot of times it won't register unless you go back to move 1 and then move forwards again. Curious if what I'm stating makes sense if you also think perhaps it would make sense to Keep the opening name sequence visible even once you're out of the opening. I believe this is how web does it as well

ijm8710 avatar Mar 25 '25 21:03 ijm8710

Could you please share a game that demonstrates this scenario — perhaps a Lichess game link, FEN, or PGN? I'd like to test it myself on the web version, the previous mobile version, and the latest one as well.

okmsbun avatar Mar 25 '25 22:03 okmsbun

Sure, here's a link to the game https://lichess.org/XhL2faxd/black

And here's my video commentary https://share.icloud.com/photos/0f44ih8z01Yr7Xstk-BmAxzHw

First in app I go to move 2 for white and no opening name shows up in opening explorer. (Backward direction) But if I start with the very first move of game and move forwards to move 5 (forward direction) the opening explorer name persists (for the whole game) On web, notice in video is I go straight to move 5, the opening explorer also has the name so even if you're out of the true opening, it still persists.

Summary: opening name gets lost later if you jump straight from a later move in the game rather than starting at one of the first few moves of the game but on web it'll always have the opening listed

ijm8710 avatar Mar 26 '25 13:03 ijm8710

Thank you for your detailed explanation, video, and the links. Your clarification really helped me understand the changes.

In the game, here's what happens: on the analysis board or in the opening explorer, when you start a new game and move forward step by step, if the resulting position is part of the opening literature, its name is shown. If the position isn’t in the opening literature, then the last recognized opening name remains displayed for the rest of the game.

Now, here's the issue: after the game ends, if you click directly on a position that isn’t in the opening literature, no opening name is shown. This happens because the system doesn’t have the context of the previous moves (as fixed in PR #1553 by switching to FEN) and it looks up the opening based solely on the FEN.

An important point to note is that it’s not about working properly when jumping back to the 2nd move or the very beginning. If the position is in the opening literature, it will work even if you jump directly to, say, the 10th move. However, if it’s a move that isn’t part of the opening literature, it won’t work even if you move forward by just 2 moves.

It appears that PR #1553 did not solve this issue; it resolved another problem. I will investigate it in detail when I have time. Veloce had shared some links, and I will check how it was developed on the web. It should work the same way as on the web.

okmsbun avatar Mar 27 '25 09:03 okmsbun

Thanks yep completely agreed with everything you said. It's almost like it needs one additional logic step where (if no opening found off fen, take the summation of all steps prior and grab the last opening that could be identified so that all steps provide some opening)

I'm sure there's a better, more simplified method but essentially that's the long-winded calculation that is missing

ijm8710 avatar Mar 27 '25 12:03 ijm8710

Hey @okmsbun no rush, but just curious do you expect to have time later this year to give it another look :)

ijm8710 avatar Jun 18 '25 18:06 ijm8710

Hey @ijm8710, thanks for the ping!

Things have been quite hectic for me lately, and while I'm still keen on investigating this, I unfortunately don't have the capacity to dive into it right now.

If anyone else is available and wants to take on this issue, please feel free to go ahead. I'd appreciate it if you could just mention me in this thread if someone starts working on it so I can stay in the loop. :)

If it's still open when I have some more time, I'll be happy to pick it up again from here.

okmsbun avatar Jun 20 '25 13:06 okmsbun