Skip to content

Commit 1604ccc

Browse files
authored
fix(mobile): back from a finished subagent in the feed returns to its parent (pingdotgg#15844)
1 parent 1a3f7ad commit 1604ccc

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎apps/mobile/src/features/threads/thread-work-log.tsx‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { type AppSymbolName, SymbolView } from "../../components/AppSymbol";
1818
import { MaskedView } from "@expo/ui/community/masked-view";
1919
import type { LegendListRef } from "@legendapp/list/react-native";
2020
import { AnimatedLegendList } from "@legendapp/list/reanimated";
21-
import { useIsFocused, useNavigation } from "@react-navigation/native";
21+
import { StackActions, useIsFocused, useNavigation } from "@react-navigation/native";
2222
import {
2323
memo,
2424
useCallback,
@@ -1004,10 +1004,14 @@ const ThreadWorkLogRow = memo(function ThreadWorkLogRow(
10041004
accessibilityState={canExpand ? { expanded } : undefined}
10051005
onPress={() => {
10061006
if (notifiedSubagentThreadId !== undefined) {
1007-
navigation.navigate("Thread", {
1008-
environmentId: String(props.environmentId),
1009-
threadId: String(notifiedSubagentThreadId),
1010-
});
1007+
// Push, not navigate: navigate reuses this Thread route, so back
1008+
// would skip the parent thread and land on Home (matches #15068).
1009+
navigation.dispatch(
1010+
StackActions.push("Thread", {
1011+
environmentId: String(props.environmentId),
1012+
threadId: String(notifiedSubagentThreadId),
1013+
}),
1014+
);
10111015
return;
10121016
}
10131017
if (canExpand) {

0 commit comments

Comments
 (0)