From 853e51baac3e565514174f9e048c0eda86a926f8 Mon Sep 17 00:00:00 2001 From: librelad Date: Sat, 29 Aug 2026 07:34:55 +0100 Subject: [PATCH] Show the confirmed backup as a card, not a sentence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moving the results under the Folder field kept the placement but threw away the presentation: the card became a line of prose. Path, snapshot count and age read better as a card, and that is what the found list already used. One renderer now serves both. The same fact should not look like two different things depending on whether it came from the scan or from pressing Check — only whether it is still a choice differs, so a pickable one is a ` + : `
${body}
`; + } + renderFoundBackups() { const box = this.container.querySelector('#sw-rs-found'); if (!box) return; @@ -1138,12 +1156,7 @@ class SetupWizard { box.innerHTML = `

Backups found on this machine \u2014 pick one:

` + - found.map((f, i) => ` - `).join(''); + found.map((f, i) => this._backupCard(Object.assign({ _i: i }, f), 'pick')).join(''); this._adoptSingleResult(); @@ -1219,10 +1232,8 @@ class SetupWizard { const box = this.container.querySelector('#sw-rs-verify-result'); if (!box) return; if (d && d.repo) { - box.innerHTML = `

Backup found \u2014 - ${d.snapshots} snapshot${d.snapshots === 1 ? '' : 's'}${ - d.newest ? `, newest ${this._restoreWhen(d.newest)}` : ''}. - Enter its password to see what is inside.

`; + box.innerHTML = this._backupCard(d, 'chosen') + + `

Enter its password below to see what is inside.

`; return; } // A suggestion means they pointed at the folder holding the repositories diff --git a/scripts/dev/lp-restore-wizard-test b/scripts/dev/lp-restore-wizard-test index f5d21bf..21644e4 100755 --- a/scripts/dev/lp-restore-wizard-test +++ b/scripts/dev/lp-restore-wizard-test @@ -143,6 +143,15 @@ read -r -d '' DRIVE <<'JS' w.renderFoundBackups(); out.singlePrefillsThePath = ($('#sw-rs-path') || {}).value === '/only/one'; out.singleShowsItsVerdict = /4 snapshots/.test(($('#sw-rs-verify-result') || {}).textContent || ''); + // Rendered as the same CARD the found list uses, not as a sentence. It is + // the same fact either way and should not look like two different things + // depending on how it was arrived at. + const chosen = $('#sw-rs-verify-result .setup-found-backup'); + out.singleRendersAsACard = !!chosen; + out.singleCardCarriesTheBadge = !!(chosen && chosen.querySelector('.setup-storage-badge')); + // Not a button: there is nothing left to choose, and a card that looks + // clickable but is not is worse than one that does not. + out.singleCardIsNotClickable = !!chosen && chosen.tagName !== 'BUTTON'; // The card and the verdict would otherwise say the same thing twice. out.singleDrawsNoDuplicateCard = $('#sw-rs-found .setup-found-backup') === null; // Pressing Check must confirm, not reply "give a full path" about the backup @@ -306,6 +315,9 @@ chk "so does the verdict" "$(g .verdictInsideTheGroup)" true echo " one result is the answer, not a choice" chk "it fills the path in" "$(g .singlePrefillsThePath)" true chk "and shows its verdict" "$(g .singleShowsItsVerdict)" true +chk "as a card, not a sentence" "$(g .singleRendersAsACard)" true +chk "carrying the snapshot badge" "$(g .singleCardCarriesTheBadge)" true +chk "and not looking clickable" "$(g .singleCardIsNotClickable)" true chk "without a duplicate card" "$(g .singleDrawsNoDuplicateCard)" true chk "Check confirms, not scolds" "$(g .singleCheckDoesNotScold)" true