[object Object]

← back to Desktop Dotbar

dotbar: boot guard uses process.versions.electron (require.main!==module under Electron left the bar windowless) (TK-12225)

c915cfa7ce0d6185689fad14dc22a9b59fbdf564 · 2026-09-25 09:09:47 -0700 · Steve Abrams

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161EawVb2Kb9BdpD5NGbtN3

Files touched

Diff

commit c915cfa7ce0d6185689fad14dc22a9b59fbdf564
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Fri Sep 25 09:09:47 2026 -0700

    dotbar: boot guard uses process.versions.electron (require.main!==module under Electron left the bar windowless) (TK-12225)
    
    Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_0161EawVb2Kb9BdpD5NGbtN3
---
 electron-main.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/electron-main.js b/electron-main.js
index 1877c31..b9289f9 100644
--- a/electron-main.js
+++ b/electron-main.js
@@ -380,9 +380,9 @@ async function createWindows() {
   ipcMain.on('dotbar:quit', () => app.quit());
 }
 
-// Only boot the real Electron app when this file is the entrypoint (electron .) — a test
+// Only boot the real Electron app when running under Electron (require.main is NOT this module there) — a test
 // require()ing this module for its pure helpers (floatingPosFor etc.) must not touch app/screen.
-if (require.main === module) {
+if (process.versions.electron) {                 // run the app under Electron; plain-node tests just require() the helpers
   app.on('window-all-closed', () => app.quit());
   app.on('before-quit', () => { flushCfg(); if (serverProc) try { serverProc.kill(); } catch {} });
   app.whenReady().then(() => {

← 4f3c60e dotbar: floatingPosFor falls back to orphaned display pos on  ·  back to Desktop Dotbar  ·  auto-data-snapshot: 2026-09-25T09:20:47 (3 data files) — .ba b577919 →