@@ -31,7 +31,7 @@ import { canSnooze } from "@t3tools/client-runtime/state/thread-settled";
3131import { threadChipCopyTarget } from "@t3tools/client-runtime/thread-reference" ;
3232import type { MenuAction } from "@react-native-menu/menu" ;
3333import { memo , useCallback , useMemo , useState , type ComponentProps } from "react" ;
34- import { Platform , Pressable , useWindowDimensions , View } from "react-native" ;
34+ import { Platform , Pressable , Text as RNText , useWindowDimensions , View } from "react-native" ;
3535import type { SwipeableMethods } from "react-native-gesture-handler/ReanimatedSwipeable" ;
3636
3737import type { ThreadListProvider } from "../../state/thread-list-environments" ;
@@ -84,7 +84,8 @@ import { PullRequestGlyph } from "../pull-requests/pullRequestGlyphs";
8484import { pullRequestStatus } from "../pull-requests/pullRequestStatus" ;
8585
8686interface StatusLabel {
87- readonly label : string ;
87+ // Null when the icon and timer carry the status on their own.
88+ readonly label : string | null ;
8889 readonly icon : AppSymbolName ;
8990 readonly className : string ;
9091 readonly iconTintClassName : string ;
@@ -109,13 +110,13 @@ const STATUS_LABEL_BY_STATUS: Partial<Record<ThreadListV2Status, StatusLabel>> =
109110 iconTintClassName : "accent-adaptive-fuchsia-600-300" ,
110111 } ,
111112 working : {
112- label : "Working" ,
113+ label : null ,
113114 icon : "circle.dashed" ,
114115 className : "text-adaptive-sky-600-400" ,
115116 iconTintClassName : "accent-adaptive-sky-600-400" ,
116117 } ,
117118 waiting : {
118- label : "Waiting" ,
119+ label : null ,
119120 icon : "circle.dashed.inset.filled" ,
120121 className : "text-foreground-muted" ,
121122 iconTintClassName : "accent-foreground-muted" ,
@@ -140,11 +141,28 @@ const DONE_STATUS_LABEL: StatusLabel = {
140141 iconTintClassName : "accent-adaptive-emerald-700-300" ,
141142} ;
142143
143- function ThreadListV2Duration ( props : { readonly startedAt : string | null } ) {
144+ // DM Sans has no tabular figures, so a ticking timer in it reflows the row every second.
145+ const TABULAR_DURATION_STYLE = {
146+ fontFamily : Platform . OS === "ios" ? "System" : "sans-serif" ,
147+ fontWeight : "700" ,
148+ fontVariant : [ "tabular-nums" ] ,
149+ } as const ;
150+
151+ function ThreadListV2Duration ( props : {
152+ readonly startedAt : string | null ;
153+ readonly leadingSpace : boolean ;
154+ } ) {
144155 const startedAtMs = Date . parse ( props . startedAt ?? "" ) ;
145156 const nowMs = useVisibleSecondClock ( Number . isFinite ( startedAtMs ) ) ;
146157 if ( ! Number . isFinite ( startedAtMs ) ) return null ;
147- return ` ${ formatWorkingDurationLabel ( nowMs - startedAtMs ) } ` ;
158+ return (
159+ < >
160+ { props . leadingSpace ? " " : null }
161+ < RNText style = { TABULAR_DURATION_STYLE } >
162+ { formatWorkingDurationLabel ( nowMs - startedAtMs ) }
163+ </ RNText >
164+ </ >
165+ ) ;
148166}
149167
150168const CARD_MENU_ACTIONS : MenuAction [ ] = [
@@ -1218,15 +1236,20 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
12181236 < Text
12191237 className = { cn (
12201238 "text-xs font-t3-bold" ,
1221- ( status === "working" || status === "waiting" ) && "tabular-nums" ,
12221239 selected ? selectedThreadRowColors . foregroundClassName : statusLabel . className ,
12231240 ) }
12241241 >
12251242 { statusLabel . label }
12261243 { status === "working" ? (
1227- < ThreadListV2Duration startedAt = { resolveThreadWorkingStartedAt ( thread ) } />
1244+ < ThreadListV2Duration
1245+ startedAt = { resolveThreadWorkingStartedAt ( thread ) }
1246+ leadingSpace = { statusLabel . label !== null }
1247+ />
12281248 ) : status === "waiting" ? (
1229- < ThreadListV2Duration startedAt = { thread . latestRun ?. completedAt ?? null } />
1249+ < ThreadListV2Duration
1250+ startedAt = { thread . latestRun ?. completedAt ?? null }
1251+ leadingSpace = { statusLabel . label !== null }
1252+ />
12301253 ) : null }
12311254 </ Text >
12321255 </ View >
0 commit comments