From 9f6f8bef268a462cc4dafbafed6a9759b1d92a50 Mon Sep 17 00:00:00 2001 From: AKolenda Date: Sun, 4 Oct 2026 20:13:41 -0600 Subject: [PATCH] fix(mobile): back from a finished subagent in the feed returns to its parent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #15068 pushed the agent's thread from the live subagent group card, but the "Subagent … finished" work-log row in the thread feed still called navigate("Thread"), which reuses the current Thread route. Opening a finished subagent that way dropped the parent from the stack, so back went straight to Home. Push it instead, matching the group card. --- .../src/features/threads/thread-work-log.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/mobile/src/features/threads/thread-work-log.tsx b/apps/mobile/src/features/threads/thread-work-log.tsx index dd2ebeb76ff6..96d275235ea1 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) {