git:20260704.83c64f6 to git:20260712.8bdcf28
2 added, 2 removed. Audit A to A.
# DOX — packages/electron/src
Files in this directory. One row per source file.
| File | Purpose |
|------|---------|
- | `main.ts` | Electron main: 5-state startup machine (`checking-server-health` → `attach` \| `launch-server` → `health-wait` → `done` \| `loading-page-error`). No first-run wizard; launch unconditional. See change: auto-launch-first-run-skip-welcome. First-run marker `~/.pi/dashboard/first-run-done` written on first `done` (backwards-compat; Doctor/tooling read it). `registerBundledBridgeExtension()` runs unconditionally before launch-server (formerly gated behind wizard arm). **External-link hardening** (change: harden-external-link-handling, #13): `createMainWindow` registers `webContents.setWindowOpenHandler` + `will-navigate` BEFORE `loadURL` so `target="_blank"` / `window.open` + bare-`<a>` external nav route through `shell.openExternal` (system browser) instead of replacing dashboard. `will-navigate` **OAuth-aware** via `decideWillNavigate(serverUrl, webContents.getURL(), url)` (change: fix-oauth-blocked-by-external-link-guard) — trap-guard fires only when leaving dashboard, so mid-login provider-internal nav + callback redirect land cleanly. See change: electron-server-launch-controls — loadFile(loading.html) replaces inline data:text/html. mainWindow attaches preload exposing piDashboard. Registers ipcMain handlers `dashboard:request-launch`, `dashboard:open-doctor`, `dashboard:read-server-log`. Forwards `dashboard:launch-status` push events. Tray hooks pass `requestServerLaunch` + `isManagedServerRunning`. Startup reads `dashboard-settings.json` before selectLaunchSource; remote mode attaches remoteUrl directly. See change: docker-packaging. |
- | `preload.ts` | Exposes `piDashboard` namespace (`requestLaunch`, `openDoctor`, `readServerLog`, `onStatus`) + side-effect imports `doctor-preload` (`window.electron.doctor`) and `remote-connect-preload` (`window.remoteConnect`). `wizardApi` removed with the wizard. See change: auto-launch-first-run-skip-welcome, electron-server-launch-controls. |
+ | `main.ts` | Electron main: 5-state startup machine (`checking-server-health` → `attach` \| `launch-server` → `health-wait` → `done` \| `loading-page-error`). No first-run wizard; launch unconditional. See change: auto-launch-first-run-skip-welcome. First-run marker `~/.pi/dashboard/first-run-done` written on first `done` (backwards-compat; Doctor/tooling read it). `registerBundledBridgeExtension()` runs unconditionally before launch-server (formerly gated behind wizard arm). **External-link hardening** (change: harden-external-link-handling, #13): `createMainWindow` registers `webContents.setWindowOpenHandler` + `will-navigate` BEFORE `loadURL` so `target="_blank"` / `window.open` + bare-`<a>` external nav route through `shell.openExternal` (system browser) instead of replacing dashboard. `will-navigate` **OAuth-aware** via `decideWillNavigate(serverUrl, webContents.getURL(), url)` (change: fix-oauth-blocked-by-external-link-guard) — trap-guard fires only when leaving dashboard, so mid-login provider-internal nav + callback redirect land cleanly. See change: electron-server-launch-controls — loadFile(loading.html) replaces inline data:text/html. mainWindow attaches preload exposing piDashboard. Registers ipcMain handlers `dashboard:request-launch`, `dashboard:open-doctor`, `dashboard:read-server-log`, `dashboard:probe-server` (change: fix-remote-connect-cors-gates — normalizes URL then `probeRemote`; backs the loading page's main-process reachability check for remote attach, sending no browser Origin so it's not CORS-bound). Forwards `dashboard:launch-status` push events. Tray hooks pass `requestServerLaunch` + `isManagedServerRunning`. Startup reads `dashboard-settings.json` before selectLaunchSource; remote mode attaches remoteUrl directly. See change: docker-packaging. |
+ | `preload.ts` | Exposes `piDashboard` namespace (`requestLaunch`, `openDoctor`, `readServerLog`, `onStatus`, `probeServer(url)` — change: fix-remote-connect-cors-gates, main-process reachability probe used by `loading.html` to attach to a remote whose CORS refuses the page's `null` origin) + side-effect imports `doctor-preload` (`window.electron.doctor`) and `remote-connect-preload` (`window.remoteConnect`). `wizardApi` removed with the wizard. See change: auto-launch-first-run-skip-welcome, electron-server-launch-controls. |