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

This commit is contained in:
AKolenda authored and GitHub committed 2026-10-05 08:27:23 -05:00
1 parent 1a3f7ad508
commit 1604ccc9d7
1 file changed
+9 -5
@@ -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) {