Repository navigation
Enable automatic desktop main, preload and runtime reloads in development - #50
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
CLI build options and wiring scripts/cli-build-options.ts, scripts/build-cli.ts, apps/cli/package.json, apps/desktop/tsconfig.main.json |
Shared esbuild options define the CLI entry points and output settings. The CLI build script uses these options, and the desktop TypeScript configuration includes them. |
Build readiness and Electron lifecycle apps/desktop/scripts/dev-reload.ts, apps/desktop/scripts/dev.ts, apps/desktop/src/main/index.ts |
The development supervisor starts the renderer and watches main, preload, runtime, and selected content changes. It gates serialized restarts on build readiness and requests normal Electron shutdown through IPC. Development-only main-process handlers respond to supervisor messages, disconnects, and termination signals. |
Development workflow tests and documentation tests/boundary/desktop-dev-reload.test.ts, tests/e2e/desktop-dev.pw.ts, playwright.dev.config.ts, package.json, README.md, docs/engineering/fast-development.md |
Tests cover build readiness, reloads, build failures, Electron exits, and shutdown. The Playwright configuration and package script run the end-to-end tests. The documentation describes the development workflow, profile, overrides, and test commands. |
Priority:
Estimated code review effort: 4 (Complex) | ~60 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant Developer
participant DesktopDevSupervisor
participant Vite
participant esbuild
participant DesktopDevReload
participant Electron
Developer->>DesktopDevSupervisor: Start desktop development
DesktopDevSupervisor->>Vite: Start renderer server
DesktopDevSupervisor->>esbuild: Start main, preload, and runtime builds
esbuild-->>DesktopDevReload: Report build readiness
DesktopDevReload->>DesktopDevSupervisor: Request restart when surfaces are ready
DesktopDevSupervisor->>Electron: Launch with renderer URL
Developer->>esbuild: Edit watched build source
esbuild-->>DesktopDevReload: Report build status
DesktopDevReload->>DesktopDevSupervisor: Request serialized restart
DesktopDevSupervisor->>Electron: Request normal quit over IPC
Electron-->>DesktopDevSupervisor: Exit
DesktopDevSupervisor->>Electron: Launch updated app
Merge Risk: 
Minimal · up to 1f03a
-
The change adds a development-only reload supervisor, shared CLI build options, tests and documentation. Nothing in the supplied evidence shows a concrete failure that should block merging, and packaged apps do not register the dev control channel.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description clearly explains the outcome, scope, implementation behavior, validation coverage, platform limits, and development workflow. It does not use the template headings or list exact commands and results, and it omits explicit risk and rollback details, but it is sufficiently complete and relevant.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 8 files. (5 skipped: 5 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Desktop development built Electron and the agent once, so runtime/main/preload edits required restarting the command.
nub run desktop:devnow serves the UI with Vite HMR and uses Vite/esbuild watch APIs for incremental main, preload and both CLI runtime entries. Shared workspace imports are watched by the bundlers; skill/character Markdown and JSON edits also request reloads. CLI release builds and dev watch share the same build options.Successful builds coalesce into a serialized Electron restart. Private dev-only IPC asks Electron to quit through its existing runtime/data shutdown path and waits for process exit before replacement. Invalid builds preserve the current app; a nonzero Electron exit keeps watching for a fix. Startup cancellation closes late-created watchers, and terminal signals are handled without bypassing normal runtime shutdown. Main/runtime reloads stop active dev runs. UI-only edits retain the running app.
The default persistent dev profile lives in
var/desktop-dev/profile; an explicit--user-data-dirandDOOLITTLE_DEV_PORTremain available. No packaging or reinstall is part of the editing loop. Packaged applications do not enable the dev control channel.Validation: 4 focused reload-coordinator tests; 3 real Electron dev journeys (DOM CSS HMR, main/preload/shared/runtime reloads, old runtime exit, syntax-error and Electron-crash recovery, Ctrl+C during startup and ready state, watcher/server cleanup); desktop/tooling type checks; normal CLI build and built CLI help; formatting, dependency ownership, plugin boundaries, local links and unused-dependency checks. Native dev acceptance ran on macOS using isolated offline profiles. Its POSIX process-ownership probe explicitly skips Windows and the source-editing journey is opt-in via
test:dev:desktop. No local release packaging/reinstall cycle was needed.PR validation, Linux native/packaged acceptance and CodeQL all passed. Merged as 02b3e61; main is clean and pushed, with the same source tree as the tested feature head.