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(clone): open the clone dialog from the start screen and command palette

enesf00b72d97810
diff --git a/src/renderer/canvas/Canvas.tsx b/src/renderer/canvas/Canvas.tsx
index fea5fddd8..9ce03154c 100644
--- a/src/renderer/canvas/Canvas.tsx
+++ b/src/renderer/canvas/Canvas.tsx
@@ -55,6 +55,7 @@ import { SettingsPage } from '../components/settings/SettingsPage'
import type { SettingsSectionId } from '../components/settings/nav'
import { SourceControlPanel } from '../components/SourceControlPanel'
import { WelcomeScreen } from '../components/WelcomeScreen'
+import { CloneRepoDialog } from '../components/CloneRepoDialog'
import { ShortcutsPanel } from '../components/ShortcutsPanel'
import { UpdateCard } from '../components/UpdateCard'
import { AnnouncementBanner } from '../components/AnnouncementBanner'
@@ -232,6 +233,8 @@ export function Canvas() {
const [remoteDialogOpen, setRemoteDialogOpen] = useState(false)
// "Connect over SSH…" project-creation dialog (from the Welcome screen).
const [sshDialogOpen, setSshDialogOpen] = useState(false)
+ // "Clone repository…" dialog (from the Welcome screen + command palette).
+ const [cloneDialogOpen, setCloneDialogOpen] = useState(false)
// Live SSH ControlMaster status per project id (drives the thin connection banner).
const [sshStatus, setSshStatus] = useState<Record<string, SshProjectStatus>>({})
// A client has finished the handshake and is awaiting this host's approval (carries the SAS).
@@ -1146,22 +1149,18 @@ export function Canvas() {
[openFile]
)
- const cloneRepo = useCallback(async () => {
- const url = await promptDialog({ message: 'Repository URL (https:// or git@):' })
- if (!url) return
- const parent = await window.nodeTerminal.dialog.selectFolder()
- if (!parent) return
- const r = await window.nodeTerminal.git.clone(parent, url)
- if (!r.ok) {
- window.alert(`Clone failed: ${r.message}`)
- return
- }
- const name = url.split('/').pop()?.replace(/\.git$/, '') || 'repo'
- commitActiveToStore()
- const project = useProjects.getState().addProject(name, r.message)
- useProjects.getState().setActive(project.id)
- void writeDisk()
- }, [commitActiveToStore, writeDisk])
+ /** Open the clone dialog; project creation happens in onRepoCloned below. */
+ const cloneRepo = useCallback(() => setCloneDialogOpen(true), [])
+
+ const onRepoCloned = useCallback(
+ (clonedPath: string, name: string) => {
+ commitActiveToStore()
+ const project = useProjects.getState().addProject(name, clonedPath)
+ useProjects.getState().setActive(project.id)
+ void writeDisk()
+ },
+ [commitActiveToStore, writeDisk]
+ )
const addSticky = useCallback(
(center?: { x: number; y: number }) => {
@@ -2865,6 +2864,7 @@ export function Canvas() {
})
),
{ id: 'new-project', label: 'New project', icon: <IconProject />, run: () => addProject() },
+ { id: 'clone-repo', label: 'Clone repository…', icon: <IconProject />, run: () => setCloneDialogOpen(true) },
{
id: 'new-remote',
label: 'New Remote Connection',
@@ -3105,7 +3105,7 @@ export function Canvas() {
}}
onCloneRepo={() => {
setWelcomeOpen(false)
- void cloneRepo()
+ cloneRepo()
}}
onConnectSsh={() => {
setWelcomeOpen(false)
@@ -3118,6 +3118,12 @@ export function Canvas() {
/>
)}
+ <CloneRepoDialog
+ open={cloneDialogOpen}
+ onClose={() => setCloneDialogOpen(false)}
+ onCloned={onRepoCloned}
+ />
+
{remoteConnId && (
<div className="remote-session-overlay">
<RemoteSessionView connectionId={remoteConnId} onClose={disconnectRemote} />