e2df50cfe4e3
add current-page URL insert button to new entry domain field
- time
- 2026-05-10 23:31 UTC · 5 months ago
- machine
- koh2
- parent
- 24b44033cfda
↓ peach-browser-e2df50cf.tar.gzatlas at this save
files changed5 files
manifest.firefox.json+1 −1manifest.json+1 −1package.json+1 −1src/popup/styles/popup.css+29 −0src/popup/views/Add.tsx+27 −7manifest.firefox.json+1 −1
@@ -1,7 +1,7 @@11 {22 "manifest_version": 3,33 "name": "Peach",4- "version": "2.38.7",4+ "version": "2.38.8",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.38.7",4+ "version": "2.38.8",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.38.7",3+ "version": "2.38.8",44 "description": "Zero-knowledge password manager",55 "type": "module",66 "scripts": {src/popup/styles/popup.css+29 −0
@@ -2351,6 +2351,35 @@23512351 .peach-new-title-input::placeholder { color: var(--peach-t2); }23522352 23532353 /* Editable domain field */2354+.peach-domain-edit-row {2355+ display: flex;2356+ align-items: center;2357+ gap: 6px;2358+}2359+2360+.peach-domain-edit-row .peach-domain-value--edit {2361+ flex: 1;2362+ width: 0;2363+}2364+2365+.peach-domain-url-btn {2366+ flex-shrink: 0;2367+ background: transparent;2368+ border: none;2369+ cursor: pointer;2370+ color: var(--peach-t3);2371+ padding: 2px 3px;2372+ display: flex;2373+ align-items: center;2374+ line-height: 0;2375+ border-radius: 3px;2376+ transition: color 120ms ease;2377+}2378+2379+.peach-domain-url-btn:hover {2380+ color: var(--peach-accent);2381+}2382+23542383 .peach-domain-value--edit {23552384 font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;23562385 font-size: 0.625rem;src/popup/views/Add.tsx+27 −7
@@ -33,6 +33,7 @@3333 const [showNotes, setShowNotes] = createSignal(!!(props.entry?.notes));3434 const [email, setEmail] = createSignal((props.entry as VaultEntry & { email?: string })?.email ?? "");3535 const [activeIdentityField, setActiveIdentityField] = createSignal<"username" | "email" | null>(null);36+ const [currentTabUrl, setCurrentTabUrl] = createSignal("");3637 const [identityFilter, setIdentityFilter] = createSignal<"all" | "username" | "email">("all");3738 3839 const allIdentities = createMemo(() => {@@ -165,6 +166,10 @@165166 onMount(() => {166167 const el = document.querySelector(".peach-new-title-input") as HTMLInputElement | null;167168 if (el) el.focus();169+ chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {170+ const tabUrl = tabs[0]?.url;171+ if (tabUrl && tabUrl.startsWith("http")) setCurrentTabUrl(tabUrl);172+ });168173 });169174 170175 function getNormalizedTotp(): string | undefined {@@ -310,13 +315,28 @@310315 {/* ── Login fields ── */}311316 <Show when={selectedType() === "login"}>312317 <div class="peach-domain">313- <input314- class="peach-domain-value peach-domain-value--edit"315- placeholder="domain.com"316- autocomplete="off"317- value={url()}318- onInput={(e) => setUrl((e.currentTarget as HTMLInputElement).value)}319- />318+ <div class="peach-domain-edit-row">319+ <input320+ class="peach-domain-value peach-domain-value--edit"321+ placeholder="domain.com"322+ autocomplete="off"323+ value={url()}324+ onInput={(e) => setUrl((e.currentTarget as HTMLInputElement).value)}325+ />326+ <Show when={currentTabUrl()}>327+ <button328+ class="peach-domain-url-btn"329+ type="button"330+ onClick={() => setUrl(currentTabUrl())}331+ title="Insert current page URL"332+ >333+ <svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.1" stroke-linecap="round" stroke-linejoin="round">334+ <path d="M4.5 7.5a3 3 0 0 0 4.243 0L10.5 5.75a3 3 0 0 0-4.243-4.243L5.5 2.26" />335+ <path d="M7.5 4.5a3 3 0 0 0-4.243 0L1.5 6.25a3 3 0 0 0 4.243 4.243L6.5 9.74" />336+ </svg>337+ </button>338+ </Show>339+ </div>320340 </div>321341 322342 <section class="peach-fields">