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): add Sessions/Account/Application sections
enes9a9bba5743fa
diff --git a/src/renderer/components/settings/sections/LicenseSection.tsx b/src/renderer/components/settings/sections/LicenseSection.tsxnew file mode 100644index 000000000..4de0f111c--- /dev/null+++ b/src/renderer/components/settings/sections/LicenseSection.tsx@@ -0,0 +1,90 @@+import { useState } from 'react'+import { useEntitlement } from '../../../state/entitlement'+import { SettingsSection } from '../SettingsSection'+import { SearchableRow } from '../SearchableRow'+import { FieldRow } from '../FieldRow'+import { Button } from '@renderer/ui/Button'+import { Input } from '@renderer/ui/Input'++const ROWS = {+ license: {+ title: 'License',+ keywords: ['pro', 'upgrade', 'license', 'key', 'subscription', 'activate']+ }+}+const ENTRIES = Object.values(ROWS)++export function LicenseSection({ isActive }: { isActive: boolean }): React.JSX.Element {+ const ent = useEntitlement()+ const [licenseKey, setLicenseKey] = useState('')+ const [upgrading, setUpgrading] = useState(false)+ return (+ <SettingsSection+ id="license"+ title="License"+ description="Manage your nodeterm Pro subscription."+ isActive={isActive}+ searchEntries={ENTRIES}+ >+ <SearchableRow {...ROWS.license}>+ {ent.isPremium ? (+ <div className="space-y-3">+ <p className="text-sm text-muted">+ Pro — active+ {ent.status.expiresAt+ ? ` until ${new Date(ent.status.expiresAt * 1000).toLocaleDateString()}`+ : ''}+ .+ </p>+ <Button onClick={() => void ent.deactivate()}>Deactivate on this device</Button>+ </div>+ ) : (+ <div className="space-y-3">+ <Button+ variant="primary"+ onClick={() => {+ setUpgrading(true)+ void ent.upgrade()+ }}+ >+ Upgrade to Pro — $29/mo+ </Button>+ <p className="text-sm text-muted">+ {upgrading+ ? 'Complete your purchase in the browser — Pro unlocks here automatically.'+ : 'Unlock remote access and Pro features.'}+ </p>+ <details>+ <summary className="cursor-pointer text-sm text-muted">Have a license key?</summary>+ <div className="mt-3 space-y-2">+ <FieldRow+ label="License key"+ control={+ <Input+ className="w-64"+ placeholder="paste your key"+ value={licenseKey}+ onChange={(e) => setLicenseKey(e.target.value)}+ />+ }+ />+ <Button+ onClick={() => {+ if (licenseKey.trim()) void ent.activate(licenseKey.trim())+ }}+ >+ Activate+ </Button>+ {ent.status.error ? (+ <p className="text-sm" style={{ color: '#ff9f0a' }}>+ Could not activate ({ent.status.error}).+ </p>+ ) : null}+ </div>+ </details>+ </div>+ )}+ </SearchableRow>+ </SettingsSection>+ )+}diff --git a/src/renderer/components/settings/sections/PrivacySection.tsx b/src/renderer/components/settings/sections/PrivacySection.tsxnew file mode 100644index 000000000..a37450ddc--- /dev/null+++ b/src/renderer/components/settings/sections/PrivacySection.tsx@@ -0,0 +1,35 @@+import { useSettings } from '../../../state/settings'+import { SettingsSection } from '../SettingsSection'+import { SearchableRow } from '../SearchableRow'+import { FieldRow } from '../FieldRow'+import { Switch } from '@renderer/ui/Switch'++const ROWS = {+ telemetry: {+ title: 'Send anonymous usage data',+ keywords: ['privacy', 'telemetry', 'usage', 'analytics', 'data']+ }+}+const ENTRIES = Object.values(ROWS)++export function PrivacySection({ isActive }: { isActive: boolean }): React.JSX.Element {+ const telemetryEnabled = useSettings((s) => s.settings.telemetryEnabled)+ const update = useSettings((s) => s.update)+ return (+ <SettingsSection id="privacy" title="Privacy" isActive={isActive} searchEntries={ENTRIES}>+ <SearchableRow {...ROWS.telemetry}>+ <FieldRow+ label="Send anonymous usage data (version/OS)"+ description="No personal data. Used only to see which versions are in use."+ control={+ <Switch+ checked={telemetryEnabled}+ onChange={(v) => update({ telemetryEnabled: v })}+ ariaLabel="Telemetry"+ />+ }+ />+ </SearchableRow>+ </SettingsSection>+ )+}diff --git a/src/renderer/components/settings/sections/RemoteSection.tsx b/src/renderer/components/settings/sections/RemoteSection.tsxnew file mode 100644index 000000000..0ccca75f3--- /dev/null+++ b/src/renderer/components/settings/sections/RemoteSection.tsx@@ -0,0 +1,139 @@+import { useState } from 'react'+import { useEntitlement } from '../../../state/entitlement'+import { SettingsSection } from '../SettingsSection'+import { SearchableRow } from '../SearchableRow'+import { FieldRow } from '../FieldRow'+import { Button } from '@renderer/ui/Button'+import { Input } from '@renderer/ui/Input'++const ROWS = {+ allow: { title: 'Allow remote access', keywords: ['remote', 'host', 'share', 'pairing', 'ssh'] },+ connect: {+ title: 'Connect to a host',+ keywords: ['remote', 'connect', 'client', 'pairing', 'code']+ }+}+const ENTRIES = Object.values(ROWS)++export function RemoteSection({+ isActive,+ onClose+}: {+ isActive: boolean+ onClose: () => void+}): React.JSX.Element {+ const isPremium = useEntitlement((s) => s.isPremium)+ const [hostOffer, setHostOffer] = useState('')+ const [hostBusy, setHostBusy] = useState(false)+ const [remoteError, setRemoteError] = useState('')+ const [clientCode, setClientCode] = useState('')+ const [connecting, setConnecting] = useState(false)+ const startHosting = async () => {+ setRemoteError('')+ setHostBusy(true)+ try {+ const { offer } = await window.nodeTerminal.remoteHost.start()+ setHostOffer(offer)+ } catch (err) {+ setRemoteError((err as Error).message)+ setHostBusy(false)+ }+ }+ const stopHosting = async () => {+ await window.nodeTerminal.remoteHost.stop()+ setHostOffer('')+ setHostBusy(false)+ }+ const connectToHost = async () => {+ const code = clientCode.trim()+ if (!code) return+ setRemoteError('')+ setConnecting(true)+ try {+ const connectionId = await window.nodeTerminal.remoteClient.connect(code)+ setClientCode('')+ window.dispatchEvent(+ new CustomEvent('nodeterm:open-remote-terminal', { detail: { connectionId } })+ )+ onClose()+ } catch (err) {+ setRemoteError((err as Error).message)+ } finally {+ setConnecting(false)+ }+ }+ return (+ <SettingsSection+ id="remote"+ title="Remote access"+ description="Open terminals that run on another machine you own — end-to-end encrypted over the relay. Hosting (sharing this machine) is Pro; connecting to a host is free."+ isActive={isActive}+ searchEntries={ENTRIES}+ >+ <SearchableRow {...ROWS.allow}>+ <div className="space-y-3">+ <h4 className="text-[13px] font-medium text-text">Allow remote access</h4>+ {isPremium ? (+ hostOffer ? (+ <div className="space-y-2">+ <p className="text-sm text-muted">+ Share this pairing code with the other device (single use):+ </p>+ <FieldRow+ label="Pairing code"+ control={+ <Input+ className="w-72"+ readOnly+ value={hostOffer}+ onFocus={(e) => e.target.select()}+ />+ }+ />+ <div className="flex gap-2">+ <Button onClick={() => window.nodeTerminal.clipboard.writeText(hostOffer)}>+ Copy code+ </Button>+ <Button onClick={() => void stopHosting()}>Stop sharing</Button>+ </div>+ </div>+ ) : (+ <Button disabled={hostBusy} onClick={() => void startHosting()}>+ {hostBusy ? 'Starting…' : 'Allow remote access'}+ </Button>+ )+ ) : (+ <p className="text-sm text-muted">+ Hosting this machine requires nodeterm Pro — upgrade above. Connecting to a host you+ were given a code for is free.+ </p>+ )}+ </div>+ </SearchableRow>+ <SearchableRow {...ROWS.connect}>+ <div className="mt-4 space-y-3">+ <h4 className="text-[13px] font-medium text-text">Connect to a host</h4>+ <FieldRow+ label="Pairing code"+ control={+ <Input+ className="w-72"+ placeholder="paste the host's code"+ value={clientCode}+ onChange={(e) => setClientCode(e.target.value)}+ />+ }+ />+ <Button disabled={connecting || !clientCode.trim()} onClick={() => void connectToHost()}>+ {connecting ? 'Connecting…' : 'Connect'}+ </Button>+ {remoteError ? (+ <p className="text-sm" style={{ color: '#ff9f0a' }}>+ {remoteError}+ </p>+ ) : null}+ </div>+ </SearchableRow>+ </SettingsSection>+ )+}diff --git a/src/renderer/components/settings/sections/TmuxSection.tsx b/src/renderer/components/settings/sections/TmuxSection.tsxnew file mode 100644index 000000000..694b66a17--- /dev/null+++ b/src/renderer/components/settings/sections/TmuxSection.tsx@@ -0,0 +1,56 @@+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 = {+ enabled: {+ title: 'Persistent sessions (tmux)',+ keywords: ['tmux', 'persistent', 'session', 'continuity']+ },+ scrollback: { title: 'Scrollback lines', keywords: ['tmux', 'scrollback', 'history', 'lines'] }+}+const ENTRIES = Object.values(ROWS)++export function TmuxSection({ isActive }: { isActive: boolean }): React.JSX.Element {+ const settings = useSettings((s) => s.settings)+ const update = useSettings((s) => s.update)+ return (+ <SettingsSection+ id="tmux"+ title="tmux"+ description="Applies to new terminals / next launch."+ isActive={isActive}+ searchEntries={ENTRIES}+ >+ <SearchableRow {...ROWS.enabled}>+ <FieldRow+ label="Persistent sessions (tmux)"+ control={+ <Switch+ checked={settings.tmuxEnabled}+ onChange={(v) => update({ tmuxEnabled: v })}+ ariaLabel="Persistent sessions"+ />+ }+ />+ </SearchableRow>+ <SearchableRow {...ROWS.scrollback}>+ <FieldRow+ label="Scrollback lines"+ control={+ <NumberField+ value={settings.tmuxScrollback}+ min={1000}+ max={200000}+ step={1000}+ onChange={(v) => update({ tmuxScrollback: v || 50000 })}+ />+ }+ />+ </SearchableRow>+ </SettingsSection>+ )+}diff --git a/src/renderer/components/settings/sections/UpdatesSection.tsx b/src/renderer/components/settings/sections/UpdatesSection.tsxnew file mode 100644index 000000000..6eb1e96e4--- /dev/null+++ b/src/renderer/components/settings/sections/UpdatesSection.tsx@@ -0,0 +1,38 @@+import { useEffect, useState } from 'react'+import { SettingsSection } from '../SettingsSection'+import { SearchableRow } from '../SearchableRow'+import { FieldRow } from '../FieldRow'+import { Button } from '@renderer/ui/Button'++const ROWS = {+ updates: { title: 'Updates', keywords: ['update', 'version', 'check', 'upgrade'] }+}+const ENTRIES = Object.values(ROWS)++export function UpdatesSection({ isActive }: { isActive: boolean }): React.JSX.Element {+ const [version, setVersion] = useState('')+ useEffect(() => {+ void window.nodeTerminal.updates.getVersion().then(setVersion)+ }, [])+ return (+ <SettingsSection id="updates" title="Updates" isActive={isActive} searchEntries={ENTRIES}>+ <SearchableRow {...ROWS.updates}>+ <div className="space-y-3">+ <FieldRow+ label="Current version"+ control={<span className="text-[13px] text-muted">{version || '…'}</span>}+ />+ <Button+ onClick={() => {+ window.dispatchEvent(new CustomEvent('nodeterm:update-checking'))+ window.nodeTerminal.updates.check()+ }}+ >+ Check for updates+ </Button>+ <p className="text-sm text-muted">Results appear in the update card at the bottom-right.</p>+ </div>+ </SearchableRow>+ </SettingsSection>+ )+}