color gray on the git test files + dock menu
Some checks failed
CI / check (push) Has been cancelled
Some checks failed
CI / check (push) Has been cancelled
This commit is contained in:
@@ -122,7 +122,7 @@ async function openFolderFlow(win: BrowserWindow | null): Promise<boolean> {
|
|||||||
startWatcher()
|
startWatcher()
|
||||||
startConfigWatcher()
|
startConfigWatcher()
|
||||||
startGitWatcher()
|
startGitWatcher()
|
||||||
syncWindowTitle()
|
syncProjectChrome()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,8 +196,17 @@ function buildAppMenu(): Menu {
|
|||||||
/** macOS Dock right-click menu. Sits above the system items (Show All Windows,
|
/** 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
|
* 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. */
|
* 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 {
|
function buildDockMenu(): Menu {
|
||||||
|
const name = getName()
|
||||||
return Menu.buildFromTemplate([
|
return Menu.buildFromTemplate([
|
||||||
|
...(name ? [{ label: name, enabled: false }, { type: 'separator' as const }] : []),
|
||||||
{ label: 'New Window', click: () => spawnInstance() },
|
{ label: 'New Window', click: () => spawnInstance() },
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
@@ -270,7 +279,7 @@ function registerIpc(): void {
|
|||||||
setRoot(path)
|
setRoot(path)
|
||||||
const r = getRoot()
|
const r = getRoot()
|
||||||
if (r) { await resolveConfig(r); startWatcher(); startConfigWatcher(); startGitWatcher() }
|
if (r) { await resolveConfig(r); startWatcher(); startConfigWatcher(); startGitWatcher() }
|
||||||
syncWindowTitle()
|
syncProjectChrome()
|
||||||
broadcast('project:changed')
|
broadcast('project:changed')
|
||||||
return { root: getRoot(), name: getName() }
|
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
|
/** The window title and the Dock menu both carry the open project's folder name
|
||||||
* name when nothing is open). Push it to every window after a project change. */
|
* (the title falls back to the app name when nothing is open). Push both after a
|
||||||
function syncWindowTitle(): void {
|
* project change. */
|
||||||
|
function syncProjectChrome(): void {
|
||||||
const title = getName() || 'Helder'
|
const title = getName() || 'Helder'
|
||||||
for (const w of BrowserWindow.getAllWindows()) w.setTitle(title)
|
for (const w of BrowserWindow.getAllWindows()) w.setTitle(title)
|
||||||
|
app.dock?.setMenu(buildDockMenu())
|
||||||
}
|
}
|
||||||
|
|
||||||
function createWindow(): void {
|
function createWindow(): void {
|
||||||
|
|||||||
@@ -70,6 +70,12 @@ export interface ContextTarget {
|
|||||||
export type OnContext = (e: React.MouseEvent, target: ContextTarget) => void
|
export type OnContext = (e: React.MouseEvent, target: ContextTarget) => void
|
||||||
|
|
||||||
/* ============ Git / Source Control panel ============ */
|
/* ============ 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 }: {
|
function GitRow({ c, activePath, activeSide, ctxPath, kbdId, showDir, onOpen, onContext, onToggleStage }: {
|
||||||
c: Change
|
c: Change
|
||||||
activePath: string | null
|
activePath: string | null
|
||||||
@@ -89,7 +95,7 @@ function GitRow({ c, activePath, activeSide, ctxPath, kbdId, showDir, onOpen, on
|
|||||||
const dirShown = showDir && !!dir
|
const dirShown = showDir && !!dir
|
||||||
const isActive = activePath === c.path && (!activeSide || activeSide === side)
|
const isActive = activePath === c.path && (!activeSide || activeSide === side)
|
||||||
return (
|
return (
|
||||||
<div className={'git-row' + (isActive ? ' active' : '') + (ctxPath === c.path ? ' ctx' : '') + (kbdId === c.id ? ' kbd' : '')}
|
<div className={'git-row' + (isActive ? ' active' : '') + (ctxPath === c.path ? ' ctx' : '') + (kbdId === c.id ? ' kbd' : '') + (isTestFile(c.path) ? ' test' : '')}
|
||||||
data-row-id={c.id}
|
data-row-id={c.id}
|
||||||
onClick={() => onOpen(c.path, { diff: true, side })}
|
onClick={() => onOpen(c.path, { diff: true, side })}
|
||||||
onContextMenu={(e) => onContext(e, { path: c.path, kind: 'git', staged })}
|
onContextMenu={(e) => onContext(e, { path: c.path, kind: 'git', staged })}
|
||||||
|
|||||||
@@ -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 { 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-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; }
|
.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-row.active .git-name { color:var(--fg-0); }
|
||||||
.git-name.del { text-decoration:line-through; color:var(--fg-3); }
|
.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; }
|
.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; }
|
||||||
|
|||||||
Reference in New Issue
Block a user