FeedFeedback fixes (#3968)
* Lower seen threshold to 1.5s * Send feedContext for replies * Use a simpler and more reliable feedContext fallback --------- Co-authored-by: Paul Frazee <pfrazee@gmail.com>zio/stable
parent
97750c4aab
commit
4458b03173
|
@ -71,6 +71,10 @@ export class FeedViewPostsSlice {
|
|||
?.__source as ReasonFeedSource
|
||||
}
|
||||
|
||||
get feedContext() {
|
||||
return this.items.find(item => item.feedContext)?.feedContext
|
||||
}
|
||||
|
||||
containsUri(uri: string) {
|
||||
return !!this.items.find(item => item.post.uri === uri)
|
||||
}
|
||||
|
|
|
@ -303,7 +303,7 @@ export function usePostFeedQuery(
|
|||
i === 0 && slice.source
|
||||
? slice.source
|
||||
: item.reason,
|
||||
feedContext: item.feedContext,
|
||||
feedContext: item.feedContext || slice.feedContext,
|
||||
moderation: moderations[i],
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ function ListImpl<ItemT>(
|
|||
},
|
||||
{
|
||||
itemVisiblePercentThreshold: 40,
|
||||
minimumViewTime: 2e3,
|
||||
minimumViewTime: 1.5e3,
|
||||
},
|
||||
]
|
||||
}, [onItemSeen])
|
||||
|
|
|
@ -27,7 +27,7 @@ export type ListProps<ItemT> = Omit<
|
|||
}
|
||||
export type ListRef = React.MutableRefObject<any | null> // TODO: Better types.
|
||||
|
||||
const ON_ITEM_SEEN_WAIT_DURATION = 2e3 // post must be "seen" 2 seconds before capturing
|
||||
const ON_ITEM_SEEN_WAIT_DURATION = 1.5e3 // when we consider post to be "seen"
|
||||
const ON_ITEM_SEEN_INTERSECTION_OPTS = {
|
||||
rootMargin: '-200px 0px -200px 0px',
|
||||
} // post must be 200px visible to be "seen"
|
||||
|
|
Loading…
Reference in New Issue