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(scm): VS Code-style in-app Publish to GitHub picker

enes16a36039356b
diff --git a/src/renderer/components/PublishDialog.tsx b/src/renderer/components/PublishDialog.tsx
new file mode 100644
index 000000000..225781a93
--- /dev/null
+++ b/src/renderer/components/PublishDialog.tsx
@@ -0,0 +1,91 @@
+import { useState } from 'react'
+import { createPortal } from 'react-dom'
+
+/**
+ * VS Code-style "Publish to GitHub" picker: an editable repository name plus a
+ * choice between a private and a public repository — all in-app, no terminal.
+ * The chosen name + visibility are handed back to the caller, which performs
+ * the actual `gh repo create` (in-process when gh is authed, otherwise via a
+ * chained terminal login).
+ */
+export function PublishDialog({
+ defaultName,
+ owner,
+ onCancel,
+ onPublish
+}: {
+ defaultName: string
+ owner?: string
+ onCancel: () => void
+ onPublish: (name: string, isPrivate: boolean) => void
+}) {
+ const [name, setName] = useState(defaultName)
+ const trimmed = name.trim()
+ const hint = (vis: string) => `${owner ? `${owner}/` : ''}${trimmed || 'repo'} · ${vis}`
+
+ return createPortal(
+ <div className="pubdlg-overlay" onClick={onCancel}>
+ <div
+ className="pubdlg"
+ role="dialog"
+ aria-label="Publish to GitHub"
+ onClick={(e) => e.stopPropagation()}
+ >
+ <input
+ className="pubdlg__name"
+ autoFocus
+ spellCheck={false}
+ value={name}
+ placeholder="Repository name"
+ onChange={(e) => setName(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === 'Escape') onCancel()
+ if (e.key === 'Enter' && trimmed) onPublish(trimmed, true)
+ }}
+ />
+ <button
+ className="pubdlg__opt"
+ disabled={!trimmed}
+ onClick={() => onPublish(trimmed, true)}
+ >
+ <LockIcon />
+ <span className="pubdlg__opt-label">Publish to GitHub private repository</span>
+ <span className="pubdlg__opt-hint">{hint('private')}</span>
+ </button>
+ <button
+ className="pubdlg__opt"
+ disabled={!trimmed}
+ onClick={() => onPublish(trimmed, false)}
+ >
+ <GlobeIcon />
+ <span className="pubdlg__opt-label">Publish to GitHub public repository</span>
+ <span className="pubdlg__opt-hint">{hint('public')}</span>
+ </button>
+ </div>
+ </div>,
+ document.body
+ )
+}
+
+function LockIcon() {
+ return (
+ <svg className="pubdlg__icon" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true">
+ <rect x="3" y="7" width="10" height="6.5" rx="1.2" fill="none" stroke="currentColor" strokeWidth="1.3" />
+ <path d="M5.2 7V5.2a2.8 2.8 0 0 1 5.6 0V7" fill="none" stroke="currentColor" strokeWidth="1.3" />
+ </svg>
+ )
+}
+
+function GlobeIcon() {
+ return (
+ <svg className="pubdlg__icon" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true">
+ <circle cx="8" cy="8" r="6" fill="none" stroke="currentColor" strokeWidth="1.3" />
+ <path
+ d="M2 8h12M8 2c2 2 2 10 0 12M8 2c-2 2-2 10 0 12"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="1.3"
+ />
+ </svg>
+ )
+}
diff --git a/src/renderer/components/SourceControlPanel.tsx b/src/renderer/components/SourceControlPanel.tsx
index 2e810d0f1..66b38c55d 100644
--- a/src/renderer/components/SourceControlPanel.tsx
+++ b/src/renderer/components/SourceControlPanel.tsx
@@ -6,6 +6,7 @@ import { useProjects } from '../state/projects'
import { GitHistoryPanel } from './git-history/GitHistoryPanel'
import { buildCommitMenuItems } from './git-history/git-history-menu'
import { ContextMenu } from './ContextMenu'
+import { PublishDialog } from './PublishDialog'
interface SourceControlPanelProps {
onClose: () => void
@@ -57,6 +58,7 @@ export function SourceControlPanel({
const [commitMenu, setCommitMenu] = useState<{ x: number; y: number; item: GitHistoryItem } | null>(
null
)
+ const [publishOpen, setPublishOpen] = useState(false)
const git = window.nodeTerminal.git
@@ -188,21 +190,7 @@ export function SourceControlPanel({
? 'Create a GitHub repo and push'
: 'Sign in to GitHub, then create the repo'
}
- onClick={() => {
- if (status.ghAuthed) {
- act(() => git.publish(cwd!, project?.name || 'repo', true))
- } else {
- // Not signed in: do the whole publish inside one flow. gh auth login is
- // interactive (browser / device code), so it runs in a terminal — but it's
- // chained straight into creating + pushing the repo, so a successful login
- // publishes without a second step. Single-quote the name as one shell arg.
- const name = (project?.name || 'repo').replace(/'/g, `'\\''`)
- onRunInTerminal(
- `gh auth login && gh repo create '${name}' --private --source=. --push`
- )
- onClose()
- }
- }}
+ onClick={() => setPublishOpen(true)}
>
Publish to GitHub
</button>
@@ -512,6 +500,27 @@ export function SourceControlPanel({
})}
/>
)}
+
+ {publishOpen && (
+ <PublishDialog
+ defaultName={project?.name || 'repo'}
+ onCancel={() => setPublishOpen(false)}
+ onPublish={(name, isPrivate) => {
+ setPublishOpen(false)
+ if (status?.ghAuthed) {
+ void act(() => git.publish(cwd!, name, isPrivate))
+ } else {
+ // Not signed in: run the interactive gh login, chained straight into
+ // creating + pushing the chosen repo, so login flows into publish.
+ const safe = name.replace(/'/g, `'\\''`)
+ onRunInTerminal(
+ `gh auth login && gh repo create '${safe}' ${isPrivate ? '--private' : '--public'} --source=. --push`
+ )
+ onClose()
+ }
+ }}
+ />
+ )}
</div>,
document.body
)
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index 966d0cdb8..ed06f48e9 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -3400,3 +3400,83 @@ body,
.scm-error__dismiss:hover {
color: #fff;
}
+
+/* Publish to GitHub picker (VS Code-style: name + private/public choice) */
+.pubdlg-overlay {
+ position: fixed;
+ inset: 0;
+ z-index: 90;
+ display: flex;
+ align-items: flex-start;
+ justify-content: center;
+ padding-top: 14vh;
+ background: rgba(0, 0, 0, 0.4);
+}
+.pubdlg {
+ width: min(520px, 86vw);
+ background: var(--panel-2, #1e1e1e);
+ border: 1px solid var(--border);
+ border-radius: 10px;
+ box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
+ padding: 6px;
+ overflow: hidden;
+}
+.pubdlg__name {
+ width: 100%;
+ background: var(--bg);
+ border: 1px solid var(--accent);
+ border-radius: 7px;
+ color: var(--text);
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
+ font-size: 14px;
+ padding: 9px 11px;
+ outline: none;
+ margin-bottom: 6px;
+}
+.pubdlg__name::placeholder {
+ color: var(--muted);
+}
+.pubdlg__opt {
+ display: flex;
+ align-items: center;
+ gap: 9px;
+ width: 100%;
+ background: transparent;
+ border: none;
+ border-radius: 7px;
+ color: var(--text);
+ text-align: left;
+ font-size: 13px;
+ padding: 9px 10px;
+ cursor: pointer;
+}
+.pubdlg__opt:hover:not(:disabled),
+.pubdlg__opt:focus-visible {
+ background: var(--accent);
+ color: #fff;
+ outline: none;
+}
+.pubdlg__opt:disabled {
+ opacity: 0.45;
+ cursor: not-allowed;
+}
+.pubdlg__icon {
+ flex: none;
+ opacity: 0.85;
+}
+.pubdlg__opt-label {
+ flex: 1;
+ min-width: 0;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.pubdlg__opt-hint {
+ flex: none;
+ font-size: 11px;
+ opacity: 0.6;
+ font-family: Menlo, Monaco, monospace;
+}
+.pubdlg__opt:hover .pubdlg__opt-hint {
+ opacity: 0.85;
+}