From e8529e60fd7b4fc604ffcbbddd43de5ee9bc0338 Mon Sep 17 00:00:00 2001 From: Rudy Fraser Date: Tue, 10 Nov 2026 21:35:47 -0500 Subject: [PATCH] fix(merge): build the remaining post links with the fork's permalink helpers The thread likes count, the post menu's share action and the view-full-thread row built their links from the at-uri record key alone, which drops a community post's collection and misreads a space record URI. --- .../PostControls/PostMenu/PostMenuControlItems.tsx | 6 ++---- src/screens/PostThread/components/LikesStat.tsx | 7 ++----- src/view/com/posts/ViewFullThread.tsx | 13 +++---------- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/src/components/PostControls/PostMenu/PostMenuControlItems.tsx b/src/components/PostControls/PostMenu/PostMenuControlItems.tsx index 3101a8135..31ff1b2c5 100644 --- a/src/components/PostControls/PostMenu/PostMenuControlItems.tsx +++ b/src/components/PostControls/PostMenu/PostMenuControlItems.tsx @@ -1,9 +1,8 @@ -import {AtUri} from '@atproto/syntax' import {useLingui} from '@lingui/react/macro' import {useHaptics} from '#/lib/haptics' import {useOpenComposer} from '#/lib/hooks/useOpenComposer' -import {makeProfileLink} from '#/lib/routes/links' +import {postPermalink} from '#/lib/routes/links' import {shareUrl} from '#/lib/sharing' import {toShareUrl} from '#/lib/strings/url-helpers' import {type Shadow} from '#/state/cache/post-shadow' @@ -144,8 +143,7 @@ export function PostMenuControlItems({ } else { ax.metric('share:press:nativeShare', {}) } - const {rkey} = new AtUri(post.uri) - void shareUrl(toShareUrl(makeProfileLink(post.author, 'post', rkey))) + void shareUrl(toShareUrl(postPermalink(post.author, post.uri))) sendInteraction({ item: post.uri, event: 'app.bsky.feed.defs#interactionShare', diff --git a/src/screens/PostThread/components/LikesStat.tsx b/src/screens/PostThread/components/LikesStat.tsx index 7d8c4949e..d78f02106 100644 --- a/src/screens/PostThread/components/LikesStat.tsx +++ b/src/screens/PostThread/components/LikesStat.tsx @@ -1,7 +1,6 @@ -import {AtUri} from '@atproto/syntax' import {Plural, Trans, useLingui} from '@lingui/react/macro' -import {makeProfileLink} from '#/lib/routes/links' +import {postPermalink} from '#/lib/routes/links' import {atoms as a, useTheme} from '#/alf' import {Link} from '#/components/Link' import {useFormatPostStatCount} from '#/components/PostControls/util' @@ -29,9 +28,7 @@ export function LikesStat({ const likeCount = post.likeCount ?? 0 if (likeCount === 0) return null - const likesHref = - href ?? - makeProfileLink(post.author, 'post', new AtUri(post.uri).rkey, 'liked-by') + const likesHref = href ?? postPermalink(post.author, post.uri, 'liked-by') return ( { - const urip = new AtUri(uri) - const link = makeProfileLink( - {did: urip.hostname, handle: ''}, - 'post', - urip.rkey, - ) - const isCommunity = urip.collection === 'community.blacksky.feed.post' - return isCommunity ? `${link}?collection=${urip.collection}` : link + // Covers community collections and permissioned-space record URIs. + return postUriToRelativePath(uri) ?? '' }, [uri]) const {t: l} = useLingui() -- knotmirror 0.0.1