Skip to content

Commit 7f301b3

Browse files
fix: build + lint errors
1 parent 7bcba04 commit 7f301b3

3 files changed

Lines changed: 18 additions & 9 deletions

File tree

src/components/Openings/DrillPerformanceModal.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@ import { DrillPerformanceData, MoveAnalysis } from 'src/types/openings'
2626
import { MaiaRatingInsights } from './MaiaRatingInsights'
2727
import { WindowSizeContext, TreeControllerContext } from 'src/contexts'
2828
import {
29+
BlunderIcon,
2930
ExcellentIcon,
3031
InaccuracyIcon,
31-
BlunderIcon,
32-
MoveClassificationIcon,
3332
} from 'src/components/Common/MoveIcons'
34-
import { MOVE_CLASSIFICATION_THRESHOLDS } from 'src/constants/analysis'
3533
import { useTreeController } from 'src/hooks'
3634
import { generateColorSanMapping } from 'src/hooks/useAnalysisController/utils'
37-
import { GameNode, GameTree } from 'src/types/tree'
35+
import { GameNode, GameTree } from 'src/types'
3836

3937
interface Props {
4038
performanceData: DrillPerformanceData
@@ -237,7 +235,6 @@ const AnimatedGameReplay: React.FC<{
237235
game={{
238236
id: 'drill-performance',
239237
tree: gameTree,
240-
moves: [], // Not used when tree is provided
241238
}}
242239
type="analysis"
243240
showAnnotations={true}
@@ -787,7 +784,12 @@ const DesktopLayout: React.FC<{
787784
<div className="flex flex-1 overflow-hidden">
788785
{/* Left Panel - Animated Game Replay */}
789786
<div className="flex w-1/3 flex-col border-r border-white/10">
790-
<TreeControllerContext.Provider value={treeController}>
787+
<TreeControllerContext.Provider
788+
value={{
789+
gameTree: treeController.tree,
790+
...treeController,
791+
}}
792+
>
791793
<AnimatedGameReplay
792794
openingFen={openingFen}
793795
playerColor={drill.selection.playerColor}
@@ -1127,7 +1129,12 @@ const MobileLayout: React.FC<{
11271129
{/* Tab Content */}
11281130
<div className="flex-1 overflow-hidden">
11291131
{activeTab === 'replay' && (
1130-
<TreeControllerContext.Provider value={treeController}>
1132+
<TreeControllerContext.Provider
1133+
value={{
1134+
gameTree: treeController.tree,
1135+
...treeController,
1136+
}}
1137+
>
11311138
<AnimatedGameReplay
11321139
openingFen={openingFen}
11331140
playerColor={drill.selection.playerColor}

src/components/Puzzles/Feedback.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ export const Feedback: React.FC<Props> = ({
2929
const { targetIndex } = game
3030

3131
const turn =
32-
new Chess(game.moves[targetIndex].board).turn() === 'w' ? 'white' : 'black'
32+
new Chess(controller.gameTree.getLastMainlineNode().fen).turn() === 'w'
33+
? 'white'
34+
: 'black'
3335

3436
const archivedContent = `
3537
##### PUZZLE COMPLETED

src/types/openings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { GameTree, GameNode } from './common'
1+
import { GameTree, GameNode } from '.'
22

33
export interface Opening {
44
id: string

0 commit comments

Comments
 (0)