From 977d6a46a45a03b27aa22de4b85f5bbfc3e3c566 Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Tue, 14 Oct 2025 23:20:15 -0500 Subject: [PATCH] Add "Create Nostr Patch" button for Nostr remotes Fixed the issue where no PR/patch creation button was shown when using a Nostr remote URL. Changes: - Added "Create Nostr Patch" button in Branch Operations when Nostr remote is detected - Button opens Git Management Dialog directly to the Nostr tab - Added defaultTab state management to control which tab opens - GitHub/GitLab remotes show "Create Pull Request" button - Nostr remotes show "Create Nostr Patch" button - Both buttons are mutually exclusive based on remote URL type User Experience: - Clear call-to-action for Nostr repositories - One-click access to patch creation - No more confusion about where to create patches --- src/components/GitDialog.tsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/GitDialog.tsx b/src/components/GitDialog.tsx index 1e4f4df9..e267804a 100644 --- a/src/components/GitDialog.tsx +++ b/src/components/GitDialog.tsx @@ -676,6 +676,7 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog const syncStatus = getSyncStatus(); const [isGitManagementOpen, setIsGitManagementOpen] = useState(false); + const [gitManagementDefaultTab, setGitManagementDefaultTab] = useState('branches'); return ( <> @@ -694,6 +695,7 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog size="sm" className="gap-2" onClick={() => { + setGitManagementDefaultTab('branches'); setIsGitManagementOpen(true); onOpenChange?.(false); }} @@ -962,13 +964,27 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog currentBranch={gitStatus.currentBranch} onMergeComplete={() => refetchGitStatus()} /> - {gitStatus.remotes.length > 0 && originUrl && ( + {gitStatus.remotes.length > 0 && originUrl && !originUrl.startsWith('nostr://') && ( )} + {gitStatus.remotes.length > 0 && originUrl?.startsWith('nostr://') && ( + + )} )} @@ -1029,6 +1045,7 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog projectId={projectId} open={isGitManagementOpen} onOpenChange={setIsGitManagementOpen} + defaultTab={gitManagementDefaultTab} /> {/* Create Branch Dialog */}