fix: use dynamic branch references instead of hardcoded origin/main

- Fix handleResolveConflicts to use origin/${worktree.branch} instead of
  hardcoded origin/main for pull and resolve conflicts
- Add defaultBaseBranch prop to CreatePRDialog to use selected branch
- Fix branchCardCounts to use primary worktree branch as default
- Enable PR status and Address PR Comments for main branch tab
- Add automatic PR detection from GitHub for branches without stored metadata

This allows users working on release branches (like v0.11.0rc) to properly
pull from their branch's remote and see PR status for any branch.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Shirone
2026-01-14 00:40:10 +01:00
parent 32f6c6d6eb
commit 51e4e8489a
4 changed files with 99 additions and 43 deletions

View File

@@ -30,6 +30,8 @@ interface CreatePRDialogProps {
worktree: WorktreeInfo | null;
projectPath: string | null;
onCreated: (prUrl?: string) => void;
/** Default base branch for the PR (defaults to 'main' if not provided) */
defaultBaseBranch?: string;
}
export function CreatePRDialog({
@@ -38,10 +40,11 @@ export function CreatePRDialog({
worktree,
projectPath,
onCreated,
defaultBaseBranch = 'main',
}: CreatePRDialogProps) {
const [title, setTitle] = useState('');
const [body, setBody] = useState('');
const [baseBranch, setBaseBranch] = useState('main');
const [baseBranch, setBaseBranch] = useState(defaultBaseBranch);
const [commitMessage, setCommitMessage] = useState('');
const [isDraft, setIsDraft] = useState(false);
const [isLoading, setIsLoading] = useState(false);
@@ -59,7 +62,7 @@ export function CreatePRDialog({
setTitle('');
setBody('');
setCommitMessage('');
setBaseBranch('main');
setBaseBranch(defaultBaseBranch);
setIsDraft(false);
setError(null);
// Also reset result states when opening for a new worktree
@@ -74,7 +77,7 @@ export function CreatePRDialog({
setTitle('');
setBody('');
setCommitMessage('');
setBaseBranch('main');
setBaseBranch(defaultBaseBranch);
setIsDraft(false);
setError(null);
setPrUrl(null);
@@ -82,7 +85,7 @@ export function CreatePRDialog({
setShowBrowserFallback(false);
operationCompletedRef.current = false;
}
}, [open, worktree?.path]);
}, [open, worktree?.path, defaultBaseBranch]);
const handleCreate = async () => {
if (!worktree) return;