diff --git a/src/components/GitDialog.tsx b/src/components/GitDialog.tsx index 2f9f36a1..febaa38b 100644 --- a/src/components/GitDialog.tsx +++ b/src/components/GitDialog.tsx @@ -49,6 +49,8 @@ import { cn } from '@/lib/utils'; import { findCredentialsForRepo } from '@/lib/gitCredentials'; import { nip19 } from 'nostr-tools'; import { GitManagementDialog } from '@/components/git/GitManagementDialog'; +import { MergeDialog } from '@/components/git/MergeDialog'; +import { PullRequestDialog } from '@/components/git/PullRequestDialog'; const GRASP_SERVERS = ["git.shakespeare.diy", "relay.ngit.dev"]; @@ -768,8 +770,29 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog )} + + + )} - + {/* Branch Operations */} + {gitStatus?.isGitRepo && gitStatus.currentBranch && ( + + + Branch Operations + + + refetchGitStatus()} + /> + {gitStatus.remotes.length > 0 && originUrl && ( + + )} )} diff --git a/src/components/git/GitManagementDialog.tsx b/src/components/git/GitManagementDialog.tsx index 3e8da56f..d29d6d48 100644 --- a/src/components/git/GitManagementDialog.tsx +++ b/src/components/git/GitManagementDialog.tsx @@ -1,5 +1,4 @@ import { useState } from 'react'; -import { Button } from '@/components/ui/button'; import { Dialog, DialogContent, @@ -11,15 +10,10 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; import { GitBranch, GitCompare, - GitMerge, - GitPullRequest, Settings, - History, } from 'lucide-react'; import { BranchManager } from './BranchManager'; import { CompareView } from './CompareView'; -import { MergeDialog } from './MergeDialog'; -import { PullRequestDialog } from './PullRequestDialog'; import { DiffViewer } from './DiffViewer'; import { useGitStatus } from '@/hooks/useGitStatus'; @@ -39,8 +33,6 @@ export function GitManagementDialog({ defaultTab = 'branches', }: GitManagementDialogProps) { const [activeTab, setActiveTab] = useState(defaultTab); - const [isMergeDialogOpen, setIsMergeDialogOpen] = useState(false); - const [isPRDialogOpen, setIsPRDialogOpen] = useState(false); const { data: gitStatus, refetch: refetchGitStatus } = useGitStatus(projectId); @@ -49,14 +41,6 @@ export function GitManagementDialog({ refetchGitStatus(); }; - const handleMergeComplete = () => { - setIsMergeDialogOpen(false); - refetchGitStatus(); - }; - - // Get remote URL for PR creation - const remoteUrl = gitStatus?.remotes.find(r => r.name === 'origin')?.url; - return ( <> @@ -98,40 +82,11 @@ export function GitManagementDialog({ {/* Branches Tab */} -
-
- {gitStatus?.currentBranch && ( - <> - - {remoteUrl && ( - - )} - - )} -
- - -
+
{/* Changes Tab */} @@ -149,26 +104,6 @@ export function GitManagementDialog({
- - {/* Merge Dialog */} - - - {/* Pull Request Dialog */} - {remoteUrl && ( - - )} ); }