From 15c975561123115deb7bf410eb67495d192ba1ea Mon Sep 17 00:00:00 2001 From: Emily Boudreaux Date: Sat, 9 Aug 2025 18:55:31 -0400 Subject: [PATCH] fix(validation): update validation handler for new JSON architecture Fix handleValidateBundle to work with refactored core functions that return validation data directly instead of nested under result.data. Improve modal message to show actual error/warning counts. --- electron/renderer.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/electron/renderer.js b/electron/renderer.js index 2da30d6..6d5cdde 100644 --- a/electron/renderer.js +++ b/electron/renderer.js @@ -336,8 +336,10 @@ async function handleValidateBundle() { hideSpinner(); if (result.success) { - const validation = result.data; - const validationIssues = validation.errors.concat(validation.warnings); + // With the new JSON architecture, validation data is directly in result + const errors = result.errors || []; + const warnings = result.warnings || []; + const validationIssues = errors.concat(warnings); if (validationIssues.length > 0) { validationResults.textContent = validationIssues.join('\n'); @@ -346,9 +348,14 @@ async function handleValidateBundle() { validationResults.textContent = 'Bundle is valid.'; validationTabLink.classList.add('hidden'); } - // Switch to the validation tab to show the results. + + // Switch to the validation tab to show the results switchTab('validation-tab'); - showModal('Validation Complete', 'Validation check has finished.'); + + // Show summary in modal + const summary = result.summary || { errors: errors.length, warnings: warnings.length }; + const message = `Validation finished with ${summary.errors} errors and ${summary.warnings} warnings.`; + showModal('Validation Complete', message); } else { showModal('Validation Error', `Failed to validate bundle: ${result.error}`);