@@ -6,8 +6,9 @@ import type {
66import type { MenuAction } from "@react-native-menu/menu" ;
77import { SymbolView } from "expo-symbols" ;
88import { memo , useCallback , useMemo , type ComponentProps } from "react" ;
9- import { Pressable , useWindowDimensions , View } from "react-native" ;
9+ import { Pressable , useColorScheme , useWindowDimensions , View } from "react-native" ;
1010import type { SwipeableMethods } from "react-native-gesture-handler/ReanimatedSwipeable" ;
11+ import Svg , { Circle , Path } from "react-native-svg" ;
1112
1213import { AppText as Text } from "../../components/AppText" ;
1314import { ControlPillMenu } from "../../components/ControlPill" ;
@@ -16,7 +17,7 @@ import { cn } from "../../lib/cn";
1617import { relativeTime } from "../../lib/time" ;
1718import { useThemeColor } from "../../lib/useThemeColor" ;
1819import type { PendingNewTask } from "../../state/use-pending-new-tasks" ;
19- import { useThreadPr } from "../../state/use-thread-pr" ;
20+ import { useThreadPr , type ThreadPr } from "../../state/use-thread-pr" ;
2021import type { HomeGroupDisplayAction } from "../home/homeListItems" ;
2122import { ThreadSwipeable } from "../home/thread-swipe-actions" ;
2223import { resolveThreadStatus } from "./threadPresentation" ;
@@ -33,6 +34,41 @@ export type ThreadListVariant = "compact" | "sidebar";
3334export const THREAD_LIST_COMPACT_INSET = 20 ;
3435const SIDEBAR_ROW_RADIUS = 12 ;
3536
37+ function pullRequestTintColor (
38+ state : ThreadPr [ "state" ] ,
39+ colorScheme : ReturnType < typeof useColorScheme > ,
40+ ) {
41+ const dark = colorScheme === "dark" ;
42+ switch ( state ) {
43+ case "open" :
44+ return dark ? "#34d399" : "#059669" ;
45+ case "merged" :
46+ return dark ? "#a78bfa" : "#7c3aed" ;
47+ case "closed" :
48+ return dark ? "#a1a1aa" : "#71717a" ;
49+ }
50+ }
51+
52+ function PullRequestIcon ( props : { readonly size : number ; readonly color : string } ) {
53+ return (
54+ < Svg
55+ width = { props . size }
56+ height = { props . size }
57+ viewBox = "0 0 24 24"
58+ fill = "none"
59+ stroke = { props . color }
60+ strokeWidth = { 2 }
61+ strokeLinecap = "round"
62+ strokeLinejoin = "round"
63+ >
64+ < Circle cx = { 18 } cy = { 18 } r = { 3 } />
65+ < Circle cx = { 6 } cy = { 6 } r = { 3 } />
66+ < Path d = "M13 6h3a2 2 0 0 1 2 2v7" />
67+ < Path d = "M6 9v12" />
68+ </ Svg >
69+ ) ;
70+ }
71+
3672/* ─── Project group header ───────────────────────────────────────────── */
3773
3874export const ThreadListGroupHeader = memo ( function ThreadListGroupHeader ( props : {
@@ -394,6 +430,7 @@ export const ThreadListRow = memo(function ThreadListRow(props: {
394430 > [ "simultaneousWithExternalGesture" ] ;
395431} ) {
396432 const { width : windowWidth } = useWindowDimensions ( ) ;
433+ const colorScheme = useColorScheme ( ) ;
397434 const compact = props . variant === "compact" ;
398435 const selected = props . selected === true ;
399436 // Recycling-safe: resets when the list container is reused for another
@@ -479,13 +516,22 @@ export const ThreadListRow = memo(function ThreadListRow(props: {
479516 </ >
480517 ) : null }
481518 { pr !== null ? (
482- < Text
483- className = { `${ compact ? "text-sm" : "text-xs" } font-t3-medium ${
484- selected ? "text-white" : pr . textClassName
485- } `}
519+ < View
520+ accessibilityLabel = { pr . accessibilityLabel }
521+ className = "flex-row items-center gap-0.5"
486522 >
487- { pr . label }
488- </ Text >
523+ < PullRequestIcon
524+ size = { compact ? 13 : 11 }
525+ color = { selected ? "#ffffff" : pullRequestTintColor ( pr . state , colorScheme ) }
526+ />
527+ < Text
528+ className = { `${ compact ? "text-sm" : "text-xs" } font-t3-medium ${
529+ selected ? "text-white" : pr . textClassName
530+ } `}
531+ >
532+ { pr . label }
533+ </ Text >
534+ </ View >
489535 ) : null }
490536 </ View >
491537 ) : null ;
0 commit comments