From b51755aef8bb3e1bc04ac407afdd3a92d61d9ceb Mon Sep 17 00:00:00 2001 From: Gabor Szabo Date: Mon, 18 May 2026 11:02:16 +0200 Subject: [PATCH] fix(ui): forecast page reads forecasts/forecast from predict job result (#147) The /visualize/forecast page never rendered the chart for a valid completed predict job. It read job.result.predictions with field `predicted`, but POST /jobs (job_type="predict") returns job.result.forecasts with field `forecast`. forecastData was therefore always undefined and the page fell through to "No prediction data available in job result". Read result.forecasts with field `forecast`, and pass predictedKey="forecast" to TimeSeriesChart (which already supports a configurable data key). Verified in a browser: entering a completed predict job ID now renders the 14-day forecast line chart with correct tooltip values. --- frontend/src/pages/visualize/forecast.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/visualize/forecast.tsx b/frontend/src/pages/visualize/forecast.tsx index 91291a13..490da276 100644 --- a/frontend/src/pages/visualize/forecast.tsx +++ b/frontend/src/pages/visualize/forecast.tsx @@ -26,10 +26,11 @@ export default function ForecastPage() { } } - // Extract forecast data from job result - const forecastData = job?.result?.predictions as Array<{ + // Extract forecast data from job result. + // A completed `predict` job stores result.forecasts (each point: date + forecast). + const forecastData = job?.result?.forecasts as Array<{ date: string - predicted: number + forecast: number }> | undefined return ( @@ -109,6 +110,7 @@ export default function ForecastPage() { title="Forecast Results" description={`${forecastData.length} day forecast`} data={forecastData} + predictedKey="forecast" showActual={false} showPredicted={true} />