From f5238f21ca86bdfde3aee7ceaa82be1aac28cef0 Mon Sep 17 00:00:00 2001 From: librelad Date: Tue, 25 Aug 2026 23:14:56 +0100 Subject: [PATCH] feat(setup): wire storage data into regen, split candidate warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit webuiGenerateStorageCandidates now runs as part of webuiSystemUpdate, so frontend/data/storage.json exists without anyone remembering to generate it — the wizard reads it to decide whether its Storage step appears, and the Disks view reads the same file, so the two can never disagree. Warnings arrive from the shell joined with "; ". Rendering that verbatim produced one run-on paragraph that buried the fstab line the user is supposed to copy, so the card splits them back onto separate lines. Verified on the live install with lp-shot: with one filesystem the wizard shows "Step 1 of 4" and the Storage step is correctly absent; with a second filesystem attached it becomes "Step 4 of 5" with the drive carrying a "needs care" badge and both warnings legible. That also exercises the visible-step mapping in both directions. Co-Authored-By: Claude Opus 5 --- .../libreportal/frontend/core/setup/js/setup-wizard.js | 8 ++++++-- .../webui/data/generators/system/webui_system_update.sh | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/containers/libreportal/frontend/core/setup/js/setup-wizard.js b/containers/libreportal/frontend/core/setup/js/setup-wizard.js index 1c1b649..8180a41 100755 --- a/containers/libreportal/frontend/core/setup/js/setup-wizard.js +++ b/containers/libreportal/frontend/core/setup/js/setup-wizard.js @@ -422,7 +422,11 @@ class SetupWizard { const refused = c.verdict === 'refuse'; const warned = c.verdict === 'warn'; const id = `sw-storage-${i}`; - const detail = refused ? c.refusals : (warned ? c.warnings : ''); + // Checks are joined with "; " on the shell side. Split them back out: + // a drive can trip several at once, and one run-on paragraph buries the + // fstab line the user is meant to copy. + const detailParts = String((refused ? c.refusals : c.warnings) || '') + .split(/;\s+/).map(s => s.trim()).filter(Boolean); const badge = refused ? 'unusable' : (warned ? 'needs care' : ''); @@ -435,7 +439,7 @@ class SetupWizard { ${this.escapeHtml(c.fstype)} · ${this.escapeHtml(c.size)} (${this.escapeHtml(c.free)} free)${c.removable ? ' · removable' : ''} - ${detail ? `
${this.escapeHtml(detail)}` : ''} + ${detailParts.length ? detailParts.map(d => `
${this.escapeHtml(d)}`).join('') : ''}
`; diff --git a/scripts/webui/data/generators/system/webui_system_update.sh b/scripts/webui/data/generators/system/webui_system_update.sh index c73f733..3ca7c7c 100755 --- a/scripts/webui/data/generators/system/webui_system_update.sh +++ b/scripts/webui/data/generators/system/webui_system_update.sh @@ -11,6 +11,10 @@ webuiSystemUpdate() { webuiSystemUpdateCheck webuiSystemVerify webuiSystemNetworkCheck + # Storage locations + candidate drives. The setup wizard reads this to + # decide whether its Storage step appears at all, and the Disks view reads + # the same file, so both always agree. + declare -f webuiGenerateStorageCandidates >/dev/null 2>&1 && webuiGenerateStorageCandidates isSuccessful "System information updated!" }