@@ -270,6 +270,7 @@ import { waitForThreadShellReady } from "./threadForkNavigation";
270270import { resolveUserMessageIntentBadge } from "./userMessageIntentBadge" ;
271271import { fileChipClipboardPath , fileChipMenu , resolveFileChipTarget } from "./fileChipMenu" ;
272272import { useFileChipShare } from "./useFileChipShare" ;
273+ import { useOpenLinkedThread } from "./useOpenLinkedThread" ;
273274import {
274275 MarkdownImageAvailableWidthContext ,
275276 ThreadMarkdownImage ,
@@ -1055,13 +1056,13 @@ function OpenSenderThreadButton(props: {
10551056 readonly environmentId : EnvironmentId ;
10561057 readonly senderThreadId : ThreadId ;
10571058} ) {
1058- const navigation = useNavigation ( ) ;
1059+ const openLinkedThread = useOpenLinkedThread ( ) ;
10591060 return (
10601061 < Pressable
10611062 accessibilityRole = "link"
10621063 hitSlop = { 6 }
10631064 onPress = { ( ) =>
1064- navigation . navigate ( "Thread" , {
1065+ openLinkedThread ( {
10651066 environmentId : String ( props . environmentId ) ,
10661067 threadId : String ( props . senderThreadId ) ,
10671068 } )
@@ -1797,6 +1798,7 @@ type UserMessageContentProps = {
17971798function UserMessageContent ( props : UserMessageContentProps ) {
17981799 const [ selected , setSelected ] = useState < { contextId : string ; label : string } | null > ( null ) ;
17991800 const navigation = useNavigation ( ) ;
1801+ const openLinkedThread = useOpenLinkedThread ( ) ;
18001802 const { selectedThread } = useThreadSelection ( ) ;
18011803 const liveText = useLiveThreadLinkLabels ( props . text , props . environmentId ) ;
18021804 const threadIcons = useThreadChipIcons ( props . environmentId , liveText , props . context ?. records ) ;
@@ -1815,7 +1817,7 @@ function UserMessageContent(props: UserMessageContentProps) {
18151817 return ;
18161818 }
18171819 if ( record ?. kind === "thread" && "threadId" in record ) {
1818- navigation . navigate ( "Thread" , {
1820+ openLinkedThread ( {
18191821 environmentId : String ( record . environmentId ) ,
18201822 threadId : String ( record . threadId ) ,
18211823 } ) ;
@@ -2026,6 +2028,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
20262028 const duoColumns = useNativeWorkspaceColumnsSupported ( ) && isDuoDevice ( deviceType ) ;
20272029 const openPullRequest = useOpenPullRequest ( ) ;
20282030 const navigation = useNavigation ( ) ;
2031+ const openLinkedThread = useOpenLinkedThread ( ) ;
20292032 const onOpenTurnDiff = useCallback (
20302033 ( checkpoint : ThreadCheckpointSummary ) => {
20312034 setReviewSelectedSectionId (
@@ -2210,7 +2213,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
22102213 }
22112214 const target = resolveLinkedThread ( href ) ;
22122215 if ( target ) {
2213- navigation . navigate ( "Thread" , {
2216+ openLinkedThread ( {
22142217 environmentId : String ( target . environmentId ) ,
22152218 threadId : String ( target . threadId ) ,
22162219 } ) ;
0 commit comments