diff --git a/src/renderer/src/components/GitHubItemDialog.tsx b/src/renderer/src/components/GitHubItemDialog.tsx index da12c35e0..4c709fe12 100644 --- a/src/renderer/src/components/GitHubItemDialog.tsx +++ b/src/renderer/src/components/GitHubItemDialog.tsx @@ -3794,7 +3794,7 @@ function ChecksTab({
Annotations
-
+
{details!.annotations.map((annotation, index) => (
{annotation.rawDetails && ( -
+                        
                           {annotation.rawDetails}
                         
)} @@ -3838,7 +3838,7 @@ function ChecksTab({
Jobs
-
+
{details!.jobs.map((job, index) => (
Annotations
-
+
{details!.annotations.map((annotation, index) => (
{annotation.rawDetails && ( -
+                        
                           {annotation.rawDetails}
                         
)} @@ -4092,7 +4092,7 @@ function ChecksTab({
Jobs
-
+
{details!.jobs.map((job, index) => (
0 return (
{/* Hosted review header */} @@ -2487,32 +2488,25 @@ export default function ChecksPanel(): React.JSX.Element { )}
+ {shouldShowReviewTriageStrip && ( + void handleResolveConflictsWithAI()} + resolveConflictsDisabled={Boolean(aiActionDisabledReason)} + resolveConflictsDisabledReason={aiActionDisabledReason} + isFixingChecksWithAI={isFixingChecksWithAI} + onFixChecksWithAI={() => void handleFixChecksWithAI()} + fixChecksDisabled={Boolean(aiActionDisabledReason)} + fixChecksDisabledReason={aiActionDisabledReason} + /> + )} {activeConflictReview && ( <> {/* Why: the triage strip owns the single Resolve action for PR and MR conflicts; the file list and fallback notice are informational. */} - {pr ? ( - void handleResolveConflictsWithAI()} - resolveConflictsDisabled={Boolean(aiActionDisabledReason)} - resolveConflictsDisabledReason={aiActionDisabledReason} - isFixingChecksWithAI={isFixingChecksWithAI} - onFixChecksWithAI={() => void handleFixChecksWithAI()} - fixChecksDisabled={Boolean(aiActionDisabledReason)} - fixChecksDisabledReason={aiActionDisabledReason} - /> - ) : ( - void handleResolveConflictsWithAI()} - resolveConflictsDisabled={Boolean(aiActionDisabledReason)} - resolveConflictsDisabledReason={aiActionDisabledReason} - /> - )} { expect(markup).toContain('Resolve') expect(markup).toContain('lucide-sparkles') }) + + it('renders the CI fix action for failing non-conflict checks', () => { + const markup = renderToStaticMarkup( + React.createElement(PRTriageStrip, { + review: makePR({ mergeable: 'MERGEABLE' }), + checks: [{ name: 'verify', status: 'completed', conclusion: 'failure', url: null }], + isResolvingConflictsWithAI: false, + onResolveConflictsWithAI: () => {}, + isFixingChecksWithAI: false, + onFixChecksWithAI: () => {} + }) + ) + + expect(markup).toContain('1 failing check') + expect(markup).toContain('Fix') + expect(markup).toContain('data-variant="outline"') + expect(markup).toContain('lucide-sparkles') + expect(markup).not.toContain('Fix with AI') + expect(markup).not.toContain('Resolve') + }) +}) + +describe('ChecksList', () => { + it('puts the hosted details link in the check row as an icon affordance', () => { + const markup = renderToStaticMarkup( + React.createElement( + TooltipProvider, + null, + React.createElement(ChecksList, { + checks: [ + { + name: 'verify', + status: 'completed', + conclusion: 'failure', + url: 'https://github.com/acme/widgets/actions/runs/1' + } + ], + checksLoading: false, + checkDetailsContextKey: 'repo:42', + onLoadCheckDetails: async () => null + }) + ) + ) + + expect(markup).toContain('aria-label="Open check details"') + expect(markup).toContain('lucide-external-link') + expect(markup).toContain('Failed') + expect(markup.indexOf('Failed')).toBeLessThan(markup.indexOf('aria-label="Open check details"')) + expect(markup).toContain('text-muted-foreground') + expect(markup).not.toContain('opacity-0') + expect(markup).not.toContain('Open details') + }) }) describe('PRCommentsList', () => { diff --git a/src/renderer/src/components/right-sidebar/checks-panel-content.tsx b/src/renderer/src/components/right-sidebar/checks-panel-content.tsx index 809e69bd1..9190a383c 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel-content.tsx +++ b/src/renderer/src/components/right-sidebar/checks-panel-content.tsx @@ -17,9 +17,7 @@ import { ChevronRight, Sparkles, RefreshCw, - Wrench, - AlertTriangle, - Maximize2 + AlertTriangle } from 'lucide-react' import { ExternalLink } from 'lucide-react' import { Button } from '@/components/ui/button' @@ -162,7 +160,9 @@ export function MergeConflictNotice({ } export function PRTriageStrip({ + review, pr, + reviewKind = 'PR', checks, isResolvingConflictsWithAI, onResolveConflictsWithAI, @@ -173,7 +173,9 @@ export function PRTriageStrip({ fixChecksDisabled, fixChecksDisabledReason }: { - pr: PRInfo + review?: ConflictReview + pr?: ConflictReview + reviewKind?: 'PR' | 'MR' checks: PRCheckDetail[] isResolvingConflictsWithAI: boolean onResolveConflictsWithAI: () => void @@ -184,15 +186,16 @@ export function PRTriageStrip({ fixChecksDisabled?: boolean fixChecksDisabledReason?: string }): React.JSX.Element { + const resolvedReview = review ?? pr const failingCount = checks.filter((check) => isFailedCheck(check)).length const pendingCount = checks.filter( (check) => check.conclusion === 'pending' || check.conclusion === null ).length - if (pr.mergeable === 'CONFLICTING') { + if (resolvedReview?.mergeable === 'CONFLICTING') { return ( @@ -486,7 +489,7 @@ function CheckRunDetails({
Annotations
-
+
{details!.annotations.map((annotation, index) => (
@@ -509,7 +512,7 @@ function CheckRunDetails({ {annotation.message}
{annotation.rawDetails && ( -
+                      
                         {annotation.rawDetails}
                       
)} @@ -529,7 +532,7 @@ function CheckRunDetails({
{failedJobs.length > 0 ? 'Failed jobs' : 'Jobs'}
-
+
{jobs.map((job, index) => (
@@ -581,19 +584,18 @@ function CheckRunDetails({
)} -
+
{!state?.loading && ( )} - {openUrl && ( - - )}
)} @@ -829,8 +816,11 @@ export function ChecksList({ ) const detailsContextRef = useRef(checkDetailsContextKey) const autoExpandedContextRef = useRef(null) + // Why: expanded check details already sit inside the sidebar scroller; keeping + // the list scroller too creates nested scrollbars around CI annotations. + const shouldConstrainCheckList = checksExpanded && expandedCheckKeys.size === 0 const { detailsHeight, handleResizeStart } = useCheckDetailsResize( - checksExpanded && checks.length > 0 + shouldConstrainCheckList && checks.length > 0 ) detailsContextRef.current = checkDetailsContextKey const sorted = React.useMemo( @@ -1024,8 +1014,8 @@ export function ChecksList({ ) : !checksExpanded ? null : ( <>
{rows.map((row) => { const check = row.check @@ -1033,11 +1023,12 @@ export function ChecksList({ const Icon = CHECK_ICON[conclusion] ?? CircleDashed const color = CHECK_COLOR[conclusion] ?? 'text-muted-foreground' const expanded = expandedCheckKeys.has(row.key) + const openUrl = check.url return (
toggleCheckExpanded(row)} @@ -1058,8 +1049,32 @@ export function ChecksList({ {check.name} - - {getCheckStatusLabel(check)} + + + {getCheckStatusLabel(check)} + + {openUrl && ( + + + + + + Open check details + + + )}
{expanded && } @@ -1067,15 +1082,17 @@ export function ChecksList({ ) })}
-
-
-
+ {shouldConstrainCheckList && ( +
+
+
+ )} {checks.length >= 100 && (
Showing first 100 checks