b02e1d035194
single-click copies and double-click edits totp; remove redundant copy button and hover box (v1.8.4)
- time
- 2026-04-24 22:37 UTC · 6 months ago
- machine
- koh2
- parent
- 4c33f3380f77
↓ peach-browser-b02e1d03.tar.gzatlas at this save
files changed6 files
manifest.firefox.json+1 −1manifest.json+1 −1package.json+1 −1src/popup/styles/popup.css+3 −0src/popup/views/Entry.tsx+5 −10src/popup/views/contracts.test.tsx+4 −4manifest.firefox.json+1 −1
@@ -1,7 +1,7 @@11 {22 "manifest_version": 3,33 "name": "Peach",4- "version": "1.8.3",4+ "version": "1.8.4",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": "1.8.3",4+ "version": "1.8.4",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": "1.8.3",3+ "version": "1.8.4",44 "description": "Zero-knowledge password manager",55 "type": "module",66 "scripts": {src/popup/styles/popup.css+3 −0
@@ -654,7 +654,10 @@654654 }655655 .peach-totp-main {656656 min-width: 0;657+ cursor: pointer;658+ user-select: none;657659 }660+.peach-totp-code.is-copied { opacity: 0.55; transition: opacity 140ms ease; }658661 .peach-totp-code-row {659662 display: flex;660663 align-items: flex-end;src/popup/views/Entry.tsx+5 −10
@@ -826,23 +826,18 @@826826 {(state) => (827827 <>828828 <div829- class="peach-totp-main peach-inline-clickable"830- onClick={() => startEdit("totp", entry().totp ?? "")}829+ class="peach-totp-main"830+ onClick={() => void copyField(state().code.replace(" ", ""), "totp")}831+ onDblClick={() => startEdit("totp", entry().totp ?? "")}832+ title="Click to copy · double-click to edit"831833 >832834 <span class="peach-label">2-factor</span>833835 <div class="peach-totp-code-row">834- <p class={`peach-totp-code${totpHot() ? " is-hot" : ""}`}>836+ <p class={`peach-totp-code${totpHot() ? " is-hot" : ""}${copied() === "totp" ? " is-copied" : ""}`}>835837 <span class="peach-totp-code-text">836838 {state().code.slice(0, 3)} {state().code.slice(3)}837839 </span>838840 </p>839- <button840- class={`peach-btn peach-btn--ghost peach-btn--sm peach-icon-btn peach-copy-btn peach-totp-copy-btn ${copied() === "totp" ? "is-copied" : ""}`}841- onClick={(e) => void copyField(state().code.replace(" ", ""), "totp", e.currentTarget as HTMLButtonElement)}842- aria-label="Copy TOTP code"843- >844- <CopyGlyph /><span class="peach-copy-sheen" />845- </button>846841 </div>847842 </div>848843 <div class="peach-totp-meta">src/popup/views/contracts.test.tsx+4 −4
@@ -488,8 +488,8 @@488488 );489489 expect(onFieldSaved).not.toHaveBeenCalled();490490 491- const totpButton = container.querySelector('button[aria-label="Copy TOTP code"]') as HTMLButtonElement;492- totpButton.click();491+ const totpMain = container.querySelector(".peach-totp-main") as HTMLDivElement;492+ totpMain.click();493493 await flushView();494494 495495 expect(sendMessageMock).toHaveBeenLastCalledWith({@@ -533,8 +533,8 @@533533 />534534 );535535 536- const totpMain = container.querySelector(".peach-totp-main.peach-inline-clickable") as HTMLDivElement;537- totpMain.click();536+ const totpMain = container.querySelector(".peach-totp-main") as HTMLDivElement;537+ totpMain.dispatchEvent(new MouseEvent("dblclick", { bubbles: true }));538538 await flushView();539539 540540 const totpInput = container.querySelector('input[placeholder="otpauth://... or base32 secret"]') as HTMLInputElement;