diff --git a/src/renderer/src/components/right-sidebar/source-control-primary-action.create-pr-intent.test.ts b/src/renderer/src/components/right-sidebar/source-control-primary-action.create-pr-intent.test.ts index fad4de51349..40d0e57652d 100644 --- a/src/renderer/src/components/right-sidebar/source-control-primary-action.create-pr-intent.test.ts +++ b/src/renderer/src/components/right-sidebar/source-control-primary-action.create-pr-intent.test.ts @@ -532,6 +532,32 @@ describe('resolvePrimaryAction Create PR intent', () => { }) }) + it('names a failed review lookup instead of calling a ready branch not ready', () => { + expect( + resolveCreatePrHeaderAction( + inputs({ + upstreamStatus: upstreamInSync, + hostedReviewCreation: { + provider: 'gitlab', + review: null, + reviewLookupOutcome: 'unavailable', + defaultBaseRef: 'origin/main', + head: 'feature', + canCreate: false, + blockedReason: null, + nextAction: null + } + }) + ) + ).toEqual({ + kind: 'create_pr', + label: 'Create MR', + title: + 'Create MR failed: Orca could not confirm whether this branch already has a merge request. Retry once the GitLab lookup succeeds.', + disabled: true + }) + }) + it('returns a clickable Create PR header notice path when the branch has nothing to publish yet', () => { expect( resolveCreatePrHeaderAction( diff --git a/src/renderer/src/components/right-sidebar/source-control/review/primary-create-pr-intent-action.ts b/src/renderer/src/components/right-sidebar/source-control/review/primary-create-pr-intent-action.ts index 8010b900407..7ab2746ac7f 100644 --- a/src/renderer/src/components/right-sidebar/source-control/review/primary-create-pr-intent-action.ts +++ b/src/renderer/src/components/right-sidebar/source-control/review/primary-create-pr-intent-action.ts @@ -11,7 +11,10 @@ import type { } from '../../../../../../shared/hosted-review' import type { PrimaryAction, PrimaryActionInputs } from '../../source-control-primary-action-types' import { resolveCreatePrIntentEligibility } from './create-pr-intent-state' -import { canClickBlockedCreateReviewReason } from '../../source-control-create-review-blocked-action' +import { + canClickBlockedCreateReviewReason, + resolveBlockedCreateReviewNoticeMessage +} from '../../source-control-create-review-blocked-action' export function resolveProvisionalHostedReviewProvider(input: { hostedReview?: Pick | null @@ -175,11 +178,14 @@ export function resolveDisabledCreatePrHeaderAction( case 'unsupported_provider': case 'base_not_on_remote': case null: - title = translate( - 'auto.components.right.sidebar.source.control.primary.action.f0c6e2a581', - 'This branch is not ready for a {{value0}} yet.', - { value0: copy.reviewLabel } - ) + // A failed review lookup is not a branch problem, so name it instead. + title = + resolveBlockedCreateReviewNoticeMessage(hostedReviewCreation) ?? + translate( + 'auto.components.right.sidebar.source.control.primary.action.f0c6e2a581', + 'This branch is not ready for a {{value0}} yet.', + { value0: copy.reviewLabel } + ) } }