reply button in feeds opens thread (#9143)

* the reply button should open the replies to a post, not present a text input for you to enter your Big Thought into. i think a lot of people don’t even realize that the point has already been written

* Feature gate, fix event

---------

Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
easrng
2025-10-09 19:29:50 -06:00
committed by GitHub
parent 96d77841e0
commit b1dc5179b6
2 changed files with 38 additions and 19 deletions
+37 -19
View File
@@ -11,6 +11,7 @@ import {
} from '@atproto/api'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {useNavigation} from '@react-navigation/native'
import {useQueryClient} from '@tanstack/react-query'
import {useActorStatus} from '#/lib/actor-status'
@@ -19,6 +20,8 @@ import {MAX_POST_LINES} from '#/lib/constants'
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
import {usePalette} from '#/lib/hooks/usePalette'
import {makeProfileLink} from '#/lib/routes/links'
import {type NavigationProp} from '#/lib/routes/types'
import {useGate} from '#/lib/statsig/statsig'
import {sanitizeDisplayName} from '#/lib/strings/display-names'
import {sanitizeHandle} from '#/lib/strings/handles'
import {countLines} from '#/lib/strings/helpers'
@@ -167,35 +170,50 @@ let FeedItemInner = ({
}): React.ReactNode => {
const queryClient = useQueryClient()
const {openComposer} = useOpenComposer()
const navigation = useNavigation<NavigationProp>()
const pal = usePalette('default')
const gate = useGate()
const {_} = useLingui()
const [hover, setHover] = useState(false)
const href = useMemo(() => {
const [href, rkey] = useMemo(() => {
const urip = new AtUri(post.uri)
return makeProfileLink(post.author, 'post', urip.rkey)
return [makeProfileLink(post.author, 'post', urip.rkey), urip.rkey]
}, [post.uri, post.author])
const {sendInteraction, feedSourceInfo} = useFeedFeedbackContext()
const onPressReply = () => {
sendInteraction({
item: post.uri,
event: 'app.bsky.feed.defs#interactionReply',
feedContext,
reqId,
})
openComposer({
replyTo: {
uri: post.uri,
cid: post.cid,
text: record.text || '',
author: post.author,
embed: post.embed,
moderation,
langs: record.langs,
},
})
if (gate('feed_reply_button_open_thread')) {
sendInteraction({
item: post.uri,
event: 'app.bsky.feed.defs#clickthroughItem',
feedContext,
reqId,
})
navigation.navigate('PostThread', {
name: post.author.did,
rkey,
})
} else {
sendInteraction({
item: post.uri,
event: 'app.bsky.feed.defs#interactionReply',
feedContext,
reqId,
})
openComposer({
replyTo: {
uri: post.uri,
cid: post.cid,
text: record.text || '',
author: post.author,
embed: post.embed,
moderation,
langs: record.langs,
},
})
}
}
const onOpenAuthor = () => {