From 519cc5d1c352a798e15b2240b79c83fdbe5009cd Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Wed, 10 Jun 2026 20:15:32 -0700 Subject: [PATCH] fix: remove checks panel response badge (#5147) --- .../components/right-sidebar/ChecksPanel.tsx | 99 ------------------- 1 file changed, 99 deletions(-) diff --git a/src/renderer/src/components/right-sidebar/ChecksPanel.tsx b/src/renderer/src/components/right-sidebar/ChecksPanel.tsx index d58d3a428..eb2ecf4c1 100644 --- a/src/renderer/src/components/right-sidebar/ChecksPanel.tsx +++ b/src/renderer/src/components/right-sidebar/ChecksPanel.tsx @@ -70,13 +70,7 @@ import type { import { getHostedReviewCacheKey, refreshHostedReviewCard } from '@/store/slices/hosted-review' import { toast } from 'sonner' import { useConfirmationDialog } from '@/components/confirmation-dialog' -import { - classifyHostedReview, - type HostedReviewClassificationOptions -} from '../../../../shared/hosted-review-queue' -import { hostedReviewSummaryFromGitHubPRInfo } from '../../../../shared/hosted-review-github' import { type ChecksPanelReview, gitHubPRToChecksPanelReview } from './checks-panel-review' -import { hostedReviewSummaryFromGitLabInfo } from '../../../../shared/hosted-review-gitlab' import { checksPanelAsyncResultKey, checksPanelHostedReviewAsyncResultKey, @@ -358,7 +352,6 @@ export default function ChecksPanel(): React.JSX.Element { const [checksLoading, setChecksLoading] = useState(false) const [comments, setComments] = useState([]) const [commentsLoading, setCommentsLoading] = useState(false) - const [gitLabDetailsFetchedAt, setGitLabDetailsFetchedAt] = useState(null) const [emptyRefreshing, setEmptyRefreshing] = useState(false) const [isRefreshing, setIsRefreshing] = useState(false) const [conflictDetailsRefreshing, setConflictDetailsRefreshing] = useState(false) @@ -482,7 +475,6 @@ export default function ChecksPanel(): React.JSX.Element { setChecksLoading(false) setComments([]) setCommentsLoading(false) - setGitLabDetailsFetchedAt(null) setIsRefreshing(false) setEmptyRefreshing(false) setConflictDetailsRefreshing(false) @@ -1066,7 +1058,6 @@ export default function ChecksPanel(): React.JSX.Element { const result = gitLabPipelineJobsToPRChecks(details?.pipelineJobs ?? []) setChecks(result) setComments(gitLabMRCommentsToPRComments(details?.comments)) - setGitLabDetailsFetchedAt(Date.now()) const signature = JSON.stringify(result.map((c) => `${c.name}:${c.status}:${c.conclusion}`)) pollIntervalRef.current = signature === prevChecksRef.current @@ -1080,7 +1071,6 @@ export default function ChecksPanel(): React.JSX.Element { console.warn('Failed to fetch GitLab MR checks:', err) setChecks([]) setComments([]) - setGitLabDetailsFetchedAt(null) } finally { if (isCurrentAsyncResult(requestKey)) { setChecksLoading(false) @@ -2337,82 +2327,6 @@ export default function ChecksPanel(): React.JSX.Element { ] ) - const activeReviewClassification = React.useMemo(() => { - if (!repo) { - return null - } - const options: HostedReviewClassificationOptions = { - agentAuthorLogins: [], - viewer: null - } - if (activeGitLabReview) { - const commentsForClassification = - gitLabDetailsFetchedAt !== null && !commentsLoading ? comments : undefined - const summary = hostedReviewSummaryFromGitLabInfo({ - review: activeGitLabReview, - comments: commentsForClassification, - checks - }) - return classifyHostedReview(summary, options) - } - if (!pr) { - return null - } - let host = 'github.com' - let owner = 'unknown' - let repoName = 'unknown' - try { - const parsed = new URL(pr.url) - host = parsed.host || host - const segments = parsed.pathname.split('/').filter(Boolean) - if (segments.length >= 2) { - owner = segments[0] - repoName = segments[1] - } - } catch { - // Why: malformed URLs should not block queue-state classification. - } - - // Why: unresolved thread data is paginated and fetched separately. Until - // comments have loaded for this PR, do not let queue badges imply a clean review. - const commentsForClassification = - commentsFetchedAt !== undefined && !commentsLoading ? comments : undefined - const summary = hostedReviewSummaryFromGitHubPRInfo({ - pr, - owner, - repo: repoName, - host, - comments: commentsForClassification, - checks - }) - return classifyHostedReview(summary, options) - }, [ - activeGitLabReview, - repo, - gitLabDetailsFetchedAt, - commentsLoading, - comments, - checks, - pr, - commentsFetchedAt - ]) - - const queueBadges = React.useMemo(() => { - if (!activeReviewClassification) { - return [] as string[] - } - const badges: string[] = [] - if (activeReviewClassification.needsResponse) { - badges.push('Needs response') - } - // Why: viewer/author/requestedReviewer signals are not wired into the - // ChecksPanel call site yet, so `state` and `requested` would mis-classify - // every PR (collapsing to 'teammate'). Suppress those badges until the - // inputs are available; needs-response works from PR metadata alone and - // remains accurate. - return badges - }, [activeReviewClassification]) - // ── Empty state ── if (!activeWorktree) { return ( @@ -2649,19 +2563,6 @@ export default function ChecksPanel(): React.JSX.Element { {new Date(activeReview.updatedAt).toLocaleString()} )} - {queueBadges.length > 0 ? ( -
- {queueBadges.map((badge) => ( - - {badge} - - ))} -
- ) : null} - {/* Merge / Delete Workspace actions */} {activeReview && activeWorktree && repo && (