Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

fix(scm): render Source Control overflow/branch menus above the drawer

enes1f6dec4af362
diff --git a/src/renderer/components/ContextMenu.tsx b/src/renderer/components/ContextMenu.tsx
index 70daef231..8ed6c1092 100644
--- a/src/renderer/components/ContextMenu.tsx
+++ b/src/renderer/components/ContextMenu.tsx
@@ -20,17 +20,31 @@ interface ContextMenuProps {
y: number
items: MenuItem[]
onClose: () => void
+ /**
+ * Override the base stacking order. The default CSS z-index (46) sits BELOW drawer
+ * overlays (z-index 55), so a ContextMenu opened from inside a drawer (e.g. the Source
+ * Control panel) would render hidden behind it. Pass a value above the host overlay.
+ */
+ zIndex?: number
}
/**
* A right-click menu rendered in a body portal at fixed coordinates, so it is never
* clipped or hidden behind the canvas. Closes on backdrop click.
*/
-export function ContextMenu({ x, y, items, onClose }: ContextMenuProps) {
+export function ContextMenu({ x, y, items, onClose, zIndex }: ContextMenuProps) {
+ // Keep the menu one above its backdrop (matches the default 46/45 CSS ordering).
+ const backdropStyle = zIndex != null ? { zIndex } : undefined
+ const menuStyle = zIndex != null ? { top: y, left: x, zIndex: zIndex + 1 } : { top: y, left: x }
return createPortal(
<>
- <div className="ctx-backdrop" onContextMenu={(e) => e.preventDefault()} onClick={onClose} />
- <div className="ctx-menu" style={{ top: y, left: x }} onClick={(e) => e.stopPropagation()}>
+ <div
+ className="ctx-backdrop"
+ style={backdropStyle}
+ onContextMenu={(e) => e.preventDefault()}
+ onClick={onClose}
+ />
+ <div className="ctx-menu" style={menuStyle} onClick={(e) => e.stopPropagation()}>
{items.map((item, i) => {
if (item.type === 'separator') return <div key={i} className="ctx-sep" />
if (item.type === 'label') return <div key={i} className="ctx-label">{item.label}</div>
diff --git a/src/renderer/components/SourceControlPanel.tsx b/src/renderer/components/SourceControlPanel.tsx
index c308b3b73..4340857e5 100644
--- a/src/renderer/components/SourceControlPanel.tsx
+++ b/src/renderer/components/SourceControlPanel.tsx
@@ -541,6 +541,7 @@ export function SourceControlPanel({
<ContextMenu
x={moreMenu.x}
y={moreMenu.y}
+ zIndex={80}
onClose={() => setMoreMenu(null)}
items={[
{ label: 'Fetch', onClick: () => void act(() => git.fetch(cwd!)) },
@@ -582,6 +583,7 @@ export function SourceControlPanel({
<ContextMenu
x={branchPick.x}
y={branchPick.y}
+ zIndex={80}
onClose={() => setBranchPick(null)}
items={
status.branches