From ccf69a91a7e74c059ed43ed897c74b8f8c68134f Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Mar 2026 16:36:57 +0000 Subject: [PATCH] fix: duplicate optAutoRedact ID + hardcoded log limit + add test suite Bug 1: popup.html had duplicate id="optAutoRedact" on both the Auto Redact toggle and Auto-redact Detected PII toggle. The second overwrote the first, making the Auto Redact setting uncontrollable. Fixed by giving the second toggle id="optAutoRedactDetected". Bug 2: injector.js hardcoded activity log trim to 100, ignoring the user's maxLogEntries setting. Now reads the setting from storage. Added test-suite.html with 35+ tests covering storage, encryption, sync (encryption-mandatory flows), auto-redact (built-in + custom patterns), substitution engine, smart patterns, and auto-detect. https://claude.ai/code/session_01KF4i7Ra7zCEDskxDBaNtcT --- src/content/injector.js | 6 +- src/popup/popup.html | 2 +- src/popup/popup.js | 4 +- test-suite.html | 506 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 513 insertions(+), 5 deletions(-) create mode 100644 test-suite.html diff --git a/src/content/injector.js b/src/content/injector.js index 9269750..506d719 100644 --- a/src/content/injector.js +++ b/src/content/injector.js @@ -91,6 +91,8 @@ // Also log directly from the injector (content script world) // in case the background worker is asleep const replacements = event.data.replacements || []; + const settingsResult = await api.storage.local.get('ss_settings'); + const maxLog = settingsResult.ss_settings?.maxLogEntries || 100; for (const r of replacements) { const log = (await api.storage.local.get('ss_activity_log')).ss_activity_log || []; log.unshift({ @@ -104,8 +106,8 @@ pattern: r.pattern || '', url: location.href, }); - // Trim - if (log.length > 100) log.length = 100; + // Trim to user-configured max + if (log.length > maxLog) log.length = maxLog; await api.storage.local.set({ ss_activity_log: log }); } } diff --git a/src/popup/popup.html b/src/popup/popup.html index c896408..ba0b825 100644 --- a/src/popup/popup.html +++ b/src/popup/popup.html @@ -217,7 +217,7 @@ Auto-redact detected PII Replace detected PII with placeholders on send - +
diff --git a/src/popup/popup.js b/src/popup/popup.js index b318f05..ce42697 100644 --- a/src/popup/popup.js +++ b/src/popup/popup.js @@ -222,7 +222,7 @@ async function initUnlockedUI() { // Load options tab settings $('#optAutoRedact').checked = settings.autoRedact !== false; $('#optAutoDetect').checked = settings.autoDetect !== false; - $('#optAutoRedact').checked = settings.autoRedactDetected !== false; + $('#optAutoRedactDetected').checked = settings.autoRedactDetected !== false; $('#optHighlights').checked = settings.showHighlights || false; $('#optDocPreview').checked = settings.docScanPreview !== false; @@ -230,7 +230,7 @@ async function initUnlockedUI() { const optHandlers = [ ['optAutoRedact', 'autoRedact'], ['optAutoDetect', 'autoDetect'], - ['optAutoRedact', 'autoRedactDetected'], + ['optAutoRedactDetected', 'autoRedactDetected'], ['optHighlights', 'showHighlights'], ['optDocPreview', 'docScanPreview'], ]; diff --git a/test-suite.html b/test-suite.html new file mode 100644 index 0000000..7654017 --- /dev/null +++ b/test-suite.html @@ -0,0 +1,506 @@ + + + + + Silent Send - Feature Test Suite + + + +

Silent Send - Feature Test Suite

+

+ Load this page as an extension page (or inject via dev console on the Options page).
+ Tests exercise sync, encryption, storage, auto-redact, and domain management. +

+ + +
+
+ + + +