fix: allow PR worktrees from existing local branches

Use existing local PR branches instead of blocking worktree creation
Only block PR branches already checked out in another worktree
Clarify local branch validation messages across locales
This commit is contained in:
Bohdan Triapitsyn
2026-05-08 16:59:31 +03:00
parent a591f63ed2
commit 1a0f3bea8e
9 changed files with 37 additions and 9 deletions
@@ -195,13 +195,15 @@ export function GitHubIntegrationDialog({
worktreeName: branchName,
});
const isBlocked = result.errors.some(
(entry) => entry.code === 'branch_in_use' || entry.code === 'branch_exists'
);
const blockingError = result.errors.find((entry) => entry.code === 'branch_in_use');
setValidations(prev => new Map(prev).set(branchName, {
isValid: !isBlocked,
error: isBlocked ? t('session.githubIntegration.validation.branchAlreadyCheckedOut') : null,
isValid: !blockingError,
error: blockingError
? t(blockingError.code === 'branch_exists'
? 'session.githubIntegration.validation.branchAlreadyExists'
: 'session.githubIntegration.validation.branchAlreadyCheckedOut')
: null,
}));
} catch {
setValidations(prev => new Map(prev).set(branchName, {