@@ -12,10 +12,11 @@ import {
1212 type EnvironmentThreadSearchMatch ,
1313} from "@t3tools/client-runtime/state/thread-search" ;
1414import { sortPinnedThreadsByOrderKey } from "@t3tools/client-runtime/state/thread-sort" ;
15- import type {
16- EnvironmentId ,
17- SidebarProjectGroupingMode ,
18- SidebarThreadSortOrder ,
15+ import {
16+ type EnvironmentId ,
17+ resolveEnvironmentMachineKind ,
18+ type SidebarProjectGroupingMode ,
19+ type SidebarThreadSortOrder ,
1920} from "@t3tools/contracts" ;
2021import { useAtomSet , useAtomValue } from "@effect/atom-react" ;
2122import { AsyncResult } from "effect/unstable/reactivity" ;
@@ -612,6 +613,16 @@ export function HomeScreen(props: HomeScreenProps) {
612613 }
613614 return supported ;
614615 } , [ serverConfigs ] ) ;
616+ const machineByEnvironmentId = useMemo (
617+ ( ) =>
618+ new Map (
619+ [ ...serverConfigs ] . map (
620+ ( [ environmentId , config ] ) =>
621+ [ environmentId , resolveEnvironmentMachineKind ( config ) ] as const ,
622+ ) ,
623+ ) ,
624+ [ serverConfigs ] ,
625+ ) ;
615626 // Canonical arranged pinned order (reorder-capable threads only) for the
616627 // Move up/down position flags. Computed from all shells, not the rendered
617628 // list, so search/scope filtering never disables or misdirects a move.
@@ -740,6 +751,7 @@ export function HomeScreen(props: HomeScreenProps) {
740751 ?. environmentLabel ?? null )
741752 : null
742753 }
754+ environmentMachine = { machineByEnvironmentId . get ( item . pendingTask . message . environmentId ) }
743755 showPendingDivider = { item . showPendingDivider }
744756 showTrailingDivider = { showTrailingDivider }
745757 onSelectPendingTask = { props . onSelectPendingTask }
@@ -797,6 +809,7 @@ export function HomeScreen(props: HomeScreenProps) {
797809 ? ( props . savedConnectionsById [ thread . environmentId ] ?. environmentLabel ?? null )
798810 : null
799811 }
812+ environmentMachine = { machineByEnvironmentId . get ( thread . environmentId ) }
800813 searchMatch = { threadSearchMatchByKey . get (
801814 threadSearchMatchKey ( {
802815 environmentId : thread . environmentId ,
@@ -847,6 +860,7 @@ export function HomeScreen(props: HomeScreenProps) {
847860 handleSwipeableWillOpen ,
848861 handleUnsettleThread ,
849862 pinningEnvironmentIds ,
863+ machineByEnvironmentId ,
850864 pinReorderEnvironmentIds ,
851865 projectByKey ,
852866 projectCwdByKey ,
@@ -938,6 +952,9 @@ export function HomeScreen(props: HomeScreenProps) {
938952 props . savedConnectionsById [ item . pendingTask . message . environmentId ]
939953 ?. environmentLabel ?? null
940954 }
955+ environmentMachine = { machineByEnvironmentId . get (
956+ item . pendingTask . message . environmentId ,
957+ ) }
941958 isLast = { item . isLast }
942959 onSelectPendingTask = { props . onSelectPendingTask }
943960 onDeletePendingTask = { props . onDeletePendingTask }
@@ -952,6 +969,7 @@ export function HomeScreen(props: HomeScreenProps) {
952969 environmentLabel = {
953970 props . savedConnectionsById [ thread . environmentId ] ?. environmentLabel ?? null
954971 }
972+ environmentMachine = { machineByEnvironmentId . get ( thread . environmentId ) }
955973 projectCwd = {
956974 projectCwdByKey . get ( scopedProjectKey ( thread . environmentId , thread . projectId ) ) ??
957975 null
@@ -990,6 +1008,7 @@ export function HomeScreen(props: HomeScreenProps) {
9901008 handleSwipeableClose ,
9911009 handleSwipeableWillOpen ,
9921010 handleRegenerateThreadTitle ,
1011+ machineByEnvironmentId ,
9931012 projectCwdByKey ,
9941013 props . onArchiveThread ,
9951014 props . onDeletePendingTask ,
0 commit comments