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.

feat(settings): add General sections (terminal, shell, behavior, appearance)

enesd01f0546cc23
diff --git a/src/renderer/components/settings/sections/AppearanceSection.tsx b/src/renderer/components/settings/sections/AppearanceSection.tsx
new file mode 100644
index 000000000..2b6898dfc
--- /dev/null
+++ b/src/renderer/components/settings/sections/AppearanceSection.tsx
@@ -0,0 +1,44 @@
+import { useSettings } from '../../../state/settings'
+import { NODE_COLORS } from '../../../state/workspace'
+import { SettingsSection } from '../SettingsSection'
+import { SearchableRow } from '../SearchableRow'
+import { cn } from '@renderer/ui/cn'
+
+const ROWS = {
+ accent: { title: 'Accent', keywords: ['accent', 'color', 'theme', 'appearance'] }
+}
+const ENTRIES = Object.values(ROWS)
+
+export function AppearanceSection({ isActive }: { isActive: boolean }): React.JSX.Element {
+ const accent = useSettings((s) => s.settings.accent)
+ const update = useSettings((s) => s.update)
+ return (
+ <SettingsSection
+ id="appearance"
+ title="Appearance"
+ isActive={isActive}
+ searchEntries={ENTRIES}
+ >
+ <SearchableRow {...ROWS.accent}>
+ <div className="flex items-center justify-between gap-4 py-2.5">
+ <span className="text-[13px] text-text">Accent</span>
+ <div className="flex flex-wrap gap-2">
+ {NODE_COLORS.map((c) => (
+ <button
+ key={c}
+ type="button"
+ aria-label={`Accent ${c}`}
+ onClick={() => update({ accent: c })}
+ style={{ background: c }}
+ className={cn(
+ 'size-6 rounded-full border-2',
+ accent === c ? 'border-text' : 'border-transparent'
+ )}
+ />
+ ))}
+ </div>
+ </div>
+ </SearchableRow>
+ </SettingsSection>
+ )
+}
diff --git a/src/renderer/components/settings/sections/BehaviorSection.tsx b/src/renderer/components/settings/sections/BehaviorSection.tsx
new file mode 100644
index 000000000..891769dbe
--- /dev/null
+++ b/src/renderer/components/settings/sections/BehaviorSection.tsx
@@ -0,0 +1,74 @@
+import { useSettings } from '../../../state/settings'
+import { SettingsSection } from '../SettingsSection'
+import { SearchableRow } from '../SearchableRow'
+import { FieldRow } from '../FieldRow'
+import { Switch } from '@renderer/ui/Switch'
+import { NumberField } from '@renderer/ui/NumberField'
+
+const ROWS = {
+ gridSize: { title: 'Grid size', keywords: ['grid', 'size', 'snap'] },
+ snap: { title: 'Snap to grid', keywords: ['snap', 'grid', 'align'] },
+ panHover: { title: 'Pan-hover delay (ms)', keywords: ['pan', 'hover', 'delay', 'focus', 'guard'] },
+ doubleClick: { title: 'Double-click to focus', keywords: ['double', 'click', 'focus'] }
+}
+const ENTRIES = Object.values(ROWS)
+
+export function BehaviorSection({ isActive }: { isActive: boolean }): React.JSX.Element {
+ const settings = useSettings((s) => s.settings)
+ const update = useSettings((s) => s.update)
+ return (
+ <SettingsSection id="behavior" title="Behavior" isActive={isActive} searchEntries={ENTRIES}>
+ <SearchableRow {...ROWS.gridSize}>
+ <FieldRow
+ label="Grid size"
+ control={
+ <NumberField
+ value={settings.gridSize}
+ min={8}
+ max={96}
+ onChange={(v) => update({ gridSize: v || 24 })}
+ />
+ }
+ />
+ </SearchableRow>
+ <SearchableRow {...ROWS.snap}>
+ <FieldRow
+ label="Snap to grid"
+ control={
+ <Switch
+ checked={settings.snapToGrid}
+ onChange={(v) => update({ snapToGrid: v })}
+ ariaLabel="Snap to grid"
+ />
+ }
+ />
+ </SearchableRow>
+ <SearchableRow {...ROWS.panHover}>
+ <FieldRow
+ label="Pan-hover delay (ms)"
+ control={
+ <NumberField
+ value={settings.panHoverDelay}
+ min={0}
+ max={2000}
+ step={50}
+ onChange={(v) => update({ panHoverDelay: v || 0 })}
+ />
+ }
+ />
+ </SearchableRow>
+ <SearchableRow {...ROWS.doubleClick}>
+ <FieldRow
+ label="Double-click to focus"
+ control={
+ <Switch
+ checked={settings.doubleClickFocus}
+ onChange={(v) => update({ doubleClickFocus: v })}
+ ariaLabel="Double-click to focus"
+ />
+ }
+ />
+ </SearchableRow>
+ </SettingsSection>
+ )
+}
diff --git a/src/renderer/components/settings/sections/ShellSection.tsx b/src/renderer/components/settings/sections/ShellSection.tsx
new file mode 100644
index 000000000..33ff58c07
--- /dev/null
+++ b/src/renderer/components/settings/sections/ShellSection.tsx
@@ -0,0 +1,38 @@
+import { useSettings } from '../../../state/settings'
+import { SettingsSection } from '../SettingsSection'
+import { SearchableRow } from '../SearchableRow'
+import { FieldRow } from '../FieldRow'
+import { Input } from '@renderer/ui/Input'
+
+const ROWS = {
+ shell: { title: 'Default shell', keywords: ['shell', 'bash', 'zsh', 'fish', 'default'] }
+}
+const ENTRIES = Object.values(ROWS)
+
+export function ShellSection({ isActive }: { isActive: boolean }): React.JSX.Element {
+ const defaultShell = useSettings((s) => s.settings.defaultShell)
+ const update = useSettings((s) => s.update)
+ return (
+ <SettingsSection
+ id="shell"
+ title="Shell"
+ description="The shell new terminals launch. Empty uses the system default."
+ isActive={isActive}
+ searchEntries={ENTRIES}
+ >
+ <SearchableRow {...ROWS.shell}>
+ <FieldRow
+ label="Default shell"
+ control={
+ <Input
+ className="w-64"
+ placeholder="system default"
+ value={defaultShell}
+ onChange={(e) => update({ defaultShell: e.target.value })}
+ />
+ }
+ />
+ </SearchableRow>
+ </SettingsSection>
+ )
+}
diff --git a/src/renderer/components/settings/sections/TerminalSection.tsx b/src/renderer/components/settings/sections/TerminalSection.tsx
new file mode 100644
index 000000000..accb1e34e
--- /dev/null
+++ b/src/renderer/components/settings/sections/TerminalSection.tsx
@@ -0,0 +1,60 @@
+import { useSettings } from '../../../state/settings'
+import { SettingsSection } from '../SettingsSection'
+import { SearchableRow } from '../SearchableRow'
+import { FieldRow } from '../FieldRow'
+import { Input } from '@renderer/ui/Input'
+import { Switch } from '@renderer/ui/Switch'
+import { NumberField } from '@renderer/ui/NumberField'
+
+const ROWS = {
+ fontSize: { title: 'Font size', keywords: ['font', 'size', 'text'] },
+ fontFamily: { title: 'Font family', keywords: ['font', 'family', 'typeface', 'monospace'] },
+ cursorBlink: { title: 'Cursor blink', keywords: ['cursor', 'blink'] }
+}
+const ENTRIES = Object.values(ROWS)
+
+export function TerminalSection({ isActive }: { isActive: boolean }): React.JSX.Element {
+ const settings = useSettings((s) => s.settings)
+ const update = useSettings((s) => s.update)
+ return (
+ <SettingsSection id="terminal" title="Terminal" isActive={isActive} searchEntries={ENTRIES}>
+ <SearchableRow {...ROWS.fontSize}>
+ <FieldRow
+ label="Font size"
+ control={
+ <NumberField
+ value={settings.fontSize}
+ min={8}
+ max={28}
+ onChange={(v) => update({ fontSize: v || 13 })}
+ />
+ }
+ />
+ </SearchableRow>
+ <SearchableRow {...ROWS.fontFamily}>
+ <FieldRow
+ label="Font family"
+ control={
+ <Input
+ className="w-64"
+ value={settings.fontFamily}
+ onChange={(e) => update({ fontFamily: e.target.value })}
+ />
+ }
+ />
+ </SearchableRow>
+ <SearchableRow {...ROWS.cursorBlink}>
+ <FieldRow
+ label="Cursor blink"
+ control={
+ <Switch
+ checked={settings.cursorBlink}
+ onChange={(v) => update({ cursorBlink: v })}
+ ariaLabel="Cursor blink"
+ />
+ }
+ />
+ </SearchableRow>
+ </SettingsSection>
+ )
+}