@@ -11,14 +11,23 @@ import {
1111 THREAD_LIST_V2_SIDEBAR_ROW_STYLE ,
1212 THREAD_LIST_V2_SIDEBAR_ROW_CONTAINER_STYLE ,
1313} from "../threads/thread-list-v2-row-appearance" ;
14- import { PullRequestAvatar , PullRequestDiffStats } from "./PullRequestPresentation" ;
14+ import {
15+ PullRequestAvatar ,
16+ PullRequestConflictBadge ,
17+ PullRequestDiffStats ,
18+ } from "./PullRequestPresentation" ;
1519import {
1620 pullRequestLabelColor ,
1721 pullRequestListReviewStatus ,
1822 pullRequestListRowsAreEqual ,
1923 type EnvironmentPullRequestListEntry ,
2024} from "./pullRequestList" ;
21- import { pullRequestStatus } from "./pullRequestStatus" ;
25+ import {
26+ pullRequestChecksStatus ,
27+ pullRequestConflict ,
28+ pullRequestStatus ,
29+ } from "./pullRequestStatus" ;
30+ import { PullRequestGlyph } from "./pullRequestGlyphs" ;
2231
2332export const PullRequestListRow = memo (
2433 function PullRequestListRow ( props : {
@@ -47,13 +56,9 @@ export const PullRequestListRow = memo(
4756 ? "text-drawer-foreground-muted"
4857 : "text-foreground-tertiary" ;
4958 const status = pullRequestStatus ( item ) ;
59+ const conflict = pullRequestConflict ( item ) ;
5060 const review = pullRequestListReviewStatus ( item ) ;
51- const checkTint =
52- item . checksState === "passing"
53- ? "accent-adaptive-emerald-600-400"
54- : item . checksState === "failing"
55- ? "accent-danger-foreground"
56- : "accent-warning-foreground" ;
61+ const checks = item . checksState ? pullRequestChecksStatus ( item . checksState ) : null ;
5762 return (
5863 < View style = { props . sidebar ? THREAD_LIST_V2_SIDEBAR_ROW_CONTAINER_STYLE : undefined } >
5964 < Menu
@@ -65,7 +70,7 @@ export const PullRequestListRow = memo(
6570 < Pressable
6671 accessibilityRole = "button"
6772 accessibilityState = { { selected : props . selected , busy : props . busy } }
68- accessibilityLabel = { `Pull request ${ item . number } , ${ item . title } , ${ status . label } , by ${ item . author ?. login ?? "unknown author" } ${ review ? `, ${ review . accessibleLabel } ` : "" } ${ item . checksState ? `, checks ${ item . checksState } ` : "" } ${ item . stack ? `, stack ${ item . stack . position } of ${ item . stack . size } ` : "" } ${ item . labels . length ? `, ${ item . labels . map ( ( label ) => label . name ) . join ( ", " ) } ` : "" } , ${ item . additions } additions, ${ item . deletions } deletions` }
73+ accessibilityLabel = { `Pull request ${ item . number } , ${ item . title } , ${ status . label } ${ conflict ? `, ${ conflict . label . toLowerCase ( ) } ` : "" } , by ${ item . author ?. login ?? "unknown author" } ${ review ? `, ${ review . accessibleLabel } ` : "" } ${ item . checksState ? `, checks ${ item . checksState } ` : "" } ${ item . stack ? `, stack ${ item . stack . position } of ${ item . stack . size } ` : "" } ${ item . labels . length ? `, ${ item . labels . map ( ( label ) => label . name ) . join ( ", " ) } ` : "" } , ${ item . additions } additions, ${ item . deletions } deletions` }
6974 accessibilityHint = "Double tap to open. Touch and hold for quick actions."
7075 onPress = { ( ) => props . onSelect ( item ) }
7176 disabled = { props . busy }
@@ -79,8 +84,19 @@ export const PullRequestListRow = memo(
7984 props . busy && "opacity-50" ,
8085 ) }
8186 >
82- < View className = { props . sidebar ? "pt-0.5" : "pt-2.5" } >
87+ < View className = { cn ( "self-start" , props . sidebar ? "pt-0.5" : "pt-2.5" ) } >
8388 < SymbolView name = { status . icon } size = { 20 } tintColorClassName = { status . tint } />
89+ { conflict ? (
90+ < PullRequestConflictBadge
91+ surfaceClassName = {
92+ props . selected
93+ ? "text-thread-selected"
94+ : props . sidebar
95+ ? "text-drawer"
96+ : "text-screen"
97+ }
98+ />
99+ ) : null }
84100 </ View >
85101 < View
86102 className = { cn (
@@ -96,7 +112,7 @@ export const PullRequestListRow = memo(
96112 { item . stack ? (
97113 < View className = "flex-row items-center gap-1" >
98114 < SymbolView
99- name = "square.3.layers.3d"
115+ name = { PullRequestGlyph . stack }
100116 size = { 12 }
101117 tintColorClassName = {
102118 props . selected
@@ -155,19 +171,9 @@ export const PullRequestListRow = memo(
155171 </ Text >
156172 ) : null }
157173 </ View >
158- { item . checksState ? (
174+ { checks ? (
159175 < View className = "shrink-0" accessibilityLabel = { `Checks ${ item . checksState } ` } >
160- < SymbolView
161- name = {
162- item . checksState === "passing"
163- ? "checkmark.circle"
164- : item . checksState === "failing"
165- ? "xmark.circle.fill"
166- : "clock"
167- }
168- size = { 13 }
169- tintColorClassName = { checkTint }
170- />
176+ < SymbolView name = { checks . icon } size = { 13 } tintColorClassName = { checks . tint } />
171177 </ View >
172178 ) : null }
173179 { review ? (
0 commit comments