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
This commit is contained in:
shakespeare.diy committed 2025-10-14 23:20:15 -05:00
1 parent 1d441e42f5
commit 977d6a46a4
1 file changed
+18 -1
+18 -1
View File
@@ -676,6 +676,7 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog
const syncStatus = getSyncStatus();
const [isGitManagementOpen, setIsGitManagementOpen] = useState(false);
const [gitManagementDefaultTab, setGitManagementDefaultTab] = useState<string>('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://') && (
<PullRequestDialog
projectId={projectId}
currentBranch={gitStatus.currentBranch}
remoteUrl={originUrl}
/>
)}
{gitStatus.remotes.length > 0 && originUrl?.startsWith('nostr://') && (
<Button
variant="outline"
className="gap-2"
onClick={() => {
setGitManagementDefaultTab('nostr');
setIsGitManagementOpen(true);
onOpenChange?.(false);
}}
>
<GitPullRequest className="h-4 w-4" />
Create Nostr Patch
</Button>
)}
</CardContent>
</Card>
)}
@@ -1029,6 +1045,7 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog
projectId={projectId}
open={isGitManagementOpen}
onOpenChange={setIsGitManagementOpen}
defaultTab={gitManagementDefaultTab}
/>
{/* Create Branch Dialog */}