add reqId to feed feedback (#8396)

Co-authored-by: Samuel Newman <mozzius@protonmail.com>
This commit is contained in:
hailey
2025-05-21 11:15:55 -07:00
committed by GitHub
parent e6c867a961
commit c16cd36b64
14 changed files with 200 additions and 183 deletions
+20 -10
View File
@@ -70,6 +70,7 @@ interface FeedItemProps {
isThreadLastChild?: boolean
isThreadParent?: boolean
feedContext: string | undefined
reqId: string | undefined
hideTopBorder?: boolean
isParentBlocked?: boolean
isParentNotFound?: boolean
@@ -80,6 +81,7 @@ export function PostFeedItem({
record,
reason,
feedContext,
reqId,
moderation,
parentAuthor,
showReplyTo,
@@ -117,6 +119,7 @@ export function PostFeedItem({
record={record}
reason={reason}
feedContext={feedContext}
reqId={reqId}
richText={richText}
parentAuthor={parentAuthor}
showReplyTo={showReplyTo}
@@ -140,6 +143,7 @@ let FeedItemInner = ({
record,
reason,
feedContext,
reqId,
richText,
moderation,
parentAuthor,
@@ -171,11 +175,12 @@ let FeedItemInner = ({
}, [post.uri, post.author])
const {sendInteraction} = useFeedFeedbackContext()
const onPressReply = useCallback(() => {
const onPressReply = () => {
sendInteraction({
item: post.uri,
event: 'app.bsky.feed.defs#interactionReply',
feedContext,
reqId,
})
openComposer({
replyTo: {
@@ -187,40 +192,44 @@ let FeedItemInner = ({
moderation,
},
})
}, [post, record, openComposer, moderation, sendInteraction, feedContext])
}
const onOpenAuthor = useCallback(() => {
const onOpenAuthor = () => {
sendInteraction({
item: post.uri,
event: 'app.bsky.feed.defs#clickthroughAuthor',
feedContext,
reqId,
})
}, [sendInteraction, post, feedContext])
}
const onOpenReposter = useCallback(() => {
const onOpenReposter = () => {
sendInteraction({
item: post.uri,
event: 'app.bsky.feed.defs#clickthroughReposter',
feedContext,
reqId,
})
}, [sendInteraction, post, feedContext])
}
const onOpenEmbed = useCallback(() => {
const onOpenEmbed = () => {
sendInteraction({
item: post.uri,
event: 'app.bsky.feed.defs#clickthroughEmbed',
feedContext,
reqId,
})
}, [sendInteraction, post, feedContext])
}
const onBeforePress = useCallback(() => {
const onBeforePress = () => {
sendInteraction({
item: post.uri,
event: 'app.bsky.feed.defs#clickthroughItem',
feedContext,
reqId,
})
precacheProfile(queryClient, post.author)
}, [queryClient, post, sendInteraction, feedContext])
}
const outerStyles = [
styles.outer,
@@ -437,6 +446,7 @@ let FeedItemInner = ({
onPressReply={onPressReply}
logContext="FeedItem"
feedContext={feedContext}
reqId={reqId}
threadgateRecord={threadgateRecord}
onShowLess={onShowLess}
/>