aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/index.ts
diff options
context:
space:
mode:
authorbndw <ben@bdw.to>2026-02-28 21:35:39 -0800
committerbndw <ben@bdw.to>2026-02-28 21:35:39 -0800
commit0484d97dfbc3b8a2e7878d3ab35a9895decdf467 (patch)
treecdc6fffe8b169c83058e8d64ca42723f6ccb6dcf /src/main/index.ts
parent04c63d4ef601876186e5d7fab980d76575c494ec (diff)
feat: **1 — `git.ts`:** Add exported `getCurrentBranch` helpe… (+8 more)
- ✅ **1 — `git.ts`:** Add exported `getCurrentBranch` helper after `ensureGitRepo` - ✅ **2a — `ipc/handlers.ts`:** Update git import to include `ensureGitRepo` and `getCurrentBranch` - ✅ **2b — `ipc/handlers.ts`:** Replace `workflow:advance` implement-phase block with branching-toggle logic - ✅ **3 — `GitSettings.tsx`:** Create new settings component with pill toggle - ✅ **4 — `SettingsPage.tsx`:** Add `"git"` section type, import, nav item, content render; fix both unicode glyphs - ✅ **5 — `globals.css`:** Append toggle-row + pill toggle + maximize-btn CSS - ✅ **6 — `index.ts`:** Add `ipcMain` to import; add `window:toggleMaximize` handler + maximize/unmaximize events inside `createWindow()` - ✅ **7 — `preload.ts`:** Add `toggleMaximize` + `onWindowMaximized` to interface and `api` object - ✅ **8 — `Header.tsx`:** Add `isMaximized` state + effect + maximize button in JSX
Diffstat (limited to 'src/main/index.ts')
-rw-r--r--src/main/index.ts14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/index.ts b/src/main/index.ts
index a7bed00..f913ac0 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -1,4 +1,4 @@
1import { app, BrowserWindow, Menu } from "electron"; 1import { app, BrowserWindow, Menu, ipcMain } from "electron";
2import path from "node:path"; 2import path from "node:path";
3import { getDb, closeDb } from "./db"; 3import { getDb, closeDb } from "./db";
4import { registerIpcHandlers } from "./ipc/handlers"; 4import { registerIpcHandlers } from "./ipc/handlers";
@@ -23,6 +23,18 @@ function createWindow() {
23 23
24 registerIpcHandlers(mainWindow); 24 registerIpcHandlers(mainWindow);
25 25
26 // Maximize toggle — works identically on Linux and macOS
27 ipcMain.handle("window:toggleMaximize", () => {
28 if (mainWindow!.isMaximized()) mainWindow!.unmaximize();
29 else mainWindow!.maximize();
30 });
31
32 // Push state to renderer so the button glyph stays accurate.
33 // On macOS, clicking the green traffic light also fires these events,
34 // keeping our custom button in sync with the native control.
35 mainWindow.on("maximize", () => mainWindow!.webContents.send("window:maximized", true));
36 mainWindow.on("unmaximize", () => mainWindow!.webContents.send("window:maximized", false));
37
26 if (isDev) { 38 if (isDev) {
27 const url = process.env.VITE_DEV_SERVER_URL ?? "http://localhost:5173"; 39 const url = process.env.VITE_DEV_SERVER_URL ?? "http://localhost:5173";
28 mainWindow.loadURL(url).finally(() => { 40 mainWindow.loadURL(url).finally(() => {