CodeNomad/packages/electron-app
Pascal André 46208ad902
fix(settings): adopt a live window for Preferences startup state and spin the Stats refresh (#1050)
Native Preferences showed "The CodeNomad window that opened Preferences is no longer available" with disabled startup controls whenever its opener was unknown (Preferences restored at launch) or closed, even with CodeNomad windows open. Startup state (restore previous state, saved snapshot, Clear) is each window's own, so the host now adopts the most recently used local window as the opener in that case: Electron through PreferencesWindowRegistry.adoptOpener (startupStateTargetId), Tauri through set_opener (startup_state_target). The epoch rotates on adoption, so a change prepared for another window degrades to a read of the adopted one before any write. The warning and its string in all ten locales are removed; the card re-reads up to three times while the adopted window starts and stays disabled only when no local window can answer. Code contracts, AGENTS.md and the public help in all ten locales describe the opener, otherwise the most recently used window.

Stats' text Refresh button becomes the shared icon button sized like the period select, keeping its localized accessible name and tooltip; the icon spins while a read runs.

Validation: Electron unit tests for live/closed/unknown openers, adoption, epoch rotation and fenced changes; Tauri unit test for adoption and fencing; preferences-startup-state (Electron and Tauri hosts), other-profiles and service-usage browser tests; UI and Electron typechecks; help test; rustfmt check. Independent review: the first pass found that startup state is per window and that the fence no longer followed the target; the adoption fix was re-reviewed and approved, with two trivial notes applied.
2026-10-20 23:34:52 +02:00
..
electron fix(settings): adopt a live window for Preferences startup state and spin the Stats refresh (#1050) 2026-10-20 23:34:52 +02:00
scripts feat(tauri): signed cross-platform updates with stable and preview feeds (#786) 2026-10-14 12:18:36 +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 chore(release): prepare CodeNomad 1.0.0 versions (#1045) 2026-10-20 20:36:44 +02: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.