theseus/address-picker-preload.js
Local Dev c5dd03adc3 Ship Theseus 0.3.4 3d6d3d6a (address-picker delete X, Enter picks highlight, URL bar override)
Setup    3d6d3d6aeacf482284707f50d129315d07a593e09b5d68af852abe5aa0ed4c92
Portable 6c8c5ef212bfccb377e17404e83a18cf2f09771d0eb3e0ec86a85587efdcfc9e

Three address-bar suggestion fixes.

Per-row ✕ delete on hover. Clicks on the X call address-forget instead
of address-pick; the row disappears optimistically in the picker and
main drops the entry from history + persists. Sender-URL gated to the
picker's own file:// origin.

Enter with a highlighted suggestion now navigates to THAT url. The
URL input handler tracks a pickerHasCursor flag that flips true on
ArrowDown/ArrowUp and false on any input; Enter with cursor forwards
to the picker's own submit path via addressCursor("enter") — before
this fix, Enter always ran goURL against the typed letters, which
submitted them as a web search instead of opening the selected url.

Address bar reliably shows the picked URL. onAddressPicked now arms
an overrideUrlBarUntil = now+1500ms flag; the onTabs handler treats
that window as "force write the url", bypassing the focus-guard that
was leaving the bar blank when blur() hadn't landed yet.

Deployed: scp + sia-upload of both trees, verified LIVE 0.3.4.
2026-09-02 04:28:54 +02:00

9 lines
543 B
JavaScript

const { contextBridge, ipcRenderer } = require("electron");
contextBridge.exposeInMainWorld("picker", {
onSuggestions: (cb) => ipcRenderer.on("address-suggest", (_e, d) => cb(d)),
onCursor: (cb) => ipcRenderer.on("address-cursor", (_e, dir) => cb(dir)),
pick: (url) => ipcRenderer.invoke("address-pick", url),
forget: (url) => ipcRenderer.invoke("address-forget", url),
close: () => ipcRenderer.invoke("close-address-picker"),
resize: (h) => ipcRenderer.invoke("address-picker-resize", h),
});