From 18181ecccd3df40b9647a566348c35533835a703 Mon Sep 17 00:00:00 2001 From: ai-bot Date: Sat, 3 Oct 2026 17:17:09 +0000 Subject: [PATCH] Require an explicit Hardware works choice (section 24.1) --- static/health-check.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/static/health-check.js b/static/health-check.js index b5711f0..cedd340 100644 --- a/static/health-check.js +++ b/static/health-check.js @@ -40,7 +40,9 @@ const verificationStatuses = [ ]; // Availability is always recorded, so it has no "not assessed" value (section 22). const availabilityOptions = [["", "Select availability"], ["1", "Yes"], ["0", "No"]]; -const booleanOptions = [["", "Not assessed"], ["1", "Yes"], ["0", "No"]]; +// Hardware works requires an active choice, so the placeholder is not an answer +// (section 24.1). +const hardwareWorksOptions = [["", "Select status"], ["1", "Yes"], ["0", "No"]]; let keyProfiles = []; let previousValues = { keys: [] }; // True while the compatibility control carries the value derived for a cloud key. @@ -204,7 +206,12 @@ function renderKeyCheck() { const details = document.createElement("div"); details.className = "form-stack"; if (key.type === "hardware") { - details.append(makeField("Hardware works", "hardware_works", makeSelect(booleanOptions, "hardware_works"))); + // Hardware works requires an active Yes or No (section 24.1). + details.append(makeField( + "Hardware works", + "hardware_works", + makeSelect(hardwareWorksOptions, "hardware_works"), + )); details.append(makeField( "Firmware version", "firmware_version", @@ -238,12 +245,15 @@ function renderKeyCheck() { } function syncRequiredFields() { + // Hardware works and the two verification results all require an active choice + // for a key that was available (sections 23.1 and 24.1). The required flag is + // cleared when the key was not available, because a hidden required control + // would block the submission. const key = selectedKey(); const availability = form.querySelector('[name="available"]'); const required = Boolean(key) && availability !== null && availability.value === "1"; - for (const name of ["seed_backup_verified", "address_path_verified"]) { - const selector = `[name="${name}"]`; - const select = form.querySelector(selector); + for (const name of ["hardware_works", "seed_backup_verified", "address_path_verified"]) { + const select = form.querySelector(`[name="${name}"]`); if (select) { select.required = required; }