@@ -90,7 +90,14 @@ const AnimatedGameReplay: React.FC<{
9090 playerColor : 'white' | 'black'
9191 gameTree : GameTree
9292 openingEndNode : GameNode
93- } > = ( { openingFen, playerColor, gameTree, openingEndNode } ) => {
93+ terminationNote ?: string
94+ } > = ( {
95+ openingFen,
96+ playerColor,
97+ gameTree,
98+ openingEndNode,
99+ terminationNote,
100+ } ) => {
94101 const [ currentFen , setCurrentFen ] = useState ( openingFen )
95102 const [ currentNode , setCurrentNode ] = useState < GameNode | null > ( null )
96103 const [ orientation , setOrientation ] = useState < 'white' | 'black' > ( playerColor )
@@ -258,6 +265,7 @@ const AnimatedGameReplay: React.FC<{
258265 } }
259266 startFromNode = { openingEndNode }
260267 restrictNavigationBefore = { openingEndNode }
268+ terminationNote = { terminationNote }
261269 showAnnotations = { true }
262270 showVariations = { false }
263271 />
@@ -768,6 +776,7 @@ const DesktopLayout: React.FC<{
768776 treeController : ReturnType < typeof useTreeController >
769777 gameNodesMap : Map < string , GameNode >
770778 currentMoveIndex : number
779+ terminationNote ?: string
771780 getChartClassification : (
772781 analysis : MoveAnalysis ,
773782 gameNodesMap : Map < string , GameNode > ,
@@ -786,6 +795,7 @@ const DesktopLayout: React.FC<{
786795 treeController,
787796 gameNodesMap,
788797 currentMoveIndex,
798+ terminationNote,
789799 getChartClassification,
790800} ) => (
791801 < div className = "from-white/8 to-white/4 relative flex h-[90vh] max-h-[800px] w-[95vw] max-w-[1200px] flex-col overflow-hidden rounded-lg border border-glass-border bg-gradient-to-br backdrop-blur-md" >
@@ -841,6 +851,7 @@ const DesktopLayout: React.FC<{
841851 playerColor = { drill . selection . playerColor }
842852 gameTree = { gameTree }
843853 openingEndNode = { openingEndNode }
854+ terminationNote = { terminationNote }
844855 />
845856 </ TreeControllerContext . Provider >
846857 </ div >
@@ -1091,6 +1102,7 @@ const MobileLayout: React.FC<{
10911102 treeController : ReturnType < typeof useTreeController >
10921103 gameNodesMap : Map < string , GameNode >
10931104 currentMoveIndex : number
1105+ terminationNote ?: string
10941106 getChartClassification : (
10951107 analysis : MoveAnalysis ,
10961108 gameNodesMap : Map < string , GameNode > ,
@@ -1111,6 +1123,7 @@ const MobileLayout: React.FC<{
11111123 treeController,
11121124 gameNodesMap,
11131125 currentMoveIndex,
1126+ terminationNote,
11141127 getChartClassification,
11151128} ) => (
11161129 < div className = "from-white/8 to-white/4 relative flex h-[95vh] w-[95vw] flex-col overflow-hidden rounded-lg border border-glass-border bg-gradient-to-br backdrop-blur-md" >
@@ -1196,6 +1209,7 @@ const MobileLayout: React.FC<{
11961209 playerColor = { drill . selection . playerColor }
11971210 gameTree = { gameTree }
11981211 openingEndNode = { openingEndNode }
1212+ terminationNote = { terminationNote }
11991213 />
12001214 </ TreeControllerContext . Provider >
12011215 ) }
@@ -1457,6 +1471,14 @@ export const DrillPerformanceModal: React.FC<Props> = ({
14571471
14581472 // Get opening FEN from the opening end node
14591473 const openingFen = openingEndNode . fen
1474+ const moveListTerminationNote = useMemo ( ( ) => {
1475+ const reasonLine = performanceData . feedback . find ( ( entry ) =>
1476+ entry . toLowerCase ( ) . startsWith ( 'drill ended:' ) ,
1477+ )
1478+ if ( ! reasonLine ) return undefined
1479+
1480+ return reasonLine . replace ( / ^ D r i l l e n d e d : \s * / i, '' ) . replace ( / \. $ / , '' )
1481+ } , [ performanceData . feedback ] )
14601482
14611483 return (
14621484 < ModalContainer dismiss = { onContinueAnalyzing } >
@@ -1477,6 +1499,7 @@ export const DrillPerformanceModal: React.FC<Props> = ({
14771499 treeController = { treeController }
14781500 gameNodesMap = { gameNodesMap }
14791501 currentMoveIndex = { currentMoveIndex }
1502+ terminationNote = { moveListTerminationNote }
14801503 getChartClassification = { getChartClassification }
14811504 />
14821505 ) : (
@@ -1494,6 +1517,7 @@ export const DrillPerformanceModal: React.FC<Props> = ({
14941517 treeController = { treeController }
14951518 gameNodesMap = { gameNodesMap }
14961519 currentMoveIndex = { currentMoveIndex }
1520+ terminationNote = { moveListTerminationNote }
14971521 getChartClassification = { getChartClassification }
14981522 />
14991523 ) }
0 commit comments