From 1b212e2fb62bb34371372ebf0f96583ac1f4235b Mon Sep 17 00:00:00 2001 From: Jonathan van Rij Date: Mon, 17 Aug 2026 11:21:52 +0200 Subject: [PATCH] color gray on the git test files + dock menu --- src/main/index.ts | 21 ++++++++++++++++----- src/renderer/src/components.tsx | 8 +++++++- src/renderer/src/styles.css | 2 ++ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/main/index.ts b/src/main/index.ts index 80bb18c..2c4511c 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -122,7 +122,7 @@ async function openFolderFlow(win: BrowserWindow | null): Promise { startWatcher() startConfigWatcher() startGitWatcher() - syncWindowTitle() + syncProjectChrome() return true } @@ -196,8 +196,17 @@ function buildAppMenu(): Menu { /** macOS Dock right-click menu. Sits above the system items (Show All Windows, * Hide, Quit) that macOS appends itself. It mirrors File → New Window so a new * project window is one right-click away, even with no window focused. */ +/** + * macOS reads the Dock tile's name from the bundle's CFBundleName at launch, so + * every Helder process shows the same "Helder" tooltip — `app.setName()` moves + * the menu-bar name and the paths, but never the Dock label. The open project is + * therefore named in the Dock *menu* instead: a disabled first item, so a + * right-click tells the two tiles apart. + */ function buildDockMenu(): Menu { + const name = getName() return Menu.buildFromTemplate([ + ...(name ? [{ label: name, enabled: false }, { type: 'separator' as const }] : []), { label: 'New Window', click: () => spawnInstance() }, ]) } @@ -270,7 +279,7 @@ function registerIpc(): void { setRoot(path) const r = getRoot() if (r) { await resolveConfig(r); startWatcher(); startConfigWatcher(); startGitWatcher() } - syncWindowTitle() + syncProjectChrome() broadcast('project:changed') return { root: getRoot(), name: getName() } }) @@ -338,11 +347,13 @@ function registerIpc(): void { }) } -/** The window title is the open project's folder name (falling back to the app - * name when nothing is open). Push it to every window after a project change. */ -function syncWindowTitle(): void { +/** The window title and the Dock menu both carry the open project's folder name + * (the title falls back to the app name when nothing is open). Push both after a + * project change. */ +function syncProjectChrome(): void { const title = getName() || 'Helder' for (const w of BrowserWindow.getAllWindows()) w.setTitle(title) + app.dock?.setMenu(buildDockMenu()) } function createWindow(): void { diff --git a/src/renderer/src/components.tsx b/src/renderer/src/components.tsx index de72956..b13bded 100644 --- a/src/renderer/src/components.tsx +++ b/src/renderer/src/components.tsx @@ -70,6 +70,12 @@ export interface ContextTarget { export type OnContext = (e: React.MouseEvent, target: ContextTarget) => void /* ============ Git / Source Control panel ============ */ + +/** True for files under the project root's `tests/` folder. The git list dims these. */ +function isTestFile(path: string): boolean { + return path.startsWith('tests/') +} + function GitRow({ c, activePath, activeSide, ctxPath, kbdId, showDir, onOpen, onContext, onToggleStage }: { c: Change activePath: string | null @@ -89,7 +95,7 @@ function GitRow({ c, activePath, activeSide, ctxPath, kbdId, showDir, onOpen, on const dirShown = showDir && !!dir const isActive = activePath === c.path && (!activeSide || activeSide === side) return ( -
onOpen(c.path, { diff: true, side })} onContextMenu={(e) => onContext(e, { path: c.path, kind: 'git', staged })} diff --git a/src/renderer/src/styles.css b/src/renderer/src/styles.css index 6a29f76..606089c 100644 --- a/src/renderer/src/styles.css +++ b/src/renderer/src/styles.css @@ -196,6 +196,8 @@ kbd { flex:0 0 auto; font-family:var(--mono); font-size:11.5px; color:var(--fg-3 .git-stat { width:13px; text-align:center; font-family:var(--mono); font-size:11px; font-weight:600; flex:0 0 13px; } .git-stat.M{color:var(--mod);} .git-stat.A{color:var(--add);} .git-stat.D{color:var(--del);} .git-stat.R{color:var(--ren);} .git-stat.U{color:var(--add);} .git-name { font-size:12.5px; color:var(--fg-1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } +/* Files in the root `tests/` folder stay a step greyer, so real source changes read first. Git list only. */ +.git-row.test .git-name { color:var(--fg-3); } .git-row.active .git-name { color:var(--fg-0); } .git-name.del { text-decoration:line-through; color:var(--fg-3); } .git-dir { color:var(--fg-3); font-size:11px; margin-left:auto; padding-left:8px; white-space:nowrap; max-width:42%; overflow:hidden; text-overflow:ellipsis; direction:rtl; }