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.
TypeScript adhdagent-orchestrationai-agentscanvasclaude-codecodexcoding-agentsdeveloper-toolselectrongeminilinuxmacosmultiplexeropencodeparallel-agentsterminalterminal-emulatorterminal-multiplexertmuxworkspace-manager
fix(scm): branch menus scroll instead of running past the viewport
enes89d67da09ccd
diff --git a/src/renderer/components/ContextMenu.tsx b/src/renderer/components/ContextMenu.tsxindex be72f6825..4e0d6ed66 100644--- a/src/renderer/components/ContextMenu.tsx+++ b/src/renderer/components/ContextMenu.tsx@@ -32,13 +32,20 @@ interface ContextMenuProps {* Control panel) would render hidden behind it. Pass a value above the host overlay.*/zIndex?: number+ /**+ * Cap the menu height and scroll overflow — for data-driven flat lists that can grow+ * unbounded (e.g. the branch pickers: repos easily hold 30+ branches, and a fixed-position+ * menu otherwise runs past the viewport with no way to reach the tail). Only for menus+ * with NO submenu items: `overflow-y: auto` would clip a hover flyout.+ */+ scroll?: boolean}/*** 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, zIndex }: ContextMenuProps) {+export function ContextMenu({ x, y, items, onClose, zIndex, scroll }: ContextMenuProps) {// Keep the menu one above its backdrop (matches the default 46/45 CSS ordering).const backdropStyle = zIndex != null ? { zIndex } : undefinedconst menuStyle = zIndex != null ? { top: y, left: x, zIndex: zIndex + 1 } : { top: y, left: x }@@ -52,7 +59,11 @@ export function ContextMenu({ x, y, items, onClose, zIndex }: ContextMenuProps)onContextMenu={(e) => e.preventDefault()}onClick={onClose}/>- <div className="ctx-menu" style={menuStyle} onClick={(e) => e.stopPropagation()}>+ <div+ className={`ctx-menu${scroll ? ' ctx-menu--scroll' : ''}`}+ 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.tsxindex 17cc3c34d..311124b88 100644--- a/src/renderer/components/SourceControlPanel.tsx+++ b/src/renderer/components/SourceControlPanel.tsx@@ -600,8 +600,10 @@ export function SourceControlPanel({style={{ zIndex: 78 }}onClick={() => setBranchMenu(null)}/>+ {/* --scroll: a repo easily holds 30+ branches, and this fixed-position menu+ otherwise runs past the viewport bottom with no way to reach the tail. */}<div- className="tab-menu"+ className="tab-menu tab-menu--scroll"style={{ top: branchMenu.top, left: branchMenu.left, zIndex: 80 }}>{status.branches.map((b) => (@@ -776,6 +778,7 @@ export function SourceControlPanel({x={branchPick.x}y={branchPick.y}zIndex={80}+ scrollonClose={() => setBranchPick(null)}items={status.branchesdiff --git a/src/renderer/styles.css b/src/renderer/styles.cssindex 2ac1f94ab..695dcaa0d 100644--- a/src/renderer/styles.css+++ b/src/renderer/styles.css@@ -7116,3 +7116,32 @@ body,.kanban-prio-chip {letter-spacing: 0.04em;}++/* Scrollable menu variant for unbounded data-driven lists (the branch pickers): caps the+ fixed-position menu to the viewport and scrolls the tail instead of clipping it. Children+ must not flex-shrink, or the constrained column compresses rows before overflowing. */+.tab-menu--scroll,+.ctx-menu--scroll {+ max-height: min(60vh, 440px);+ overflow-y: auto;+ overscroll-behavior: contain;+}+.tab-menu--scroll > *,+.ctx-menu--scroll > * {+ flex-shrink: 0;+}+.tab-menu--scroll::-webkit-scrollbar,+.ctx-menu--scroll::-webkit-scrollbar {+ width: 8px;+}+.tab-menu--scroll::-webkit-scrollbar-thumb,+.ctx-menu--scroll::-webkit-scrollbar-thumb {+ background: rgba(255, 255, 255, 0.18);+ border-radius: 4px;+ border: 2px solid transparent;+ background-clip: content-box;+}+.tab-menu--scroll::-webkit-scrollbar-track,+.ctx-menu--scroll::-webkit-scrollbar-track {+ background: transparent;+}