@@ -28,14 +28,14 @@ import { HomeScreen } from "./HomeScreen";
2828import { HomeHeader } from "./HomeHeader" ;
2929import { useHomeListOptions } from "./home-list-options" ;
3030import { useAtomValueWhileVisible , useHomeRouteVisible } from "./home-route-visibility" ;
31- import { useHomeThreadRouteSelection , useHomeThreadSelection } from "./home-thread-navigation" ;
3231import { buildHomeProjectScopes } from "./homeThreadList" ;
3332import { usePendingTaskListActions } from "./usePendingTaskListActions" ;
3433import { useThreadListActions } from "./useThreadListActions" ;
3534import { getConnectionAwareBrandHeaderOptions } from "./WorkspaceConnectionTitle" ;
3635import { useWorkspaceTabs } from "../workspace/WorkspaceTabsContext" ;
3736import { openSettings } from "../settings/settings-navigation" ;
3837import { useSelectWorkspaceTab } from "../workspace/useSelectWorkspaceTab" ;
38+ import { useSelectWorkspaceDetail } from "../workspace/useSelectWorkspaceDetail" ;
3939
4040export function HomeRouteScreen ( ) {
4141 const { width : windowWidth } = useWindowDimensions ( ) ;
@@ -45,6 +45,7 @@ export function HomeRouteScreen() {
4545 const headerWidth = nativePrimaryColumn ? ( columnMetrics ?. width ?? windowWidth ) : windowWidth ;
4646 const { layout, panes, primarySidebarSearchQuery, setPrimarySidebarSearchQuery, startNewTask } =
4747 useAdaptiveWorkspaceLayout ( ) ;
48+ const selectDetail = useSelectWorkspaceDetail ( ) ;
4849 const projects = useProjects ( ) ;
4950 // Stop rebuilding the streaming thread list while Thread covers Home.
5051 const visible = useHomeRouteVisible ( ) ;
@@ -67,8 +68,18 @@ export function HomeRouteScreen() {
6768 else if ( workspace ) workspace . dispatch ( { type : "query" , query, tab : "threads" } ) ;
6869 else setLocalSearchQuery ( query ) ;
6970 } ;
70- const handleSelectThread = useHomeThreadSelection ( ) ;
71- const selectThreadRoute = useHomeThreadRouteSelection ( ) ;
71+ const handleSelectThread = useCallback (
72+ ( thread : EnvironmentThreadShell ) =>
73+ selectDetail ( {
74+ name : "Thread" ,
75+ params : { environmentId : String ( thread . environmentId ) , threadId : String ( thread . id ) } ,
76+ } ) ,
77+ [ selectDetail ] ,
78+ ) ;
79+ const selectThreadRoute = useCallback (
80+ ( params : ReactNavigation . RootParamList [ "Thread" ] ) => selectDetail ( { name : "Thread" , params } ) ,
81+ [ selectDetail ] ,
82+ ) ;
7283 const handleNewThreadOnBranch = useCallback (
7384 ( thread : EnvironmentThreadShell ) => {
7485 selectThreadRoute ( {
@@ -104,7 +115,8 @@ export function HomeRouteScreen() {
104115 unsettleThread,
105116 } = useThreadListActions ( ) ;
106117 const pendingTasks = usePendingNewTasks ( ) ;
107- const { openPendingTask, confirmDeletePendingTask } = usePendingTaskListActions ( ) ;
118+ const { openPendingTask, confirmDeletePendingTask } =
119+ usePendingTaskListActions ( selectThreadRoute ) ;
108120 const environments = useMemo ( ( ) => {
109121 const connectionStateByEnvironmentId = new Map (
110122 workspaceEnvironments . map (
0 commit comments