From bf54c245b7bbffbb40f3f0890fd1106e41872551 Mon Sep 17 00:00:00 2001 From: Local Dev Date: Sun, 2 Aug 2026 14:43:31 +0200 Subject: [PATCH] Theseus: in-tab collision prompt + toggle-style switcher + auto-switch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three UX fixes based on operator feedback (2026-08-02): 1) 'Open with…' is now a FULL-PAGE in-tab interstitial (was a modal window). - loadBns loads collision.html via loadFile with query params instead of opening a BrowserWindow. - collision.html is navigation-based: buttons redirect to a special bns://collision-choose/?host=…&choice=…&remember=…&resturl=… URL. - serveBns handles that URL: persists remember=name/tld choice, then returns a meta-refresh to the real target. For BCDN it appends ?_collision=bcnr one-shot marker; for ICANN it redirects to https://. - loadBns strips and honors the ?_collision one-shot marker so BCDN redirects don't re-trigger the prompt. - Old modal path (collisionPromptOnce) removed. 2) Auto-switch from the address-bar chip: clicking BCDN/ICANN chip sets a transient per-tab collisionOverride that loadBns consumes ONCE for this navigation only, bypassing the soft-mode prompt entirely. 3) Address-bar toggle: chips stay visible during 'resolving' (no more flash-and-reappear); active chip is colored (acid green for BCDN, blue for ICANN — matching collision.html's palette); inactive is greyed with border, clickable to switch. Feels like a proper toggle. Settings > Registries copy: operator's exact wording adopted (title stays 'Registries', body uses 'BCNR-unique' term for TLDs that only exist on BCNR). --- chrome.html | 33 +++++---- collision.html | 186 +++++++++++++++++++++++++++++++------------------ main.js | 101 +++++++++++++++++++-------- settings.html | 4 +- 4 files changed, 212 insertions(+), 112 deletions(-) diff --git a/chrome.html b/chrome.html index 37135c0..822da94 100644 --- a/chrome.html +++ b/chrome.html @@ -70,14 +70,17 @@ .secbadge.warn svg .shk { stroke: #f6ad55; } .secbadge.warn svg .bdy { fill: #f6ad55; } input { padding: 7px 6px; border-radius: 999px; border: none; background: transparent; color: inherit; font-size: 13.5px; outline: none; } #url { flex: 1; } - /* registry indicator at the END of the address bar — one or two chips */ + /* registry toggle at the END of the address bar — one or two chips */ #reg { display: inline-flex; gap: 4px; align-items: center; } .reg { font-size: 10.5px; letter-spacing: .03em; padding: 2px 9px; border-radius: 999px; white-space: nowrap; - background: rgba(214,255,61,.13); color: #d6ff3d; border: 1px solid #d6ff3d33; cursor: default; user-select: none; } - .reg.icann { background: rgba(76,158,255,.13); color: #4c9eff; border-color: rgba(76,158,255,.28); } - /* collision candidate: two chips shown together; inactive one is dim + clickable */ - .reg.switch { cursor: pointer; opacity: .55; } - .reg.switch:hover { opacity: 1; } + cursor: default; user-select: none; transition: opacity .15s, background .15s, color .15s, border-color .15s; } + /* Active BCDN — acid glow green */ + .reg.bcdn.active { background: rgba(214,255,61,.15); color: #d6ff3d; border: 1px solid #d6ff3d55; } + /* Active ICANN — blue */ + .reg.icann.active { background: rgba(76,158,255,.15); color: #4c9eff; border: 1px solid #4c9eff55; } + /* Inactive chip in the toggle — greyed, clickable to switch */ + .reg.switch { background: transparent; color: #6b7280; border: 1px solid #ffffff1c; cursor: pointer; } + .reg.switch:hover { color: #b9c2d0; border-color: #ffffff33; } .star { border: none; background: transparent; cursor: pointer; color: var(--dim); font-size: 15px; padding: 2px 4px; border-radius: 6px; } .star:hover { background: var(--line2); color: var(--ink); } .star.on { color: #ffd23d; } /* search box: engine icon (click = pick engine) + a wide typing area */ @@ -258,24 +261,26 @@ } function setReg(d) { const r = $("reg"); - if (!d || d.kind === "home" || d.kind === "resolving") { r.hidden = true; r.innerHTML = ""; return; } + if (!d || d.kind === "home") { r.hidden = true; r.innerHTML = ""; return; } + // Keep chips visible during "resolving" so the switch feels like a toggle, + // not a disappear-and-reappear (user complaint 2026-08-02). + if (d.kind === "resolving") { r.hidden = false; return; } r.hidden = false; - r.className = "reg-wrap"; // container; individual chips carry their own classes - // Two chips when this host is a collision candidate — could be BCDN OR ICANN. - // The active one is highlighted; the other is clickable to switch. + // Two chips (toggle) when this host is a collision candidate — could be + // BCDN OR ICANN. Active one is coloured; inactive is greyed + clickable. const isCand = !!d.tld && (d.kind === "ok" || d.kind === "web") && d.bcnrNativeTld === false; const active = d.kind === "ok" ? "bcdn" : d.kind === "web" ? "icann" : null; - const bcdn = `BCDN`; - const icann = `ICANN`; if (isCand) { + const bcdn = `BCDN`; + const icann = `ICANN`; r.innerHTML = bcdn + icann; for (const chip of r.querySelectorAll(".reg.switch")) { chip.onclick = () => T.collisionSwitch({ choice: chip.dataset.c, remember: "no" }); } } else if (d.kind === "web") { - r.innerHTML = `ICANN`; + r.innerHTML = `ICANN`; } else { - r.innerHTML = `BCDN`; + r.innerHTML = `BCDN`; } } diff --git a/collision.html b/collision.html index dccc73e..c6d9051 100644 --- a/collision.html +++ b/collision.html @@ -7,104 +7,158 @@ -

exists in two registries

-
Choose which one to open. You can change this later in Settings.
+
+
+

exists in two registries

+
Choose which one to open. You can change this later in Settings.
+
-
-
-
- - BCNR / BCDN +
+
+
+ + BCNR / BCDN +
+
On-chain registration. Owned by the holder of a digital name certificate. The registry served by the blockchain root.
-
On-chain registration. Owned by the holder of a digital name certificate. The registry served by the blockchain root.
-
-
-
- 🌐 - ICANN / IANA +
+
+ 🌐 + ICANN / IANA +
+
DNS service coordinated by the ICANN. The registry served by the incumbent root.
-
DNS service coordinated by the ICANN. The registry served by the incumbent root.
-
-
- Remember this choice -
-
-
-
+
+ Remember this choice +
+
+
+
-
- - -
+
+ + +
+