From 17ff9af200ccb8816d9de45c6c73cdd2c30091de Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Wed, 10 Jun 2026 16:38:31 +0300 Subject: [PATCH] [Chat] Some tweaks (#10840) --- src/components/dms/MessageItem.tsx | 28 +++++++------------ .../Messages/components/MessagesList.tsx | 8 +++++- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/components/dms/MessageItem.tsx b/src/components/dms/MessageItem.tsx index 6cfec62df0..490bab0e89 100644 --- a/src/components/dms/MessageItem.tsx +++ b/src/components/dms/MessageItem.tsx @@ -21,6 +21,7 @@ import { type ChatBskyActorDefs, ChatBskyConvoDefs, ChatBskyEmbedJoinLink, + moderateProfile, RichText as RichTextAPI, } from '@atproto/api' import {plural} from '@lingui/core/macro' @@ -29,7 +30,6 @@ import {useQueryClient} from '@tanstack/react-query' import {isBlockedOrBlocking} from '#/lib/moderation/blocked-and-muted' import {createSanitizedDisplayName} from '#/lib/moderation/create-sanitized-display-name' -import {makeProfileLink} from '#/lib/routes/links' import {sanitizeHandle} from '#/lib/strings/handles' import {useMaybeProfileShadow} from '#/state/cache/profile-shadow' import {type Shadow} from '#/state/cache/types' @@ -38,12 +38,13 @@ import {useModerationOpts} from '#/state/preferences/moderation-opts' import {useProfileBlockMutationQueue} from '#/state/queries/profile' import {unstableCacheProfileView} from '#/state/queries/unstable-profile-cache' import {useSession} from '#/state/session' +import {PreviewableUserAvatar} from '#/view/com/util/UserAvatar' import {atoms as a, native, platform, useTheme} from '#/alf' import {isOnlyEmoji} from '#/alf/typography' import {Button} from '#/components/Button' import {ActionsWrapper} from '#/components/dms/ActionsWrapper' import {useMessageDialogs} from '#/components/dms/MessageOverlays' -import {InlineLinkText, Link} from '#/components/Link' +import {InlineLinkText} from '#/components/Link' import * as ProfileCard from '#/components/ProfileCard' import * as Prompt from '#/components/Prompt' import {RichText} from '#/components/RichText' @@ -227,22 +228,13 @@ let MessageItem = ({ const avatar = profile && moderationOpts ? ( - unstableCacheProfileView(queryClient, profile)}> - - + unstableCacheProfileView(queryClient, profile)} + moderation={moderateProfile(profile, moderationOpts).ui('avatar')} + /> ) : ( ) diff --git a/src/screens/Messages/components/MessagesList.tsx b/src/screens/Messages/components/MessagesList.tsx index 599b928337..8c3e2981aa 100644 --- a/src/screens/Messages/components/MessagesList.tsx +++ b/src/screens/Messages/components/MessagesList.tsx @@ -308,7 +308,13 @@ export function MessagesList({ } else { flatListRef.current?.scrollToOffset({ offset: height, - animated: hasScrolled && height > prevContentHeight.current, + // only animate when new items were appended - pure layout growth + // (e.g. the composer spacer getting its height on web) should + // snap instantly rather than visibly scrolling + animated: + hasScrolled && + height > prevContentHeight.current && + renderItems.length > prevItemCount.current, }) } }