Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion apps/desktop/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* code signing, blocked by Squirrel.Mac), multi-window, native menus.
*/

import { app, BrowserWindow, dialog, shell } from 'electron'
import { app, BrowserWindow, dialog, shell, Menu } from 'electron'
import { spawn, spawnSync, type ChildProcess } from 'node:child_process'
import { mkdir, readFile, watch } from 'node:fs/promises'
import { fileURLToPath } from 'node:url'
Expand Down Expand Up @@ -285,6 +285,17 @@ app.whenReady().then(async () => {
// + respawn UTA without restarting Alice (mirrors prod.mjs). ────────────
void startFlagWatcher(homeEnv.OPENALICE_HOME, utaUrl, spawnUTA)

// No in-window menu bar on Windows/Linux — Electron's default
// File/Edit/View/Window/Help renders *inside* the window there and is
// meaningless for a single-window web-UI app (it never shows on macOS,
// where menus live in the system bar). macOS keeps a minimal menu so the
// app menu + copy/paste/select-all accelerators still work.
Menu.setApplicationMenu(
process.platform === 'darwin'
? Menu.buildFromTemplate([{ role: 'appMenu' }, { role: 'editMenu' }, { role: 'windowMenu' }])
: null,
)

const win = new BrowserWindow({
width: 1280,
height: 800,
Expand Down
11 changes: 10 additions & 1 deletion src/workspaces/workspace-creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,19 @@ export class WorkspaceCreator {
exitCode: result.exitCode,
stderr: result.stderr.slice(0, 4000),
});
// Surface the actual reason in the message, not just the exit code —
// a null exit code (spawn failure: bash-not-found on Windows, timeout)
// rendered as "code unknown" tells the user nothing, while result.stderr
// already carries the why (e.g. the Git-for-Windows install hint).
const reason = result.stderr.trim();
const headline =
result.exitCode === null
? 'bootstrap could not start'
: `bootstrap script exited with code ${result.exitCode}`;
return {
ok: false,
code: 'bootstrap_failed',
message: `bootstrap script exited with code ${result.exitCode ?? 'unknown'}`,
message: reason ? `${headline}:\n${reason.slice(-500)}` : headline,
stderr: result.stderr,
...(result.exitCode !== null ? { exitCode: result.exitCode } : {}),
};
Expand Down
Loading