Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

easrng
Eric Bailey
and committed by
GitHub
b1dc5179 96d77841

+38 -19
+1
src/lib/statsig/gates.ts
··· 7 7 | 'debug_subscriptions' 8 8 | 'disable_onboarding_policy_update_notice' 9 9 | 'explore_show_suggested_feeds' 10 + | 'feed_reply_button_open_thread' 10 11 | 'old_postonboarding' 11 12 | 'onboarding_add_video_feed' 12 13 | 'onboarding_suggested_accounts'
+37 -19
src/view/com/posts/PostFeedItem.tsx
··· 11 11 } from '@atproto/api' 12 12 import {msg, Trans} from '@lingui/macro' 13 13 import {useLingui} from '@lingui/react' 14 + import {useNavigation} from '@react-navigation/native' 14 15 import {useQueryClient} from '@tanstack/react-query' 15 16 16 17 import {useActorStatus} from '#/lib/actor-status' ··· 19 20 import {useOpenComposer} from '#/lib/hooks/useOpenComposer' 20 21 import {usePalette} from '#/lib/hooks/usePalette' 21 22 import {makeProfileLink} from '#/lib/routes/links' 23 + import {type NavigationProp} from '#/lib/routes/types' 24 + import {useGate} from '#/lib/statsig/statsig' 22 25 import {sanitizeDisplayName} from '#/lib/strings/display-names' 23 26 import {sanitizeHandle} from '#/lib/strings/handles' 24 27 import {countLines} from '#/lib/strings/helpers' ··· 167 170 }): React.ReactNode => { 168 171 const queryClient = useQueryClient() 169 172 const {openComposer} = useOpenComposer() 173 + const navigation = useNavigation<NavigationProp>() 170 174 const pal = usePalette('default') 175 + const gate = useGate() 171 176 const {_} = useLingui() 172 177 173 178 const [hover, setHover] = useState(false) 174 179 175 - const href = useMemo(() => { 180 + const [href, rkey] = useMemo(() => { 176 181 const urip = new AtUri(post.uri) 177 - return makeProfileLink(post.author, 'post', urip.rkey) 182 + return [makeProfileLink(post.author, 'post', urip.rkey), urip.rkey] 178 183 }, [post.uri, post.author]) 179 184 const {sendInteraction, feedSourceInfo} = useFeedFeedbackContext() 180 185 181 186 const onPressReply = () => { 182 - sendInteraction({ 183 - item: post.uri, 184 - event: 'app.bsky.feed.defs#interactionReply', 185 - feedContext, 186 - reqId, 187 - }) 188 - openComposer({ 189 - replyTo: { 190 - uri: post.uri, 191 - cid: post.cid, 192 - text: record.text || '', 193 - author: post.author, 194 - embed: post.embed, 195 - moderation, 196 - langs: record.langs, 197 - }, 198 - }) 187 + if (gate('feed_reply_button_open_thread')) { 188 + sendInteraction({ 189 + item: post.uri, 190 + event: 'app.bsky.feed.defs#clickthroughItem', 191 + feedContext, 192 + reqId, 193 + }) 194 + navigation.navigate('PostThread', { 195 + name: post.author.did, 196 + rkey, 197 + }) 198 + } else { 199 + sendInteraction({ 200 + item: post.uri, 201 + event: 'app.bsky.feed.defs#interactionReply', 202 + feedContext, 203 + reqId, 204 + }) 205 + openComposer({ 206 + replyTo: { 207 + uri: post.uri, 208 + cid: post.cid, 209 + text: record.text || '', 210 + author: post.author, 211 + embed: post.embed, 212 + moderation, 213 + langs: record.langs, 214 + }, 215 + }) 216 + } 199 217 } 200 218 201 219 const onOpenAuthor = () => {