cac826341309
add password generator toggle to inline popup edit form (v2.41.2)
- time
- 2026-05-13 20:23 UTC · 5 months ago
- machine
- koh2
- parent
- 906db68f57b8
↓ peach-browser-cac82634.tar.gzatlas at this save
files changed4 files
manifest.firefox.json+1 −1manifest.json+1 −1package.json+1 −1src/content/inject.ts+22 −2manifest.firefox.json+1 −1
@@ -1,7 +1,7 @@11 {22 "manifest_version": 3,33 "name": "Peach",4- "version": "2.41.1",4+ "version": "2.41.2",55 "description": "Zero-knowledge password manager",66 "browser_specific_settings": {77 "gecko": {manifest.json+1 −1
@@ -1,7 +1,7 @@11 {22 "manifest_version": 3,33 "name": "Peach",4- "version": "2.41.1",4+ "version": "2.41.2",55 "description": "Zero-knowledge password manager",66 "action": {77 "default_popup": "src/popup/index.html",package.json+1 −1
@@ -1,6 +1,6 @@11 {22 "name": "peach",3- "version": "2.41.1",3+ "version": "2.41.2",44 "description": "Zero-knowledge password manager",55 "type": "module",66 "scripts": {src/content/inject.ts+22 −2
@@ -745,6 +745,13 @@745745 transition: background 100ms;746746 }747747 .gen-btn:hover { background: color-mix(in srgb, var(--peach-accent) 18%, transparent); }748+ .gen-toggle-link {749+ background: none; border: none; padding: 2px 0;750+ color: color-mix(in srgb, var(--peach-accent) 60%, transparent);751+ font-size: 10px; font-family: "IBM Plex Mono", monospace;752+ cursor: pointer; text-align: left; transition: color 100ms;753+ }754+ .gen-toggle-link:hover { color: var(--peach-accent); }748755 .save-btn {749756 width: 100%; padding: 8px; border-radius: 8px; border: none;750757 background: var(--peach-accent); color: #fff; font-size: 12px;@@ -2262,7 +2269,7 @@22622269 const { g: emailGroup, inp: emailInput } = field("email", entryRes.data.email ?? "");22632270 if (editIdentities.length) attachIdentitySuggestions(emailGroup, emailInput, editIdentities, "email");22642271 2265- // Password row with reveal toggle2272+ // Password row with reveal toggle + generator22662273 const pwGroup = document.createElement("div");22672274 pwGroup.className = "f-group";22682275 const pwLbl = document.createElement("div");@@ -2285,7 +2292,20 @@22852292 revealBtn.textContent = reveal ? "hide" : "show";22862293 });22872294 pwRow.append(pwInput, revealBtn);2288- pwGroup.append(pwLbl, pwRow);2295+ const editSmartGen = createSmartGenerator({ onChange: (pw) => { pwInput.value = pw; } });2296+ editSmartGen.root.style.display = "none";2297+ let editGenVisible = false;2298+ const genToggleBtn = document.createElement("button");2299+ genToggleBtn.className = "gen-toggle-link";2300+ genToggleBtn.type = "button";2301+ genToggleBtn.textContent = "⚙ generate";2302+ genToggleBtn.addEventListener("click", () => {2303+ editGenVisible = !editGenVisible;2304+ pwRow.style.display = editGenVisible ? "none" : "";2305+ editSmartGen.root.style.display = editGenVisible ? "" : "none";2306+ genToggleBtn.textContent = editGenVisible ? "☰ hide generator" : "⚙ generate";2307+ });2308+ pwGroup.append(pwLbl, pwRow, genToggleBtn, editSmartGen.root);22892309 body.appendChild(pwGroup);22902310 22912311 const totpInput = field("2fa secret", entryRes.data.totp ?? "").inp;