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(ssh): deep-link New remote → SSH settings section + nav count

enes504592f9587c
diff --git a/src/renderer/canvas/Canvas.tsx b/src/renderer/canvas/Canvas.tsx
index c769d686c..df397a773 100644
--- a/src/renderer/canvas/Canvas.tsx
+++ b/src/renderer/canvas/Canvas.tsx
@@ -47,6 +47,7 @@ import {
IconUngroup
} from '../components/icons'
import { SettingsPage } from '../components/settings/SettingsPage'
+import type { SettingsSectionId } from '../components/settings/nav'
import { SourceControlPanel } from '../components/SourceControlPanel'
import { WelcomeScreen } from '../components/WelcomeScreen'
import { ShortcutsPanel } from '../components/ShortcutsPanel'
@@ -132,6 +133,8 @@ export function Canvas() {
const [bufferCache, setBufferCache] = useState<Record<string, string>>({})
const captureTsRef = useRef<Record<string, number>>({})
const [settingsOpen, setSettingsOpen] = useState(false)
+ // Optional deep-link target when opening settings (e.g. RemotePicker → the SSH section).
+ const [settingsSection, setSettingsSection] = useState<SettingsSectionId | undefined>(undefined)
const [scOpen, setScOpen] = useState(false)
const [shortcutsOpen, setShortcutsOpen] = useState(false)
const [explorerOpen, setExplorerOpen] = useState(false)
@@ -1493,6 +1496,7 @@ export function Canvas() {
setPaletteOpen((v) => !v)
} else if ((e.metaKey || e.ctrlKey) && e.key === ',') {
e.preventDefault()
+ setSettingsSection(undefined)
setSettingsOpen(true)
} else if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.key.toLowerCase() === 'e') {
e.preventDefault()
@@ -2202,7 +2206,13 @@ export function Canvas() {
<button title="Source Control" onClick={() => setScOpen(true)}>
⎇
</button>
- <button title="Settings (⌘,)" onClick={() => setSettingsOpen(true)}>
+ <button
+ title="Settings (⌘,)"
+ onClick={() => {
+ setSettingsSection(undefined)
+ setSettingsOpen(true)
+ }}
+ >
⚙
</button>
<button title="Keyboard shortcuts (⌘/)" onClick={() => setShortcutsOpen(true)}>
@@ -2303,7 +2313,9 @@ export function Canvas() {
/>
)}
- {settingsOpen && <SettingsPage onClose={() => setSettingsOpen(false)} />}
+ {settingsOpen && (
+ <SettingsPage onClose={() => setSettingsOpen(false)} initialSection={settingsSection} />
+ )}
{scOpen && (
<SourceControlPanel
@@ -2362,7 +2374,10 @@ export function Canvas() {
x={remotePicker.x}
y={remotePicker.y}
onPick={(srv) => addSshTerminal(srv, { x: remotePicker.x, y: remotePicker.y })}
- onManage={() => setSettingsOpen(true)}
+ onManage={() => {
+ setSettingsSection('ssh')
+ setSettingsOpen(true)
+ }}
onClose={() => setRemotePicker(null)}
/>
)}
diff --git a/src/renderer/components/settings/SettingsPage.tsx b/src/renderer/components/settings/SettingsPage.tsx
index 92409279e..47d495daf 100644
--- a/src/renderer/components/settings/SettingsPage.tsx
+++ b/src/renderer/components/settings/SettingsPage.tsx
@@ -19,15 +19,27 @@ import { SshSection } from './sections/SshSection'
import { UpdatesSection } from './sections/UpdatesSection'
import { PrivacySection } from './sections/PrivacySection'
-export function SettingsPage({ onClose }: { onClose: () => void }): React.JSX.Element {
+export function SettingsPage({
+ onClose,
+ initialSection
+}: {
+ onClose: () => void
+ /** Section to open on; lets callers deep-link (e.g. "Add SSH server…" → the SSH section). */
+ initialSection?: SettingsSectionId
+}): React.JSX.Element {
const hydrate = useEntitlement((s) => s.hydrate)
- const [active, setActive] = useState<SettingsSectionId>(FIRST_SECTION_ID)
+ const [active, setActive] = useState<SettingsSectionId>(initialSection ?? FIRST_SECTION_ID)
const [query, setQuery] = useState('')
useEffect(() => {
void hydrate()
}, [hydrate])
+ // Re-target when a caller opens settings to a specific section.
+ useEffect(() => {
+ if (initialSection) setActive(initialSection)
+ }, [initialSection])
+
useEffect(() => {
const onKey = (e: KeyboardEvent) => {
if (e.key === 'Escape') onClose()
diff --git a/src/renderer/components/settings/nav.test.ts b/src/renderer/components/settings/nav.test.ts
index 2108f57e5..e1ccbd8e3 100644
--- a/src/renderer/components/settings/nav.test.ts
+++ b/src/renderer/components/settings/nav.test.ts
@@ -2,10 +2,10 @@ import { describe, it, expect } from 'vitest'
import { SETTINGS_GROUPS, allSectionIds, FIRST_SECTION_ID } from './nav'
describe('SETTINGS_GROUPS', () => {
- it('lists exactly 13 sections with no duplicates', () => {
+ it('lists exactly 14 sections with no duplicates', () => {
const ids = allSectionIds()
- expect(ids).toHaveLength(13)
- expect(new Set(ids).size).toBe(13)
+ expect(ids).toHaveLength(14)
+ expect(new Set(ids).size).toBe(14)
})
it('starts at a section that exists in the groups', () => {
expect(allSectionIds()).toContain(FIRST_SECTION_ID)