@@ -271,6 +271,7 @@ import { waitForThreadShellReady } from "./threadForkNavigation";
271271import { resolveUserMessageIntentBadge } from "./userMessageIntentBadge" ;
272272import { fileChipClipboardPath , fileChipMenu , resolveFileChipTarget } from "./fileChipMenu" ;
273273import { useFileChipShare } from "./useFileChipShare" ;
274+ import { useOpenLinkedThread } from "./useOpenLinkedThread" ;
274275import {
275276 MarkdownImageAvailableWidthContext ,
276277 ThreadMarkdownImage ,
@@ -1062,13 +1063,13 @@ function OpenSenderThreadButton(props: {
10621063 readonly environmentId : EnvironmentId ;
10631064 readonly senderThreadId : ThreadId ;
10641065} ) {
1065- const navigation = useNavigation ( ) ;
1066+ const openLinkedThread = useOpenLinkedThread ( ) ;
10661067 return (
10671068 < Pressable
10681069 accessibilityRole = "link"
10691070 hitSlop = { 6 }
10701071 onPress = { ( ) =>
1071- navigation . navigate ( "Thread" , {
1072+ openLinkedThread ( {
10721073 environmentId : String ( props . environmentId ) ,
10731074 threadId : String ( props . senderThreadId ) ,
10741075 } )
@@ -1804,6 +1805,7 @@ type UserMessageContentProps = {
18041805function UserMessageContent ( props : UserMessageContentProps ) {
18051806 const [ selected , setSelected ] = useState < { contextId : string ; label : string } | null > ( null ) ;
18061807 const navigation = useNavigation ( ) ;
1808+ const openLinkedThread = useOpenLinkedThread ( ) ;
18071809 const { selectedThread } = useThreadSelection ( ) ;
18081810 const liveText = useLiveThreadLinkLabels ( props . text , props . environmentId ) ;
18091811 const threadIcons = useThreadChipIcons ( props . environmentId , liveText , props . context ?. records ) ;
@@ -1822,7 +1824,7 @@ function UserMessageContent(props: UserMessageContentProps) {
18221824 return ;
18231825 }
18241826 if ( record ?. kind === "thread" && "threadId" in record ) {
1825- navigation . navigate ( "Thread" , {
1827+ openLinkedThread ( {
18261828 environmentId : String ( record . environmentId ) ,
18271829 threadId : String ( record . threadId ) ,
18281830 } ) ;
@@ -2033,6 +2035,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
20332035 const duoColumns = useNativeWorkspaceColumnsSupported ( ) && isDuoDevice ( deviceType ) ;
20342036 const openPullRequest = useOpenPullRequest ( ) ;
20352037 const navigation = useNavigation ( ) ;
2038+ const openLinkedThread = useOpenLinkedThread ( ) ;
20362039 const onOpenTurnDiff = useCallback (
20372040 ( checkpoint : ThreadCheckpointSummary ) => {
20382041 setReviewSelectedSectionId (
@@ -2217,7 +2220,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
22172220 }
22182221 const target = resolveLinkedThread ( href ) ;
22192222 if ( target ) {
2220- navigation . navigate ( "Thread" , {
2223+ openLinkedThread ( {
22212224 environmentId : String ( target . environmentId ) ,
22222225 threadId : String ( target . threadId ) ,
22232226 } ) ;
0 commit comments