File tree Expand file tree Collapse file tree
hooks/useAnalysisController Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -512,7 +512,7 @@ export const Highlight: React.FC<Props> = ({
512512 < p
513513 className = { `text-left font-mono ${ simplified ? 'text-sm' : 'text-sm md:text-xxs xl:text-xs' } ` }
514514 >
515- { move }
515+ { colorSanMapping [ move ] ?. san ?? move }
516516 </ p >
517517 < p
518518 className = { `text-right font-mono ${ simplified ? 'text-sm' : 'text-sm md:text-xxs xl:text-xs' } ` }
@@ -620,7 +620,7 @@ export const Highlight: React.FC<Props> = ({
620620 < p
621621 className = { `text-left font-mono ${ simplified ? 'text-sm' : 'text-sm md:text-xxs xl:text-xs' } ` }
622622 >
623- { move }
623+ { colorSanMapping [ move ] ?. san ?? move }
624624 </ p >
625625 < p
626626 className = { `text-right font-mono ${ simplified ? 'text-sm' : 'text-sm md:text-xxs xl:text-xs' } ` }
Original file line number Diff line number Diff line change @@ -56,6 +56,13 @@ export const generateColorSanMapping = (
5656
5757 const chess = new Chess ( fen )
5858 const moves = chess . moves ( { verbose : true } )
59+ moves . forEach ( ( m ) => {
60+ const moveKey = `${ m . from } ${ m . to } ${ m . promotion || '' } `
61+ mapping [ moveKey ] = {
62+ san : m . san ,
63+ color : '#FFF' ,
64+ }
65+ } )
5966
6067 if ( ! stockfish ) return mapping
6168
You can’t perform that action at this time.
0 commit comments