From ce1fb0d60b695093495ee0ad824c511dd2db7fbb Mon Sep 17 00:00:00 2001 From: Janis Eccarius Date: Sun, 21 Jun 2026 11:00:29 +0200 Subject: [PATCH] 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 --- src/app/models/analysis.models.ts | 10 ++++++++ .../pages/analysis/analysis.component.html | 2 +- src/app/pages/analysis/analysis.component.ts | 18 ++++++++----- src/app/services/game-api.service.ts | 25 +++++++++++++++++-- 4 files changed, 46 insertions(+), 9 deletions(-) diff --git a/src/app/models/analysis.models.ts b/src/app/models/analysis.models.ts index 53f1bc1..c324cc0 100644 --- a/src/app/models/analysis.models.ts +++ b/src/app/models/analysis.models.ts @@ -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[]; } diff --git a/src/app/pages/analysis/analysis.component.html b/src/app/pages/analysis/analysis.component.html index a2ce620..586816c 100644 --- a/src/app/pages/analysis/analysis.component.html +++ b/src/app/pages/analysis/analysis.component.html @@ -246,7 +246,7 @@