From 961d77534f801fde90c9318bac3023f23aeca5a8 Mon Sep 17 00:00:00 2001 From: r-zakarya <82443831+r-zakarya@users.noreply.github.com> Date: Sat, 1 Aug 2026 20:12:09 +0100 Subject: [PATCH] fix(hibp): move the progress pill off the sidebar and abort the scan on toggle-off The pill was pinned to the left edge and covered the navigation, hiding Trash. It also kept counting after Breach check disabled, the workers carrying on with one network round-trip per entry. --- TEST_SCENARIOS.md | 2 ++ css/style.css | 5 ++++- js/app.js | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/TEST_SCENARIOS.md b/TEST_SCENARIOS.md index 7ead28d..8248a1f 100644 --- a/TEST_SCENARIOS.md +++ b/TEST_SCENARIOS.md @@ -361,6 +361,8 @@ l'éditeur slideover : créer + éditer une entrée, ajouter/retirer des tags, - **ACTION** : dans *Vault health*, activer la vérification HIBP → attendre la fin du scan **sans quitter la vue**. - **ATTENDU** : la carte *Pwned* et le score se mettent à jour **tout seuls** quand le scan finit. - **ACTION 2** : désactiver HIBP → la catégorie *Pwned* retombe à 0 immédiatement. +- **ACTION 3** : relancer un scan et **désactiver HIBP en plein milieu**. +- **ATTENDU** : la pastille de progression (en bas, à droite de la barre latérale) **disparaît aussitôt** ; plus aucune requête réseau. Elle continuait à compter après « Breach check disabled », le scan poursuivant un aller-retour réseau par entrée. - **Historique** : le cache santé était calculé **avant** l'arrivée des résultats et rien ne l'invalidait ensuite. La vue affichait `0 pwned` pendant que les cartes de la liste portaient déjà le drapeau ; il fallait sortir et revenir pour voir `2`. Symétrique à la désactivation, qui vidait `hibpResults` en laissant le tableau de bord compter des brèches disparues. `hibpCheckAllEntries` et le toggle invalident désormais `healthCache`. ### G4 · le score bouge par paliers de 10 — comportement attendu diff --git a/css/style.css b/css/style.css index 3fc7101..93a8e22 100644 --- a/css/style.css +++ b/css/style.css @@ -2347,7 +2347,9 @@ body[data-editor-position="center"]:has(#settingsPanel.is-open)::before { stack bottom-right. Non-blocking: no backdrop, no pointer capture. */ .hibp-progress { position: fixed; - left: 16px; bottom: 16px; + /* Clear of the 240px sidebar — pinned to the left edge it sat on top of the + navigation and hid Trash. Left of the toasts, which stack bottom-right. */ + left: 256px; bottom: 16px; z-index: 150; display: flex; align-items: center; gap: 8px; padding: 8px 12px; @@ -2666,6 +2668,7 @@ body[data-editor-position="center"]:has(#settingsPanel.is-open)::before { @media (max-width: 900px) { .app-shell { grid-template-columns: 60px 1fr; } + .hibp-progress { left: 76px; } /* the sidebar collapses to 60px here */ .sidebar { padding: 12px 6px; } .sidebar-brand span, .nav-item > span:first-of-type, diff --git a/js/app.js b/js/app.js index 15c07d5..6781ff4 100644 --- a/js/app.js +++ b/js/app.js @@ -989,6 +989,10 @@ async function hibpCheckAllEntries() { for (let w = 0; w < CONCURRENCY; w++) { workers.push((async () => { while (queue.length) { + // Stop as soon as the user turns the check off: the scan is one + // network round-trip per entry, and it kept running (and kept + // counting in the pill) after "Breach check disabled". + if (!state.hibpEnabled) return; const entry = queue.shift(); try { const pwd = await decryptPwd(entry.encrypted_password, entry.iv); @@ -1006,6 +1010,8 @@ async function hibpCheckAllEntries() { } await Promise.all(workers); hibpProgress(null); + // Aborted by the toggle: it already cleared the results and refreshed. + if (!state.hibpEnabled) return; // The health dashboard reads its "pwned" column from state.hibpResults, and // its cache may well have been computed before these results landed — that // is exactly what happens when HIBP is switched on from the health view