Skip to content
TypeScript

fix(mobile): back from a finished subagent in the feed returns to its parent (#15844)

AKolenda1604ccc9d79f
diff --git a/apps/mobile/src/features/threads/thread-work-log.tsx b/apps/mobile/src/features/threads/thread-work-log.tsx
index dd2ebeb76ff..96d275235ea 100644
--- a/apps/mobile/src/features/threads/thread-work-log.tsx
+++ b/apps/mobile/src/features/threads/thread-work-log.tsx
@@ -18,7 +18,7 @@ import { type AppSymbolName, SymbolView } from "../../components/AppSymbol";
import { MaskedView } from "@expo/ui/community/masked-view";
import type { LegendListRef } from "@legendapp/list/react-native";
import { AnimatedLegendList } from "@legendapp/list/reanimated";
-import { useIsFocused, useNavigation } from "@react-navigation/native";
+import { StackActions, useIsFocused, useNavigation } from "@react-navigation/native";
import {
memo,
useCallback,
@@ -1004,10 +1004,14 @@ const ThreadWorkLogRow = memo(function ThreadWorkLogRow(
accessibilityState={canExpand ? { expanded } : undefined}
onPress={() => {
if (notifiedSubagentThreadId !== undefined) {
- navigation.navigate("Thread", {
- environmentId: String(props.environmentId),
- threadId: String(notifiedSubagentThreadId),
- });
+ // Push, not navigate: navigate reuses this Thread route, so back
+ // would skip the parent thread and land on Home (matches #15068).
+ navigation.dispatch(
+ StackActions.push("Thread", {
+ environmentId: String(props.environmentId),
+ threadId: String(notifiedSubagentThreadId),
+ }),
+ );
return;
}
if (canExpand) {