diff --git a/api.php b/api.php index c94271e..2ab0d27 100644 --- a/api.php +++ b/api.php @@ -715,9 +715,9 @@ function handleList() { if (file_exists($result_file)) { $job_data['status'] = 'completed'; $result = json_decode(file_get_contents($result_file), true); - $job_data['score'] = $result['score'] ?? null; - $job_data['grade'] = $result['grade'] ?? null; - $job_data['total_issues'] = $result['total_issues'] ?? null; + $job_data['score'] = $result['accessibility_score'] ?? ($result['score'] ?? null); + $job_data['grade'] = $result['grade'] ?? null; + $job_data['total_issues'] = $result['total_issues'] ?? null; $job_data['critical_count'] = $result['severity_counts']['critical'] ?? 0; $job_data['error_count'] = $result['severity_counts']['error'] ?? 0; } @@ -752,10 +752,13 @@ function handleDelete() { $job_data = json_decode(file_get_contents($meta_file), true); - // Delete files - @unlink($job_data['filepath']); + // Delete all files associated with this job + @unlink($job_data['filepath'] ?? ''); @unlink($meta_file); @unlink(RESULTS_DIR . '/' . $job_id . '.result.json'); + @unlink(RESULTS_DIR . '/' . $job_id . '.dismissed.json'); + @unlink(RESULTS_DIR . '/' . $job_id . '.overrides.json'); + @unlink(RESULTS_DIR . '/' . $job_id . '.error.log'); success(['message' => 'Job deleted']); } diff --git a/css/styles.css b/css/styles.css index f76fcc6..2f31f4d 100644 --- a/css/styles.css +++ b/css/styles.css @@ -1658,6 +1658,11 @@ h1::before { color: var(--accent); } +.history-action-delete:hover { + border-color: var(--error); + color: var(--error); +} + /* ── Reduced Motion ── */ @media (prefers-reduced-motion: reduce) { *, *::before, *::after { diff --git a/js/app.js b/js/app.js index 9a56b7e..ccd4227 100644 --- a/js/app.js +++ b/js/app.js @@ -155,6 +155,7 @@ function renderHistory(jobs) { const jsonBtn = j.status === 'completed' ? `JSON` : ''; + const deleteBtn = ``; return `