diff --git a/src/renderer/src/components/sidebar/AddRepoCreateStep.test.tsx b/src/renderer/src/components/sidebar/AddRepoCreateStep.test.tsx
index 32fd5c88fba..cb37048a9aa 100644
--- a/src/renderer/src/components/sidebar/AddRepoCreateStep.test.tsx
+++ b/src/renderer/src/components/sidebar/AddRepoCreateStep.test.tsx
@@ -3,17 +3,15 @@ import { describe, expect, it, vi } from 'vitest'
import { Dialog } from '@/components/ui/dialog'
import { TooltipProvider } from '@/components/ui/tooltip'
import { CreateStep } from './AddRepoCreateStep'
-import type { GitAvailability, RepoKind } from './create-project-defaults'
+import type { GitAvailability } from './create-project-defaults'
function renderCreateStep({
createName = '',
- createKind = 'git',
gitAvailability = 'available',
createParent = '/Users/alice/orca/projects',
parentDefaultPending = false
}: {
createName?: string
- createKind?: RepoKind
gitAvailability?: GitAvailability
createParent?: string
parentDefaultPending?: boolean
@@ -24,7 +22,6 @@ function renderCreateStep({
@@ -56,11 +52,15 @@ describe('CreateStep', () => {
expect(html).not.toContain('aria-label="Browse host filesystem"')
})
- it('shows the Git fallback explanation in the collapsed summary', () => {
- const html = renderCreateStep({ createKind: 'folder', gitAvailability: 'unavailable' })
+ it('shows the Git-required explanation in the collapsed summary', () => {
+ const html = renderCreateStep({
+ createName: 'demo-project',
+ gitAvailability: 'unavailable'
+ })
- expect(html).toContain('Folder in ~/orca/projects')
- expect(html).toContain('Git isn't installed, so a plain folder is the default.')
+ expect(html).toContain('Git repository in ~/orca/projects')
+ expect(html).toContain('Git is required to create a project.')
+ expect(html).toContain('disabled=""')
})
it('disables create while an auto-filled parent belongs to a previous target', () => {
diff --git a/src/renderer/src/components/sidebar/AddRepoCreateStep.tsx b/src/renderer/src/components/sidebar/AddRepoCreateStep.tsx
index 2c75a2222f9..7748df85210 100644
--- a/src/renderer/src/components/sidebar/AddRepoCreateStep.tsx
+++ b/src/renderer/src/components/sidebar/AddRepoCreateStep.tsx
@@ -1,6 +1,6 @@
// Step for AddRepoDialog (orca#763), split out so create-project state stays scoped.
-import React, { useCallback, useMemo, useRef, useState } from 'react'
-import { ChevronDown, Folder, GitBranch, Loader2 } from 'lucide-react'
+import React, { useMemo, useState } from 'react'
+import { ChevronDown, GitBranch, Loader2 } from 'lucide-react'
import { DialogHeader, DialogTitle, DialogDescription } from '@/components/ui/dialog'
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
@@ -13,8 +13,7 @@ import { translate } from '@/i18n/i18n'
import {
formatCreateProjectParentSummary,
joinCreateProjectPath,
- type GitAvailability,
- type RepoKind
+ type GitAvailability
} from './create-project-defaults'
// ── UI helpers ───────────────────────────────────────────────────────
@@ -24,7 +23,6 @@ const CREATE_PROJECT_NAME_PLACEHOLDER = 'project-name'
type CreateStepProps = {
createName: string
createParent: string
- createKind: RepoKind
createError: string | null
isCreating: boolean
defaultParent?: string
@@ -36,7 +34,6 @@ type CreateStepProps = {
sshTargetId?: string | null
onNameChange: (value: string) => void
onParentChange: (value: string) => void
- onKindChange: (kind: RepoKind) => void
onPickParent: () => void
onCreate: () => void
}
@@ -44,7 +41,6 @@ type CreateStepProps = {
export function CreateStep({
createName,
createParent,
- createKind,
createError,
isCreating,
defaultParent = '',
@@ -56,54 +52,21 @@ export function CreateStep({
sshTargetId,
onNameChange,
onParentChange,
- onKindChange,
onPickParent,
onCreate
}: CreateStepProps): React.JSX.Element {
- const radioGroupRef = useRef(null)
- const radioFocusFrameRef = useRef(null)
const [browsingParent, setBrowsingParent] = useState(false)
// Why: SSH hosts need a typed remote path; hiding that field behind the
// collapsed defaults makes the create flow look impossible.
const [advancedOpen, setAdvancedOpen] = useState(manualParentEntry)
- const cancelRadioFocusFrame = useCallback((): void => {
- if (radioFocusFrameRef.current === null) {
- return
- }
- cancelAnimationFrame(radioFocusFrameRef.current)
- radioFocusFrameRef.current = null
- }, [])
-
- const setRadioGroupNode = useCallback(
- (node: HTMLDivElement | null): void => {
- // Why: the queued arrow-key focus is only valid while this radiogroup is mounted.
- if (!node) {
- cancelRadioFocusFrame()
- }
- radioGroupRef.current = node
- },
- [cancelRadioFocusFrame]
- )
-
- // Arrow keys cycle selection within the radiogroup (WAI-ARIA radio pattern).
- const cycleKind = useCallback(() => {
- const next = createKind === 'git' ? 'folder' : 'git'
- onKindChange(next)
- cancelRadioFocusFrame()
- radioFocusFrameRef.current = requestAnimationFrame(() => {
- radioFocusFrameRef.current = null
- const nextEl = radioGroupRef.current?.querySelector(
- `[data-kind="${next}"]`
- )
- nextEl?.focus()
- })
- }, [cancelRadioFocusFrame, createKind, onKindChange])
-
+ // Why: SSH hosts report "unknown"; only a confirmed Git miss should block
+ // Git-only creation.
const canSubmit =
createName.trim().length > 0 &&
createParent.trim().length > 0 &&
gitAvailability !== 'checking' &&
+ gitAvailability !== 'unavailable' &&
!parentDefaultPending &&
!isCreating
const missingLocationLabel = translate(
@@ -139,10 +102,10 @@ export function CreateStep({
const name = createName.trim() || CREATE_PROJECT_NAME_PLACEHOLDER
return createParent.trim() ? joinCreateProjectPath(createParent, name) : ''
}, [createName, createParent])
- const kindLabel =
- createKind === 'git'
- ? translate('auto.components.sidebar.AddRepoCreateStep.11fd2a7db8', 'Git repository')
- : translate('auto.components.sidebar.AddRepoCreateStep.038729c107', 'Folder')
+ const kindLabel = translate(
+ 'auto.components.sidebar.AddRepoCreateStep.11fd2a7db8',
+ 'Git repository'
+ )
const showGitFallback = gitAvailability === 'unavailable'
const showGitChecking = gitAvailability === 'checking'
const showRuntimeMissingParent =
@@ -216,11 +179,7 @@ export function CreateStep({
className="flex w-full min-w-0 items-start gap-2.5 rounded-md px-3 py-2.5 text-left transition-colors cursor-pointer hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50"
>
- {createKind === 'git' ? (
-
- ) : (
-
- )}
+
@@ -242,10 +201,10 @@ export function CreateStep({
)}
) : showGitFallback ? (
-
+
{translate(
'auto.components.sidebar.AddRepoCreateStep.fe1e616c5b',
- "Git isn't installed, so a plain folder is the default."
+ 'Git is required to create a project.'
)}