theseus/PENDING.md
Local Dev c2ba26877f Theseus: download tracker, search split, discover-more tier, UX polish
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 <select> popup theme sync via :root { color-scheme: dark } +
  @media(prefers-color-scheme: light). nativeTheme.themeSource already
  drives prefers-color-scheme, so the OS popup color follows the app
  theme automatically (fixed light popup on dark app / vice versa).
- .ctl layout flipped to flex-direction: row with flex-wrap so
  anti-fingerprint mode + value fields fit side-by-side.

Settings restructure
- General section: Startup group at the top ("Open previous windows and
  tabs" toggle), then Appearance below with three visual THEME CARDS
  (System / Light / Dark) — small mock-browser previews per theme,
  Firefox-style, active card gets a blue ring. System pipes through to
  nativeTheme.themeSource = "system".
- Search promoted to a top-level sidebar item between General and
  Naming. Search-engine controls moved out of General into Search.
- Search section: enabled list shows only enabled engines, grouped by
  kind, drag-reorder within a kind. "+ Add search engine" opens the
  catalog/extras/custom-URL panel.

Search engine catalog trims (already flagged in prior work)
- Removed ChatGPT / Claude / You.com (login-gated ?q=).
- Removed SearXNG (federated; every single-instance default rots).

Docs
- TheseusNavigator/PENDING.md and GOTCHAS.md born with this work
  (see the HANDOFF.md commit for the convention).
- PENDING.md's own "session: 2026-08-02:theseus-ux-polish" group will be
  emptied after this ship lands.

Preview harness
- _preview.html + _settings-preview.html stubs updated with kind + tier
  + downloads seed + tier="extra" samples so the preview reflects reality.
  Both files are gitignored — local only.

Coordination
- Parallel session's collision-policy work (chrome.html registry chips,
  popover switcher, Naming section, in-tab collision prompt) already
  landed in commits 256079d/42b340f/b0d6375/78dddda. This commit adds
  cleanly on top.
2026-08-02 15:31:47 +02:00

149 lines
6.1 KiB
Markdown

# Pending — uncommitted Theseus changes
Working-tree state that hasn't been committed or shipped. Read this before
touching the same files. Update when you land or add work.
Format: each group has a `session:` label so parallel sessions can see
what belongs to whom and coordinate. Naming convention:
`YYYY-MM-DD:short-slug` for date-bounded work, or `parallel:<theme>` for
work owned by a session that isn't the current one.
Last updated: 2026-08-02.
---
## session: `2026-08-02:theseus-ux-polish`
Owner's focus: Theseus UX polish + downloads. Everything below bundles
into one commit + one Theseus rebuild + redeploy.
### Settings — General
- **Startup group** at the top of `#general` with "Open previous windows
and tabs" toggle (moved up from below).
- **Appearance** replaced with three visual **theme cards**: System / Light
/ Dark. `System` follows `nativeTheme.themeSource = "system"` so it
tracks the OS. Legacy `settings.theme` values outside `{system, light,
dark}` fall back to `system`.
- Files: [settings.html](settings.html), [main.js](main.js) (`applyTheme`
already handles all three values).
### Settings — new Search section
- Sidebar gets a **Search** top-level item between General and Naming.
- Search-engine controls moved OUT of General into this section.
- Only **enabled** engines listed in the main "Additional search engines"
block, grouped by kind (`Search engines` / `AI answer engines`),
drag-reorder within a kind, toggle to disable, ✕ to delete custom.
- **+ Add search engine** button toggles a catalog panel below with
built-in engines the user hasn't enabled (each with `+ Add`) + a "Or add
a custom URL" form.
- Files: [settings.html](settings.html) (nav, section, CSS `.engcat`, JS).
### Settings — dropdown color-scheme + layout
- `:root { color-scheme: dark }` + `@media (prefers-color-scheme: light)`
override. Native `<select>` 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 `<select>` groups options
with `<optgroup>` by kind. Drag-reorder constrained to same-kind (a
cross-kind drop would re-group on next render).
### Chrome / toolbar
- **Loadbar collapses to 0px when idle** (`.loadbar { height: 0 }`,
`.loadbar.on { height: 2px }`, 120ms transition). Previously reserved
a permanent 2px strip below the address bar.
- **Downloads button** (`#downloads`) between the search box and Tor
toggle. Subscribes to `onDownloads` for badge + spin/done/err class.
- Files: [chrome.html](chrome.html).
### Downloads (new feature)
- New files: [downloads.html](downloads.html),
[downloads-preload.js](downloads-preload.js). Both added to
`build.files` in [package.json](package.json).
- `installDownloadTracker()` in main.js hooks
`session.defaultSession.on("will-download", …)`. In-memory list only;
no cross-session persistence.
- IPC surface: `downloads-get`, `toggle-downloads`, `close-downloads`,
`downloads-resize`, `download-open`, `download-show`, `download-cancel`,
`download-clear`, `downloads-clear-all`.
- New `downloadsPop` WebContentsView, positioned via `positionDownloads()`
from `layout()`.
- Preload exposes `getDownloads`, `toggleDownloads`, `onDownloads`.
### Preview harness
- [_preview.html](_preview.html) — `window.DL_ITEMS` seed +
`__toggleDownloads` overlay; stub `window.theseus.getDownloads /
onDownloads / toggleDownloads`; `kind` on stub engines; LLM catalog
trimmed to Perplexity + Phind.
- [_settings-preview.html](_settings-preview.html) — `kind` on stub
engines; LLM catalog trimmed.
---
## session: `parallel:collision-policy`
Owner's focus: BCNR ↔ ICANN name collision handling. Present in the
working tree, not mine. Leave for that session to land or bundle by
explicit ask.
### Chrome + main-process changes
- [main.js](main.js) — big block of new IPC around collision policy +
soft-collision picker + electrum discovery.
- [popover.html](popover.html), [popover-preload.js](popover-preload.js)
— collision switcher on the site-info popover.
- [preload.js](preload.js) — `collisionSwitch` + `collisionState`.
- [settings-preload.js](settings-preload.js) — same.
### Settings
- Entire **Naming** section in [settings.html](settings.html) (BCNR/ICANN
collision policy radio group + remembered choices reset button).
Untouched by my changes.
### New files (untracked in git)
- [collision.html](collision.html), [collision-preload.js](collision-preload.js)
— the soft-collision "Open with…" prompt window (referenced from
`main.js:219`).
---
## Live state
Shipped hashes live at `../site/releases-manifest.json` and
`https://dl.silentmode.st/releases-manifest.json`. On-chain pointer at
`releases.silentmode.bch`. See [GOTCHAS.md](GOTCHAS.md) for the release
gotchas.