Skip to content

Commit d2d47d8

Browse files
Drill Studio UI refinements and background analysis during play
- Add collapsible category headers (Open Games, Semi-Open, etc.) with auto-expand when searching - Lighten small text for readability, fix uppercase PGN in category labels - Rename opponents to "Maia-3 1500" format with 600-2600 range - Fix Start Drilling button visibility with proper flex layout - Fix Vercel build errors (GameBoard check prop, <piece> JSX element) - Match drill Stockfish analysis to main analysis (depth 18, staged search with Maia candidate moves) - Run Maia + Stockfish analysis in background during drill play so post-drill results are available immediately Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1a37423 commit d2d47d8

7 files changed

Lines changed: 1702 additions & 183 deletions

File tree

src/components/Board/GameBoard.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ export const GameBoard: React.FC<Props> = ({
142142
fen,
143143
lastMove,
144144
check: currentNode.check
145-
? (currentNode.turn === 'w' ? 'white' : 'black')
145+
? currentNode.turn === 'w'
146+
? 'white'
147+
: 'black'
146148
: false,
147149
orientation: orientation as 'white' | 'black',
148150
}
@@ -172,7 +174,7 @@ export const GameBoard: React.FC<Props> = ({
172174
},
173175
fen: boardConfig.fen,
174176
lastMove: boardConfig.lastMove as Key[],
175-
check: boardConfig.check,
177+
check: boardConfig.check as boolean | 'white' | 'black' | undefined,
176178
orientation: boardConfig.orientation,
177179
}}
178180
/>

src/components/Board/GameClock.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ export const GameClock: React.FC<Props> = (
5959
const showTenths = minutes < 1 && seconds <= 20
6060

6161
return (
62-
<div
63-
className="flex flex-row items-center justify-between bg-glass-strong md:flex-col md:items-start md:justify-start"
64-
>
62+
<div className="flex flex-row items-center justify-between bg-glass-strong md:flex-col md:items-start md:justify-start">
6563
<div className="flex w-full items-center justify-between gap-3 px-4 py-2">
6664
<span
6765
className={`flex items-center gap-2 transition-colors ${
@@ -96,9 +94,7 @@ export const GameClock: React.FC<Props> = (
9694
</div>
9795
<div
9896
className={`inline-flex self-start px-4 py-2 transition-all duration-200 md:text-3xl ${
99-
active
100-
? 'font-semibold text-primary'
101-
: 'text-white/55'
97+
active ? 'font-semibold text-primary' : 'text-white/55'
10298
}`}
10399
>
104100
{minutes}:{('00' + seconds).slice(-2)}

src/components/Common/MaterialBalance.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@ import { useMemo } from 'react'
22
import type { Color } from 'src/types'
33
import { Chess } from 'chess.ts'
44

5+
declare module 'react' {
6+
// eslint-disable-next-line @typescript-eslint/no-namespace
7+
namespace JSX {
8+
interface IntrinsicElements {
9+
piece: React.DetailedHTMLProps<
10+
React.HTMLAttributes<HTMLElement>,
11+
HTMLElement
12+
>
13+
}
14+
}
15+
}
16+
517
type PieceType = 'p' | 'n' | 'b' | 'r' | 'q' | 'k'
618
type MaterialCount = Record<PieceType, number>
719

@@ -170,8 +182,7 @@ export const MaterialBalance = ({
170182

171183
const capturedPieceColor = color === 'white' ? 'black' : 'white'
172184
const capturedPieceFilter =
173-
pieceFilter ??
174-
capturedPieceColor === 'black'
185+
(pieceFilter ?? capturedPieceColor === 'black')
175186
? 'drop-shadow(0 0 0.8px rgba(255,255,255,0.82)) drop-shadow(0 0 1.5px rgba(255,255,255,0.28))'
176187
: 'drop-shadow(0 0 0.8px rgba(0,0,0,0.82)) drop-shadow(0 0 1.5px rgba(0,0,0,0.22))'
177188

0 commit comments

Comments
 (0)