mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Add PR review and merge capabilities for repository owners
Implemented comprehensive PR management for repo owners across GitHub, GitLab, and Nostr: **For Repository Owners (viewing their own repos):** - See ALL incoming PRs/patches from contributors, not just their own - "Review" button to checkout PR branch and preview changes live - Merge button to merge PRs directly from UI - Works for GitHub, GitLab, and Nostr repositories **For Contributors (viewing others' repos):** - See only their own PRs/patches - "Merged" badge displayed when PR has been merged - State tracking via NIP-34 status events (kind 1630-1633) for Nostr **PR List Enhancements:** - Show author (display "you" for own PRs, username for others) - Color coding: green for open, purple for merged - Conditional actions based on ownership and state - Different section titles: "Incoming PRs/Patches" vs "Your PRs/Patches" **Technical Implementation:** - Extended usePullRequests to detect repo ownership via pubkey/username - Query all PRs when user is owner, filter to user's PRs otherwise - For Nostr: query status events to determine merged/closed state - Updated MergeDialog to accept pre-filled source/target branches - Added isOwner and authorPubkey fields to PullRequest interface This enables full PR workflow in Shakespeare: review, preview, and merge contributions.
This commit is contained in:
1 parent
b88e2ab4f8
commit
0318a8c836
3 files changed
+200
-95
No files matched your search
@@ -35,6 +35,8 @@ import { useSearchParams } from 'react-router-dom';
|
||||
interface MergeDialogProps {
|
||||
projectId: string;
|
||||
currentBranch: string | null;
|
||||
sourceBranch?: string;
|
||||
targetBranch?: string;
|
||||
open?: boolean;
|
||||
onOpenChange?: (open: boolean) => void;
|
||||
onMergeComplete?: () => void;
|
||||
@@ -58,13 +60,15 @@ interface MergePreview {
|
||||
export function MergeDialog({
|
||||
projectId,
|
||||
currentBranch,
|
||||
sourceBranch: initialSourceBranch,
|
||||
targetBranch: initialTargetBranch,
|
||||
open,
|
||||
onOpenChange,
|
||||
onMergeComplete,
|
||||
}: MergeDialogProps) {
|
||||
const [isOpen, setIsOpen] = useState(open ?? false);
|
||||
const [branches, setBranches] = useState<string[]>([]);
|
||||
const [sourceBranch, setSourceBranch] = useState<string>('');
|
||||
const [sourceBranch, setSourceBranch] = useState<string>(initialSourceBranch || '');
|
||||
const [isLoadingBranches, setIsLoadingBranches] = useState(false);
|
||||
const [isLoadingPreview, setIsLoadingPreview] = useState(false);
|
||||
const [isMerging, setIsMerging] = useState(false);
|
||||
|
||||
Reference in new issue
Block a user