mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 16:03:49 +00:00
Fix stale PR suppression in Checks
This commit is contained in:
@@ -12,7 +12,9 @@ export type ChecksPanelEmptyContentModel = Pick<
|
||||
| 'activeReview'
|
||||
| 'isFolder'
|
||||
| 'linkedGitLabMR'
|
||||
| 'linkedPR'
|
||||
| 'linkedReviewNumber'
|
||||
| 'prNumber'
|
||||
| 'prRefreshState'
|
||||
| 'suppressedGitHubPR'
|
||||
> &
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
import { openChecksPanelHostedReviewUrl } from '../checks-panel-hosted-review-click-routing'
|
||||
import { isMacPlatform } from '../../terminal-pane/terminal-link-open-hints'
|
||||
import { translate } from '@/i18n/i18n'
|
||||
import { isGitHubPRSuppressed } from '../../../../../shared/worktree/github-pr-suppression'
|
||||
import type { ChecksPanelEmptyContentModel } from './empty-content-props'
|
||||
|
||||
export function ChecksPanelEmptyContent({
|
||||
@@ -53,6 +54,7 @@ export function ChecksPanelEmptyContent({
|
||||
isRemoteOperationActive,
|
||||
isSyncingBranch,
|
||||
linkedGitLabMR,
|
||||
linkedPR,
|
||||
linkedReviewNumber,
|
||||
panelContextKey,
|
||||
prAiGenerationEnabled,
|
||||
@@ -67,6 +69,7 @@ export function ChecksPanelEmptyContent({
|
||||
prGenerateDisabledReason,
|
||||
prGenerateError,
|
||||
prGenerating,
|
||||
prNumber,
|
||||
prRepoDefaultBaseRef,
|
||||
prStackedCreationSupported,
|
||||
prTitle,
|
||||
@@ -117,7 +120,9 @@ export function ChecksPanelEmptyContent({
|
||||
)
|
||||
}
|
||||
|
||||
if (!activeReview && linkedReviewNumber === null && suppressedGitHubPR !== null) {
|
||||
const currentGitHubPRIsSuppressed =
|
||||
prNumber !== null && isGitHubPRSuppressed({ linkedPR, suppressedGitHubPR }, prNumber)
|
||||
if (!activeReview && linkedReviewNumber === null && currentGitHubPRIsSuppressed) {
|
||||
return (
|
||||
<div className="px-4 py-6">
|
||||
<div className="text-sm font-medium text-foreground">
|
||||
|
||||
+39
@@ -43,7 +43,9 @@ describe('checks panel concrete content', () => {
|
||||
activeReview: null,
|
||||
activeWorktree: { id: 'worktree-1' },
|
||||
isFolder: false,
|
||||
linkedPR: null,
|
||||
linkedReviewNumber: null,
|
||||
prNumber: 42,
|
||||
suppressedGitHubPR: 42 as number | null,
|
||||
handleLinkSuppressedPullRequest: handleLinkSuppressedPullRequest as () => void
|
||||
} as ChecksPanelEmptyContentModel
|
||||
@@ -57,6 +59,43 @@ describe('checks panel concrete content', () => {
|
||||
expect(screen.queryByText(/Create PR/)).toBeNull()
|
||||
})
|
||||
|
||||
it('does not apply stale suppression to a branch with no matching pull request', () => {
|
||||
const model = {
|
||||
activeReview: null,
|
||||
activeWorktree: { id: 'worktree-1' },
|
||||
branch: 'without-pr',
|
||||
checksPanelHasHardRefreshError: false,
|
||||
checksPanelReviewLookup: 'not_found',
|
||||
checksPanelReviewLookupResult: { openReviewUrl: null },
|
||||
confirmedReadiness: { confirmed: false, needsPush: false },
|
||||
conflictOperation: 'unknown',
|
||||
createComposerOpen: false,
|
||||
detachedHeadDisplay: null,
|
||||
gitStatusInputs: { hasUncommittedChanges: false },
|
||||
gitStatusProbeErrorContextKey: null,
|
||||
hardRefreshError: null,
|
||||
hostedReviewCreateCopy: { providerName: 'GitHub' },
|
||||
hostedReviewCreateProvider: 'github',
|
||||
hostedReviewCreation: null,
|
||||
isFolder: false,
|
||||
isGitHubReviewContext: true,
|
||||
isPublishingBranch: false,
|
||||
linkedGitLabMR: null,
|
||||
linkedPR: null,
|
||||
linkedReviewNumber: null,
|
||||
panelContextKey: 'worktree-1::without-pr',
|
||||
prNumber: null,
|
||||
publishActionHasUncommittedChanges: false,
|
||||
sourceControlAiActionsVisible: false,
|
||||
suppressedGitHubPR: 42
|
||||
} as ChecksPanelEmptyContentModel
|
||||
|
||||
render(<ChecksPanelEmptyContent model={model} />)
|
||||
|
||||
expect(screen.getByText('No pull request found')).toBeTruthy()
|
||||
expect(screen.queryByText('Pull request unlinked')).toBeNull()
|
||||
})
|
||||
|
||||
it('renders the active review header and empty check/comment sections with accessible actions', () => {
|
||||
const model = {
|
||||
activeConnectionId: null,
|
||||
|
||||
Reference in New Issue
Block a user