From cca39f1466efb73cf0bef84c2d3900fe3f235df8 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 14 Jul 2026 17:18:42 -0500 Subject: [PATCH] Add heuristic name length truncation so it fits on more sizes --- src/screens/PostThread/components/LikesStat.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/screens/PostThread/components/LikesStat.tsx b/src/screens/PostThread/components/LikesStat.tsx index f98e12ef11..9a0c7139fb 100644 --- a/src/screens/PostThread/components/LikesStat.tsx +++ b/src/screens/PostThread/components/LikesStat.tsx @@ -5,6 +5,7 @@ import {Plural, Trans, useLingui} from '@lingui/react/macro' import {makeProfileLink} from '#/lib/routes/links' import {sanitizeDisplayName} from '#/lib/strings/display-names' +import {enforceLen} from '#/lib/strings/helpers' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {useLikedBySampleQuery} from '#/state/queries/post-liked-by' import {useSession} from '#/state/session' @@ -17,6 +18,7 @@ import {Text} from '#/components/Typography' import {useAnalytics} from '#/analytics' const AVI_SIZE = 20 +const MAX_NAME_LENGTH = 16 /** * The likes stat for the expanded anchor post. When the viewer follows some @@ -106,9 +108,13 @@ export function LikesStat({post}: {post: AppBskyFeedDefs.PostView}) { return { did: actor.did, href: makeProfileLink(actor), - displayName: sanitizeDisplayName( - actor.displayName || actor.handle, - moderation.ui('displayName'), + displayName: enforceLen( + sanitizeDisplayName( + actor.displayName || actor.handle, + moderation.ui('displayName'), + ), + MAX_NAME_LENGTH, + true, ), } })