From c2ba26877fda722ecca601fd87b5eb16a8fab60a Mon Sep 17 00:00:00 2001 From: Local Dev Date: Sun, 2 Aug 2026 15:31:47 +0200 Subject: [PATCH] Theseus: download tracker, search split, discover-more tier, UX polish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bundle of UX + feature work. Split from packaging by intent so the diff is reviewable; the next Theseus rebuild ships it. Features - Download tracker (new): session.on("will-download") → per-item state {id, filename, url, mime, total, received, state, savePath, startedAt} with updated/done event handlers. New downloadsPop WebContentsView loads downloads.html (new file) + downloads-preload.js (new file); panel positioned under a new #downloads toolbar button between search and Tor. Full IPC: downloads-get, toggle/close/resize-downloads, download-open/show/cancel/clear, downloads-clear-all. In-memory only — cross-session persistence is a future addition. Button badge shows active count + spin/done/err color. - Search engines split by kind + tier: * kind: "search" | "llm" — separate headers in picker + settings ("Search with" / "Ask an AI"). Empty sections hidden. * tier: "catalog" | "extra" — Settings now has THREE panes behind the "+ Add search engine" button: curated catalog, wider discoverable bank filtered by a live search input, custom URL form. * DEFAULT_ENABLED unchanged (5 major engines). * Custom user-added engines carry tier="custom" (never in catalog/extra panes). - 9 tier="extra" engines added (all non-login ?q=): Marginalia, Stract, Yep, Presearch, MetaGer, Qwant, Swisscows, Naver, Baidu. Same rot rule as LLMs: if one starts bouncing to a login gate, drop it. Bug fixes - Loadbar collapses to 0px when idle (was reserving a permanent 2px strip below the address bar). .loadbar {height:0} + .loadbar.on {height:2px} + 120ms transition. - Native ` popup theme + +Chromium's native `` popups on Windows now match app theme + because `nativeTheme.themeSource` drives `prefers-color-scheme`. + Fixes light popup on dark app (and vice versa). +- `.ctl` layout flipped to `flex-direction: row` with `flex-wrap: wrap`, + so anti-fingerprint mode select + value input fit side-by-side on wide + rows. +- Files: [settings.html](settings.html). + +### Search catalog + +- `SEARCH_ENGINES` entries gain `kind: "search" | "llm"` and + `tier: "catalog" | "extra"`. `allEngines()` propagates both; custom + user-added engines carry `tier: "custom"`. +- **Two-tier discovery in settings**: catalog panel has "Add from catalog" + (curated first-class disabled built-ins) + "Discover more engines" (wider + `tier:"extra"` bank, filtered by a live search box) + "Or add a custom URL". +- **Removed** from catalog (require sign-in before `?q=` works): ChatGPT, + Claude, You.com. **Kept** as LLM engines: Perplexity, Phind. +- **Removed** SearXNG (federated — `searx.be` is anti-bot-locked and every + single-instance default rots as instances rate-limit / die). Users who + want it add their preferred instance via the custom URL form. +- **Added** as `tier:"extra"`: Marginalia, Stract, Yep, Presearch, MetaGer, + Qwant, Swisscows, Naver, Baidu. All non-login `?q=` URLs. Same rot rule + as LLMs: if one starts bouncing to a login gate, drop it. +- Files: [main.js](main.js). + +### Search picker + +- [engine-picker.html](engine-picker.html) renders two headed groups: + "Search with" / "Ask an AI". Empty sections hidden. +- [settings.html](settings.html) default-engine ` + +
Or add a custom URL
- +
@@ -366,20 +374,41 @@ if (!rows) return ""; return `
${label}
${rows}`; }).join(""); - // Catalog = built-in engines the user has NOT enabled, ready to add. + // Two catalog panes, split by tier: + // catalog — curated first-class built-ins the user hasn't enabled + // extra — wider bank, filtered live by the "Discover more" search box const cat = document.getElementById("catalogList"); + const extra = document.getElementById("extraList"); + const filterInput = document.getElementById("engineFilter"); + const catRow = (e) => `
` + + `${engIcon(e)}` + + `${esc(e.name)}` + + `${(e.kind || "search") === "llm" ? "AI" : "Search"}` + + `
`; + const off = d.engines.filter((e) => e.builtin && !e.enabled); + const catalogOff = off.filter((e) => (e.tier || "catalog") === "catalog"); + const extraOff = off.filter((e) => e.tier === "extra"); if (cat) { - const off = d.engines.filter((e) => e.builtin && !e.enabled); - const catRow = (e) => `
` + - `${engIcon(e)}` + - `${esc(e.name)}` + - `${(e.kind || "search") === "llm" ? "AI" : "Search"}` + - `
`; - cat.innerHTML = off.length - ? off.map(catRow).join("") - : `
All built-in engines are enabled. Add a custom URL below.
`; + cat.innerHTML = catalogOff.length + ? catalogOff.map(catRow).join("") + : `
All curated engines are enabled. Discover more below or add a custom URL.
`; cat.querySelectorAll(".add").forEach((b) => b.onclick = () => C.setEngineEnabled(b.dataset.add, true).then(renderEngines)); } + if (extra) { + const paintExtras = (q) => { + const filt = String(q || "").trim().toLowerCase(); + const shown = filt ? extraOff.filter((e) => e.name.toLowerCase().includes(filt)) : extraOff; + extra.innerHTML = shown.length + ? shown.map(catRow).join("") + : `
${filt ? "No engines match that filter." : "All discoverable engines are enabled."}
`; + extra.querySelectorAll(".add").forEach((b) => b.onclick = () => C.setEngineEnabled(b.dataset.add, true).then(renderEngines)); + }; + paintExtras(filterInput ? filterInput.value : ""); + if (filterInput && !filterInput.dataset.wired) { + filterInput.dataset.wired = "1"; + filterInput.addEventListener("input", () => paintExtras(filterInput.value)); + } + } list.querySelectorAll('input[type="checkbox"]').forEach((cb) => cb.onchange = () => C.setEngineEnabled(cb.dataset.id, cb.checked).then(renderEngines)); list.querySelectorAll(".cx").forEach((b) => b.onclick = () => C.removeEngine(b.dataset.id).then(renderEngines)); // drag-and-drop reorder — same-kind only (dropping a Search engine into