diff --git a/apps/mobile/src/features/threads/thread-subagent-group.tsx b/apps/mobile/src/features/threads/thread-subagent-group.tsx index c0f1adf4736e731d69b09c5f8005b7243baae4df..aacc2c07353f11ecf238b53df8657becb9a9baf9 100644 --- a/apps/mobile/src/features/threads/thread-subagent-group.tsx +++ b/apps/mobile/src/features/threads/thread-subagent-group.tsx @@ -1,5 +1,5 @@ import { useAtomValue } from "@effect/atom-react"; -import { useIsFocused, useNavigation } from "@react-navigation/native"; +import { StackActions, useIsFocused, useNavigation } from "@react-navigation/native"; import { scopeThreadRef } from "@t3tools/client-runtime/environment"; import { summarizeSubagentStatuses } from "@t3tools/client-runtime/state/subagent-display"; import { isActiveSubagentStatus } from "@t3tools/client-runtime/state/subagentRuntime"; @@ -158,11 +158,15 @@ export function ThreadSubagentGroup(props: { } disabled={threadId === null} onPress={() => { + // Push, not navigate: navigate reuses this Thread route, so back + // would skip the parent thread. if (threadId !== null) - navigation.navigate("Thread", { - environmentId: String(props.environmentId), - threadId: String(threadId), - }); + navigation.dispatch( + StackActions.push("Thread", { + environmentId: String(props.environmentId), + threadId: String(threadId), + }), + ); }} className="rounded-lg px-3 py-3 active:bg-subtle" >