fix(desktop): re-show hidden window on dock/Finder activate + log gate flow

The close handler hides the BrowserWindow instead of destroying it, so
once closed, subsequent dock or Finder activations were no-ops because
the activate handler only created a new window when mainWindow === null.
Show + focus the existing window if it's hidden so relaunch behaves as
expected. Also add console.log breadcrumbs in DesktopLaunchGate so we
can diagnose why the chooser sometimes appears not to render.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-17 22:24:40 -07:00
parent 75a712771e
commit 51e28fb7ca
2 changed files with 17 additions and 1 deletions

View File

@@ -262,7 +262,15 @@ export function run(): void {
if (mainWindow === null) {
const window = createMainWindow();
window.show();
return;
}
// The close handler hides the window instead of destroying it, so a
// subsequent dock/Finder activate must explicitly show + focus it —
// otherwise the app appears to do nothing when relaunched.
if (!mainWindow.isVisible()) {
mainWindow.show();
}
mainWindow.focus();
});
}