From 79d8d5f7bba36fa11a76d5270624851d9f2faf83 Mon Sep 17 00:00:00 2001 From: busya Date: Mon, 1 Jun 2026 08:44:28 +0300 Subject: [PATCH] fix(ui): normalize screenshot field names in run detail load function API returns 'screenshot_paths' but frontend template reads 'screenshots'. Without field mapping, screenshots are never displayed. Fix: map screenshot_paths -> screenshots and logs_sent_to_llm -> logs_sent in the +page.js load function. Also verifies that /api/storage/file endpoint exists (mounted at /api/storage) and the frontend API_BASE_URL='/api' correctly prefixes /storage/file. --- .../validation-tasks/[policyId]/runs/[runId]/+page.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/routes/validation-tasks/[policyId]/runs/[runId]/+page.js b/frontend/src/routes/validation-tasks/[policyId]/runs/[runId]/+page.js index fedb61ea..2365645c 100644 --- a/frontend/src/routes/validation-tasks/[policyId]/runs/[runId]/+page.js +++ b/frontend/src/routes/validation-tasks/[policyId]/runs/[runId]/+page.js @@ -19,7 +19,13 @@ export async function load({ params }) { // Normalise shape: merge records into run as dashboards for the report page const run = runDetail.run || runDetail; const records = runDetail.records || []; - run.dashboards = records; + + // Normalise field names from backend API shape to frontend template keys + run.dashboards = records.map((rec) => ({ + ...rec, + screenshots: rec.screenshots || rec.screenshot_paths || rec.tab_screenshots || [], + logs_sent: rec.logs_sent || rec.logs_sent_to_llm || [], + })); return { run }; }