You'll see our current Stockfish implementation and logic has it so every time there is a mate, we simply set the centipawn values to be a hundred and so on the analysis pages, whenever there's a mate, it's either plus hundred or minus hundred based on whether it's white or black's potential mate respectively. However, instead of just showing plus 100 and minus 100, we want to actually show the number of moves until that player reaches the mate. For example, if its mate in 2 moves, our Highlight component should show M2 instead of +100.
Similarly, if the position is a checkmate (game over), we just show "..." in the highlight component and all our analysis is mostly empty. In these cases, we should show in the analysis components that the game is over (also, when we know the board position is a checkmate, we should always make Maia's White Win Rate percentage equal to 0% or 100% based on whether black or white won respectively).
I think the best way to do this is to modify our Stockfish evaluation datatype a little bit such that we also include a mate parameter or something of the sort. We just need to correctly parse the Stockfish UCI when it outputs mate, and display it instead of just showing +/- 100 on the frontend.
You'll see our current Stockfish implementation and logic has it so every time there is a mate, we simply set the centipawn values to be a hundred and so on the analysis pages, whenever there's a mate, it's either plus hundred or minus hundred based on whether it's white or black's potential mate respectively. However, instead of just showing plus 100 and minus 100, we want to actually show the number of moves until that player reaches the mate. For example, if its mate in 2 moves, our Highlight component should show M2 instead of +100.
Similarly, if the position is a checkmate (game over), we just show "..." in the highlight component and all our analysis is mostly empty. In these cases, we should show in the analysis components that the game is over (also, when we know the board position is a checkmate, we should always make Maia's White Win Rate percentage equal to 0% or 100% based on whether black or white won respectively).
I think the best way to do this is to modify our Stockfish evaluation datatype a little bit such that we also include a
mateparameter or something of the sort. We just need to correctly parse the Stockfish UCI when it outputs mate, and display it instead of just showing +/- 100 on the frontend.