4132c0637d08

popup reloads when switching to small text size, restores view and entry state after reload (v3.6.52)

time
2026-05-20 01:15 UTC · 5 months ago
machine
koh2
parent
9bc42bcae846
4 files manifest.firefox.json+1 −1manifest.json+1 −1package.json+1 −1src/popup/App.tsx+37 −6
manifest.firefox.json+1 −1
@@ -2,7 +2,7 @@22   "_comment_audio_capture": "Firefox does not honor the Chrome 'audioCapture' optional_permission — getUserMedia in WebExtensions is gated solely by the runtime permission prompt. Microphone access for chirp pairing works from the popup under the existing '<all_urls>' host permission; no manifest entry is required or accepted here.",33   "manifest_version": 3,44   "name": "Peach",5-  "version": "3.6.51",5+  "version": "3.6.52",66   "description": "Zero-knowledge password manager",77   "browser_specific_settings": {88     "gecko": {

view file

manifest.json+1 −1
@@ -1,7 +1,7 @@11 {22   "manifest_version": 3,33   "name": "Peach",4-  "version": "3.6.51",4+  "version": "3.6.52",55   "description": "Zero-knowledge password manager",66   "action": {77     "default_popup": "src/popup/index.html",

view file

package.json+1 −1
@@ -1,6 +1,6 @@11 {22   "name": "peach",3-  "version": "3.6.51",3+  "version": "3.6.52",44   "description": "Zero-knowledge password manager",55   "type": "module",66   "scripts": {

view file

src/popup/App.tsx+37 −6
@@ -228,6 +228,18 @@228228   async function applyTextSize(size: "small" | "medium" | "large") {229229     setTextSize(size);230230     await sendMessage({ type: "UPDATE_SETTINGS", payload: { textSize: size } });231+    // Small zoom shrinks the html element itself, leaving a black strip in the232+    // already-open popup frame. Reload so Chrome measures fresh 294px dimensions.233+    if (size === "small" && chrome.storage.session) {234+      await chrome.storage.session.set({235+        peach_size_restore: {236+          view: view(),237+          entryId: selectedEntry()?.id ?? null,238+          settingsCard: settingsActiveCard(),239+        },240+      });241+      window.location.reload();242+    }231243   }232244 233245   async function applyReduceMotion(enabled: boolean) {@@ -396,16 +408,35 @@396408 397409     // Check for pending session-storage notices from the background.398410     if (chrome.storage.session) {399-      const session = await chrome.storage.session.get(["pendingProGate", "pendingProNotice"]) as400-        Record<string, { feature?: string } | undefined>;401-      if (session.pendingProGate?.feature) {411+      const session = await chrome.storage.session.get([412+        "pendingProGate",413+        "pendingProNotice",414+        "peach_size_restore",415+      ]) as Record<string, unknown>;416+      const proGate = session.pendingProGate as { feature?: string } | undefined;417+      const proNotice = session.pendingProNotice as { feature?: string } | undefined;418+      if (proGate?.feature) {402419         await chrome.storage.session.remove("pendingProGate");403-        setUpgradeHighlight((session.pendingProGate.feature as ProFeature) ?? null);420+        setUpgradeHighlight((proGate.feature as ProFeature) ?? null);404421         setSettingsInitialSection("license");405422         setView("settings");406-      } else if (session.pendingProNotice?.feature) {423+      } else if (proNotice?.feature) {407424         await chrome.storage.session.remove("pendingProNotice");408-        setPendingProNotice({ feature: session.pendingProNotice.feature ?? "" });425+        setPendingProNotice({ feature: proNotice.feature ?? "" });426+      }427+      const r = session.peach_size_restore as428+        { view: View; entryId: string | null; settingsCard: string } | undefined;429+      if (r) {430+        await chrome.storage.session.remove("peach_size_restore");431+        if (r.settingsCard) setSettingsActiveCard(r.settingsCard);432+        if (r.view === "settings") {433+          setView("settings");434+        } else if (r.view === "entry" && r.entryId) {435+          const entry = entries().find((e) => e.id === r.entryId);436+          if (entry) { setSelectedEntry(entry); setView("entry"); }437+        } else if (r.view !== "lock") {438+          setView(r.view);439+        }409440       }410441     }411442 

view file