fix(analysis): fix API field mismatch and enable full game analysis
Map raw backend response (evaluation/continuationMoves) to frontend model (eval/winChance/continuations). Add getFenHistory() call after loading a game or PGN so runAnalysis() gets per-ply FEN history and triggers analyzeGame() instead of falling back to single-position analysis. Remove !hasAnnotations guard so positionAnalysis card shows even when a game is loaded. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,11 +3,21 @@ export interface AnalysisRequest {
|
||||
depth: number;
|
||||
}
|
||||
|
||||
export interface RawAnalysisResponse {
|
||||
fen: string;
|
||||
evaluation: number;
|
||||
depth: number;
|
||||
bestMove: string;
|
||||
mate: number | null;
|
||||
continuationMoves: string[];
|
||||
}
|
||||
|
||||
export interface AnalysisResponse {
|
||||
eval: number;
|
||||
winChance: number;
|
||||
depth: number;
|
||||
bestMove: string;
|
||||
mate: number | null;
|
||||
continuations: string[];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user