Show the engine setup until the browser engine is installed

A browser tab shows the download size, Download the engine, Install from
file, and Open in default browser until the engine can start. It shows
progress, Cancel, the cause of a failure, and Retry, and then opens the
page. Settings -> Browser shows the engine state and Remove engine. Web
links open in the system browser until the engine is installed. Open
link in app browser always opens a browser tab.
This commit is contained in:
Knotty Wyvern
2026-10-29 01:18:21 -07:00
parent 6004e126f7
commit c06d48f250
19 changed files with 425 additions and 107 deletions
+4 -1
View File
@@ -96,7 +96,8 @@ export async function chooseView(scope, name) {
* `test` is also `window.__TEST__`: `{ state, calls, emit(event, payload), label, workspace(options), settings(section), writeSettings(section, value) }`.
* A command without a handler throws "Unhandled IPC", or returns null when `strict` is false.
*
* Default handlers serve the settings file (`settings_*`) and tab transfers (`tab_transfer_*`). `commands` can replace them.
* Default handlers serve the settings file (`settings_*`), tab transfers (`tab_transfer_*`), and an installed browser engine
* (`browser_engine_status`). `commands` can replace them.
* All pages of one browser context share their state: the settings file and the offers are in localStorage under
* test keys, and a BroadcastChannel sends `settings-changed` to every page and `tab-transfer-accepted` to the source page.
* Without a settings file, the app migrates the old localStorage keys, so a test can seed preferences there before the first load.
@@ -219,6 +220,8 @@ function installMock(options, commands) {
const saveOffers = list => localStorage.setItem(TRANSFERS, JSON.stringify(list));
const expired = "This tab transfer expired. Drag the tab again.";
const defaults = {
// src-tauri/src/browser_engine.rs. Tests of the engine setup replace it.
browser_engine_status: () => ({ state: "installed", version: "0.1.8", bytes: 160612374, received: 0, error: null }),
settings_read: () => snapshot(),
settings_migrate: ({ sections }) => {
if (!settingsFile()) localStorage.setItem(SETTINGS_FILE, JSON.stringify({ schema: 1, revision: 1, ...sections }));