Add --connect-server <URL|saved-server-name-or-id> and the inline form to Electron and Tauri. Desktop launches can now open a remote CodeNomad window directly, without leaving an empty local window behind. Existing instances receive the launch intent; explicit folder and new-window arguments retain their normal behavior. Reuse the UI connection flow, including saved credentials, certificate checks and sign-in. Reject credentials and pairing fragments in command line URLs. Resolve saved entries by id, name and URL, with translated errors for missing, unknown or ambiguous values. Windows Tauri refuses arguments containing its forwarding delimiter rather than guessing their boundaries; the help describes this limit in all ten locales. Connect-only startup uses a hidden helper excluded from user-window capacity, restoration, last-window decisions and state flushing. Success disposes it; errors, timeouts or interactive prompts fall back to normal startup without losing saved windows or the deferred Preferences restore. Electron waits for the initial remote page load before reporting success. Helpers close without a renderer flush; ordinary windows keep their state-preservation safeguards. Validation: Electron native suite (319 pass, 4 skipped), Tauri tests (302 pass), UI connection tests, typecheck and help checks. Live isolated Electron runs cover cold success, unreachable and unknown servers, page failure, second-instance forwarding, Preferences restoration and backend startup failure. Four review rounds resolved all P0-P3 findings; the final head passed the complete CI, including all desktop builds. Closes #1234 |
||
|---|---|---|
| .. | ||
| electron | ||
| scripts | ||
| .gitignore | ||
| electron.vite.config.ts | ||
| NOTIFICATION_BADGES.md | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
CodeNomad App
This package contains the native desktop application shell for CodeNomad, built with Electron.
Overview
The Electron app wraps the CodeNomad UI and Server into a standalone executable. It provides deeper system integration, such as:
- Native window management
- Global keyboard shortcuts
- Application menu integration
Each channel/config profile runs one native singleton process and one backend. A second launch opens another UUID-backed window by default; Advanced settings can restore most-recent-window focus, while --new-window always requests another window. Stable, dev, and non-default config profiles keep native/browser/client state isolated. OpenCode sessions/messages remain shared, while tabs, drafts, and views belong to each window.
Restore state uses a V3 per-window envelope over the V2 content-addressed partition graph, with atomic publication/migration, ownership-fenced writes, and post-commit conservative garbage collection.
Development
To run the Electron app in development mode:
npm run dev
This will start the renderer (UI) and the main process with hot reloading.
Building
To build the application for your current platform:
npm run build
To build for specific platforms (requires appropriate build tools):
- macOS:
npm run build:mac - Windows:
npm run build:win - Linux:
npm run build:linux
Structure
electron/main: Main process code (window creation, IPC).electron/preload: Preload scripts for secure bridge between main and renderer.electron/resources: Static assets like icons.