CodeNomad/packages/electron-app
Pascal André f90cbbc32e
feat(desktop): connect directly to remote servers from launch arguments (#1240)
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
2026-11-01 01:54:05 +01:00
..
electron feat(desktop): connect directly to remote servers from launch arguments (#1240) 2026-11-01 01:54:05 +01:00
scripts feat(brand): adopt the hexagon CN logo, black or white by palette (#1114) 2026-10-23 19:18:38 +02:00
.gitignore build: bundle node runtime for desktop packages 2026-05-04 20:08:04 +01:00
electron.vite.config.ts feat(opencode): migrate CodeNomad to native V2 (#647) 2026-09-04 11:36:11 +01:00
NOTIFICATION_BADGES.md feat(notifications): mirror unread history on browser and desktop icons 2026-10-07 16:15:13 +02:00
package.json feat(desktop): connect directly to remote servers from launch arguments (#1240) 2026-11-01 01:54:05 +01:00
README.md feat(opencode): migrate CodeNomad to native V2 (#647) 2026-09-04 11:36:11 +01:00
tsconfig.json fix(desktop): bundle CLI resources and request mic access 2026-03-28 15:30:14 +00:00

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.