From 0484d97dfbc3b8a2e7878d3ab35a9895decdf467 Mon Sep 17 00:00:00 2001 From: bndw Date: Sat, 28 Feb 2026 21:35:39 -0800 Subject: feat: **1 — `git.ts`:** Add exported `getCurrentBranch` helpe… (+8 more) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ✅ **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 --- src/main/index.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/main/index.ts') 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 @@ -import { app, BrowserWindow, Menu } from "electron"; +import { app, BrowserWindow, Menu, ipcMain } from "electron"; import path from "node:path"; import { getDb, closeDb } from "./db"; import { registerIpcHandlers } from "./ipc/handlers"; @@ -23,6 +23,18 @@ function createWindow() { registerIpcHandlers(mainWindow); + // Maximize toggle — works identically on Linux and macOS + ipcMain.handle("window:toggleMaximize", () => { + if (mainWindow!.isMaximized()) mainWindow!.unmaximize(); + else mainWindow!.maximize(); + }); + + // Push state to renderer so the button glyph stays accurate. + // On macOS, clicking the green traffic light also fires these events, + // keeping our custom button in sync with the native control. + mainWindow.on("maximize", () => mainWindow!.webContents.send("window:maximized", true)); + mainWindow.on("unmaximize", () => mainWindow!.webContents.send("window:maximized", false)); + if (isDev) { const url = process.env.VITE_DEV_SERVER_URL ?? "http://localhost:5173"; mainWindow.loadURL(url).finally(() => { -- cgit v1.2.3