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
feat(settings): choose which node-menu rows and header buttons are shown
enes11bae97ae6f2
diff --git a/src/renderer/canvas/Canvas.tsx b/src/renderer/canvas/Canvas.tsxindex 02ea4fb93..4ca18a64a 100644--- a/src/renderer/canvas/Canvas.tsx+++ b/src/renderer/canvas/Canvas.tsx@@ -4257,34 +4257,44 @@ export function Canvas() {)const groupItems = useCallback(- (groupId: string, at?: { x: number; y: number }): MenuItem[] => [- { type: 'label', label: 'Group' },- {- label: 'New terminal',- icon: <IconTerminal />,- onClick: () => addTerminal(at, undefined, groupId)- },- ...agentCreationItems(at, groupId),- { label: 'New sticky note', icon: <IconNote />, onClick: () => addSticky(at, groupId) },- { type: 'separator' },- { type: 'colors', onPick: (c) => setNodesColor([groupId], c) },- { type: 'separator' },- ...(groupHasWorktree(groupId)- ? []- : [- {- label: 'Bind to worktree…',- icon: <IconBranch />,- // On an SSH project the row stays, greyed, with the reason: the user learns the- // feature exists and why it is off, instead of wondering where it went.- disabled: isSshProject,- hint: isSshProject ? WORKTREE_SSH_HINT : undefined,- onClick: () => openWorktreeDialog(groupId)- } as MenuItem- ]),- { label: 'Ungroup', icon: <IconUngroup />, onClick: () => ungroup(groupId) },- { label: 'Delete (keeps nodes)', icon: <IconTrash />, danger: true, onClick: () => ungroup(groupId) }- ],+ (groupId: string, at?: { x: number; y: number }): MenuItem[] =>+ // The group frame has its own colors strip; it answers to the same "Colors" toggle as the+ // node menu, so hiding it in Settings hides it everywhere a right-click can reach it.+ tidySeparators([+ { type: 'label', label: 'Group' },+ {+ label: 'New terminal',+ icon: <IconTerminal />,+ onClick: () => addTerminal(at, undefined, groupId)+ },+ ...agentCreationItems(at, groupId),+ { label: 'New sticky note', icon: <IconNote />, onClick: () => addSticky(at, groupId) },+ { type: 'separator' },+ ...(isHidden('colors', useSettings.getState().settings.hiddenNodeMenuItems)+ ? []+ : ([{ type: 'colors', onPick: (c) => setNodesColor([groupId], c) }] as MenuItem[])),+ { type: 'separator' },+ ...(groupHasWorktree(groupId)+ ? []+ : [+ {+ label: 'Bind to worktree…',+ icon: <IconBranch />,+ // On an SSH project the row stays, greyed, with the reason: the user learns the+ // feature exists and why it is off, instead of wondering where it went.+ disabled: isSshProject,+ hint: isSshProject ? WORKTREE_SSH_HINT : undefined,+ onClick: () => openWorktreeDialog(groupId)+ } as MenuItem+ ]),+ { label: 'Ungroup', icon: <IconUngroup />, onClick: () => ungroup(groupId) },+ {+ label: 'Delete (keeps nodes)',+ icon: <IconTrash />,+ danger: true,+ onClick: () => ungroup(groupId)+ }+ ]),[setNodesColor,ungroup,diff --git a/src/renderer/components/settings/sections/AppearanceSection.tsx b/src/renderer/components/settings/sections/AppearanceSection.tsxindex 2b6898dfc..b297976f6 100644--- a/src/renderer/components/settings/sections/AppearanceSection.tsx+++ b/src/renderer/components/settings/sections/AppearanceSection.tsx@@ -2,15 +2,74 @@ import { useSettings } from '../../../state/settings'import { NODE_COLORS } from '../../../state/workspace'import { SettingsSection } from '../SettingsSection'import { SearchableRow } from '../SearchableRow'+import { FieldRow } from '../FieldRow'+import { Switch } from '@renderer/ui/Switch'+import {+ HIDEABLE_HEADER_BUTTONS,+ HIDEABLE_MENU_ITEMS,+ isHidden,+ type HideableRow+} from '@renderer/lib/ui-visibility'import { cn } from '@renderer/ui/cn'const ROWS = {- accent: { title: 'Accent', keywords: ['accent', 'color', 'theme', 'appearance'] }+ accent: { title: 'Accent', keywords: ['accent', 'color', 'theme', 'appearance'] },+ menuItems: {+ title: 'Node menu items',+ keywords: ['menu', 'context', 'right click', 'items', 'hide']+ },+ headerButtons: {+ title: 'Terminal header buttons',+ keywords: ['terminal', 'header', 'buttons', 'icons', 'hide']+ }}const ENTRIES = Object.values(ROWS)+/** Settings store what is HIDDEN, the switches say "show" — so showing drops the id and hiding+ * appends it. Filtering first also keeps a hand-edited list free of duplicates. */+function withShown(hidden: readonly string[], id: string, shown: boolean): string[] {+ const next = hidden.filter((h) => h !== id)+ if (!shown) next.push(id)+ return next+}++/** One switch per hideable row, checked when the row is visible. */+function VisibilityToggles({+ rows,+ hidden,+ where,+ onChange+}: {+ rows: readonly HideableRow[]+ hidden: readonly string[]+ /** Completes the aria-label ("Show Duplicate in the node menu") — the label alone is ambiguous+ * once both lists are on screen and a screen reader reads them out of context. */+ where: string+ onChange: (next: string[]) => void+}): React.JSX.Element {+ return (+ <div className="mt-3 space-y-3 border-l border-white/10 pl-4">+ {rows.map((row) => (+ <FieldRow+ key={row.id}+ label={row.label}+ control={+ <Switch+ checked={!isHidden(row.id, hidden)}+ onChange={(shown) => onChange(withShown(hidden, row.id, shown))}+ ariaLabel={`Show ${row.label} ${where}`}+ />+ }+ />+ ))}+ </div>+ )+}+export function AppearanceSection({ isActive }: { isActive: boolean }): React.JSX.Element {const accent = useSettings((s) => s.settings.accent)+ const hiddenNodeMenuItems = useSettings((s) => s.settings.hiddenNodeMenuItems)+ const hiddenHeaderButtons = useSettings((s) => s.settings.hiddenHeaderButtons)const update = useSettings((s) => s.update)return (<SettingsSection@@ -39,6 +98,39 @@ export function AppearanceSection({ isActive }: { isActive: boolean }): React.JS</div></div></SearchableRow>+ {/* One wrapper element per row: the section body puts a divider and its own padding around+ every direct child, so a heading + caption + list must arrive as a single node. */}+ <SearchableRow {...ROWS.menuItems}>+ <div>+ <h4 className="text-sm font-medium text-text">Node menu items</h4>+ <p className="mt-1 text-[13px] leading-relaxed text-muted">+ Which rows the node right-click menu offers — it applies to the next right-click.+ Destructive and recovery actions (Delete, Restart agent) are always shown.+ </p>+ <VisibilityToggles+ rows={HIDEABLE_MENU_ITEMS}+ hidden={hiddenNodeMenuItems}+ where="in the node menu"+ onChange={(next) => update({ hiddenNodeMenuItems: next })}+ />+ </div>+ </SearchableRow>+ <SearchableRow {...ROWS.headerButtons}>+ <div>+ <h4 className="text-sm font-medium text-text">Terminal header buttons</h4>+ <p className="mt-1 text-[13px] leading-relaxed text-muted">+ Which icon buttons the terminal node header shows. Close and the terminal Search+ button are always shown, as are the right-click menu's destructive and recovery+ actions (Delete, Restart agent).+ </p>+ <VisibilityToggles+ rows={HIDEABLE_HEADER_BUTTONS}+ hidden={hiddenHeaderButtons}+ where="in the terminal header"+ onChange={(next) => update({ hiddenHeaderButtons: next })}+ />+ </div>+ </SearchableRow></SettingsSection>)}