@@ -3,7 +3,11 @@ import type {
33 EnvironmentThreadShell ,
44} from "@t3tools/client-runtime/state/shell" ;
55import { LegendList } from "@legendapp/list/react-native" ;
6- import type { EnvironmentId } from "@t3tools/contracts" ;
6+ import {
7+ type EnvironmentId ,
8+ type EnvironmentMachineKind ,
9+ resolveEnvironmentMachineKind ,
10+ } from "@t3tools/contracts" ;
711import type { MenuAction } from "@react-native-menu/menu" ;
812import { NativeHeaderToolbar , NativeStackScreenOptions } from "../../native/StackHeader" ;
913import { SymbolView } from "../../components/AppSymbol" ;
@@ -24,10 +28,12 @@ import type { SwipeableMethods } from "react-native-gesture-handler/ReanimatedSw
2428import { AppText as Text } from "../../components/AppText" ;
2529import { ControlPillMenu } from "../../components/ControlPill" ;
2630import { EmptyState } from "../../components/EmptyState" ;
31+ import { EnvironmentMachineSymbol } from "../../components/EnvironmentMachineSymbol" ;
2732import { ProjectFavicon } from "../../components/ProjectFavicon" ;
2833import { useSafeAreaInsets } from "react-native-safe-area-context" ;
2934import { relativeTime } from "../../lib/time" ;
3035import { useUniwindTheme } from "../../lib/useUniwindTheme" ;
36+ import { useServerConfigs } from "../../state/entities" ;
3137import { ThreadSwipeable } from "../home/thread-swipe-actions" ;
3238import {
3339 createNativeMailSearchToolbarItem ,
@@ -45,6 +51,7 @@ type ArchivedThreadListItem =
4551 readonly kind : "project" ;
4652 readonly key : string ;
4753 readonly environmentLabel : string | null ;
54+ readonly environmentMachine : EnvironmentMachineKind ;
4855 readonly project : EnvironmentProject ;
4956 }
5057 | {
@@ -360,6 +367,7 @@ function ArchivedThreadsHeader(props: {
360367
361368function ProjectGroupLabel ( props : {
362369 readonly environmentLabel : string | null ;
370+ readonly environmentMachine : EnvironmentMachineKind ;
363371 readonly project : EnvironmentProject ;
364372} ) {
365373 return (
@@ -378,9 +386,16 @@ function ProjectGroupLabel(props: {
378386 { props . project . title }
379387 </ Text >
380388 { props . environmentLabel ? (
381- < Text className = "max-w-[42%] text-2xs text-foreground-tertiary" numberOfLines = { 1 } >
382- { props . environmentLabel }
383- </ Text >
389+ < View className = "max-w-[42%] flex-row items-center gap-1" >
390+ < EnvironmentMachineSymbol
391+ kind = { props . environmentMachine }
392+ size = { 10 }
393+ tintColorClassName = "accent-foreground-tertiary"
394+ />
395+ < Text className = "shrink text-2xs text-foreground-tertiary" numberOfLines = { 1 } >
396+ { props . environmentLabel }
397+ </ Text >
398+ </ View >
384399 ) : null }
385400 </ View >
386401 ) ;
@@ -517,6 +532,7 @@ export function ArchivedThreadsScreen(props: {
517532 ) ,
518533 [ props . environments ] ,
519534 ) ;
535+ const serverConfigs = useServerConfigs ( ) ;
520536 const listItems = useMemo < ReadonlyArray < ArchivedThreadListItem > > ( ( ) => {
521537 const items : ArchivedThreadListItem [ ] = [ ] ;
522538 for ( const group of props . groups ) {
@@ -525,6 +541,9 @@ export function ArchivedThreadsScreen(props: {
525541 kind : "project" ,
526542 key : `${ group . key } :project` ,
527543 environmentLabel,
544+ environmentMachine : resolveEnvironmentMachineKind (
545+ serverConfigs . get ( group . project . environmentId ) ?? null ,
546+ ) ,
528547 project : group . project ,
529548 } ) ;
530549
@@ -540,7 +559,7 @@ export function ArchivedThreadsScreen(props: {
540559 } ) ;
541560 }
542561 return items ;
543- } , [ environmentLabelsById , props . groups ] ) ;
562+ } , [ environmentLabelsById , props . groups , serverConfigs ] ) ;
544563 const handleSwipeableWillOpen = useCallback ( ( methods : SwipeableMethods ) => {
545564 if ( openSwipeableRef . current && openSwipeableRef . current !== methods ) {
546565 openSwipeableRef . current . close ( ) ;
@@ -559,7 +578,11 @@ export function ArchivedThreadsScreen(props: {
559578 if ( item . kind === "project" ) {
560579 return (
561580 < View className = "pt-4" >
562- < ProjectGroupLabel environmentLabel = { item . environmentLabel } project = { item . project } />
581+ < ProjectGroupLabel
582+ environmentLabel = { item . environmentLabel }
583+ environmentMachine = { item . environmentMachine }
584+ project = { item . project }
585+ />
563586 </ View >
564587 ) ;
565588 }
0 commit comments