@@ -261,6 +261,7 @@ import { waitForThreadShellReady } from "./threadForkNavigation";
261261import { resolveUserMessageIntentBadge } from "./userMessageIntentBadge" ;
262262import { fileChipClipboardPath , fileChipMenu , resolveFileChipTarget } from "./fileChipMenu" ;
263263import { useFileChipShare } from "./useFileChipShare" ;
264+ import { useOpenLinkedThread } from "./useOpenLinkedThread" ;
264265import {
265266 MarkdownImageAvailableWidthContext ,
266267 ThreadMarkdownImage ,
@@ -1025,13 +1026,13 @@ function OpenSenderThreadButton(props: {
10251026 readonly environmentId : EnvironmentId ;
10261027 readonly senderThreadId : ThreadId ;
10271028} ) {
1028- const navigation = useNavigation ( ) ;
1029+ const openLinkedThread = useOpenLinkedThread ( ) ;
10291030 return (
10301031 < Pressable
10311032 accessibilityRole = "link"
10321033 hitSlop = { 6 }
10331034 onPress = { ( ) =>
1034- navigation . navigate ( "Thread" , {
1035+ openLinkedThread ( {
10351036 environmentId : String ( props . environmentId ) ,
10361037 threadId : String ( props . senderThreadId ) ,
10371038 } )
@@ -1767,6 +1768,7 @@ type UserMessageContentProps = {
17671768function UserMessageContent ( props : UserMessageContentProps ) {
17681769 const [ selected , setSelected ] = useState < { contextId : string ; label : string } | null > ( null ) ;
17691770 const navigation = useNavigation ( ) ;
1771+ const openLinkedThread = useOpenLinkedThread ( ) ;
17701772 const { selectedThread } = useThreadSelection ( ) ;
17711773 const liveText = useLiveThreadLinkLabels ( props . text , props . environmentId ) ;
17721774 const text = replaceComposerContextReferences ( liveText , ( ref ) => {
@@ -1784,7 +1786,7 @@ function UserMessageContent(props: UserMessageContentProps) {
17841786 return ;
17851787 }
17861788 if ( record ?. kind === "thread" && "threadId" in record ) {
1787- navigation . navigate ( "Thread" , {
1789+ openLinkedThread ( {
17881790 environmentId : String ( record . environmentId ) ,
17891791 threadId : String ( record . threadId ) ,
17901792 } ) ;
@@ -1992,6 +1994,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
19921994 const duoColumns = useNativeWorkspaceColumnsSupported ( ) && isDuoDevice ( deviceType ) ;
19931995 const openPullRequest = useOpenPullRequest ( ) ;
19941996 const navigation = useNavigation ( ) ;
1997+ const openLinkedThread = useOpenLinkedThread ( ) ;
19951998 const onOpenTurnDiff = useCallback (
19961999 ( checkpoint : ThreadCheckpointSummary ) => {
19972000 setReviewSelectedSectionId (
@@ -2176,7 +2179,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
21762179 }
21772180 const target = resolveLinkedThread ( href ) ;
21782181 if ( target ) {
2179- navigation . navigate ( "Thread" , {
2182+ openLinkedThread ( {
21802183 environmentId : String ( target . environmentId ) ,
21812184 threadId : String ( target . threadId ) ,
21822185 } ) ;
0 commit comments