Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "chess-solver",
"private": true,
"version": "1.2.0",
"version": "1.2.1",
"description": "Desktop chess analysis tool powered by Stockfish 18 — set up any position and get engine-recommended moves with evaluations, tactical motifs, and principal variations.",
"author": "ccharafeddine",
"license": "GPL-3.0-only",
Expand Down
32 changes: 16 additions & 16 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, useEffect, useMemo, useRef, useCallback } from 'react';
import { useState, useEffect, useMemo, useRef, useCallback } from 'react';
import { Chess, validateFen } from 'chess.js';
import Board from './components/Board';
import PieceSelector from './components/PieceSelector';
Expand Down Expand Up @@ -88,7 +88,7 @@ export default function App() {
const [orientation, setOrientation] = useState<'white' | 'black'>('white');
// Analysis output is keyed by the FEN it was computed for. Results for any
// other position are simply not displayed, so stale engine output can never
// be shown against the wrong board — no token bookkeeping required.
// be shown against the wrong board — no token bookkeeping required.
const [analysisResult, setAnalysisResult] = useState<AnalysisResult | null>(null);
const [engineWarning, setEngineWarning] = useState<EngineWarning | null>(null);
const [analysisMeta, setAnalysisMeta] = useState<AnalysisMeta>({ depth: 0, nps: 0, threads: 0 });
Expand Down Expand Up @@ -208,7 +208,7 @@ export default function App() {
engineRef.current.analyze(analysisFen, (lines: AnalysisLine[], meta: AnalysisMeta, isFinal: boolean) => {
setAnalysisMeta(meta);

// Drop lines that are not legal in this position — a defense against
// Drop lines that are not legal in this position — a defense against
// stale engine output. Only applicable when chess.js can load the
// position at all; for editor-built positions it can't validate
// (e.g. pawns on the back rank), trust the engine's own legality.
Expand All @@ -234,7 +234,7 @@ export default function App() {
setAnalysisResult({ fen: analysisFen, lines: [], final: true });
setEngineWarning({
fen: analysisFen,
message: 'The engine did not return analysis for this position. Click ↻ to retry.',
message: 'The engine did not return analysis for this position. Click ↻ to retry.',
});
return;
}
Expand Down Expand Up @@ -420,7 +420,7 @@ export default function App() {
aria-label="Toggle dark mode"
>
<span className="theme-toggle-icon">
{theme === 'light' ? '☀' : '☾'}
{theme === 'light' ? '☀' : '☾'}
</span>
<span className="theme-toggle-track">
<span className="theme-toggle-knob" />
Expand Down Expand Up @@ -465,17 +465,6 @@ export default function App() {
onSelectPiece={setSelectedPiece}
selectedPiece={selectedPiece}
/>
<NotationPanel
fen={fen}
moves={game.moves}
cursor={game.cursor}
fenError={fenError}
pgnError={pgnError}
onLoadFen={handleLoadFen}
onJump={handleJump}
onImportPgn={handleImportPgn}
onExportPgn={handleExportPgn}
/>
</div>

<div className="analysis-section">
Expand All @@ -494,6 +483,17 @@ export default function App() {
onHighlightMove={(from, to) => setHighlightSquares({ from, to })}
onClearHighlight={() => setHighlightSquares(null)}
/>
<NotationPanel
fen={fen}
moves={game.moves}
cursor={game.cursor}
fenError={fenError}
pgnError={pgnError}
onLoadFen={handleLoadFen}
onJump={handleJump}
onImportPgn={handleImportPgn}
onExportPgn={handleExportPgn}
/>
</div>
</main>
</div>
Expand Down
Loading