Conversation
…ead of relaunching into a blank window Both IPC handlers ended in app.relaunch() + app.exit(0). Packaged, that is the clean re-bind. Under `npm run dev` the renderer is served by electron-vite's dev server, which lives in the wrapper that watches this Electron and exits with it — so the relaunched Electron started against a dead dev server and came up with a BLANK window the developer had to hunt down and kill before running `npm run dev` again (every hive create/switch in dev). - relaunch.ts: relaunchPlan(env) → 'exit' when ELECTRON_RENDERER_URL is set (electron-vite's dev marker, the one the window loader already keys on), 'relaunch' otherwise; devExitNotice(reason) is the console line that replaces the blank window. - index.ts: relaunchOrExit(reason) is the single place that relaunches; changeHome and reset go through it. Packaged behaviour is unchanged. Test: the plan for packaged / empty marker / dev; the notice; and a text pin that both handlers use the helper and app.relaunch() appears only inside it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…esign, OpenWolf transient), PRs chaitanyagiri#512 aviso a remitente con destinatario archivado y chaitanyagiri#513 exit en dev, 6 fixes integrados (891/891), boot real 11:50 OK - Agente Claude-IMPLEMENTADOR - TESTED Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WmYD63qADnKFKjpU1Ar3TF
Self-review (CONTRIBUTING: run your agent over your PR). stderr is asynchronous on pipes and on Windows TTYs, and app.exit() does not wait for it, so the console line that replaces the blank window could be lost. It is now written with a callback that exits once it is out. Packaged branch unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Agent review of this PR (CONTRIBUTING: "run your coding agent over your own PR, and paste what it found"). Claude Code went over
Verified after the fix: typecheck clean, the test file 3/3, local suite 837/837. |
90bf29f to
02b8d20
Compare
|
Housekeeping, no code change: I force-pushed this branch to reword the commit messages (an internal session trailer was dropped; |
What & why
changeHome(Settings → change harness home, also the onboarding "create a hive" path) andresetAllboth end inapp.relaunch()+app.exit(0). Packaged, that is the clean re-bind. Undernpm run devthe renderer is served by electron-vite's dev server, which lives in the wrapper process that watches this Electron and exits with it — so the relaunched Electron started against a dead dev server and came up with a blank window that the developer had to hunt down and kill before runningnpm run devagain. It happens on every hive create/switch in dev.relaunch.tsdecides the plan:'exit'whenELECTRON_RENDERER_URLis set (electron-vite's dev marker, the one the window loader already keys on),'relaunch'otherwise.index.tshas onerelaunchOrExit(reason)that both handlers go through; in dev it prints a console line saying why and what to run, and exits cleanly. Packaged behaviour is unchanged.Type of change
Evidence
Before
On main both handlers call
app.relaunch()unconditionally; the sequence that ends in the blank window is spelled out in the capture, and the new test has nothing to load.After
With the fix: the plan is
exitunderELECTRON_RENDERER_URL, the console line names the trigger and says to runnpm run devagain, and the text pin confirms both handlers use the helper andapp.relaunch()appears only inside it.How I tested it
main@ 417d8denode --test test/dev-relaunch-exit.test.cjs→ fails onmain(norelaunch.ts, no helper), 3/3 pass with the fix.ELECTRON_RENDERER_URL=http://localhost:5173 node -e '…relaunchPlan()…'printsexitand the notice (in the After capture).npm run typecheckclean;npm run test:focused837/837.Credit (optional)
Discord:
X:
Checklist
npm run typecheckpasses.npm run test:focusedpasses.npm run buildsucceeds.DESIGN.md/tokens.ts— no ad-hoc colors, spacing, or fonts. (no UI)ATTRIBUTION.md. (no art)🤖 Generated with Claude Code