From 2e3774d9e74270081a261f4ae8dd3902cdbef52c Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 9 Jul 2026 20:37:16 -0500 Subject: [PATCH] Replace PostAlerts size prop with view prop PostAlerts now takes view: 'expanded' | 'compact' (defaulting to compact) instead of a raw pill size, mapping to lg/sm internally. The additional labels pill only renders in expanded views, so feeds and replies skip the label computation entirely; the thread anchor is the one expanded surface. Co-Authored-By: Claude Fable 5 --- src/components/moderation/PostAlerts.tsx | 23 ++++++++++++------- .../Messages/components/ChatListItem.tsx | 1 - .../Messages/components/MessageInputEmbed.tsx | 1 - .../components/ThreadItemAnchor.tsx | 2 +- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/components/moderation/PostAlerts.tsx b/src/components/moderation/PostAlerts.tsx index daeedcfa6a..4379c76cb3 100644 --- a/src/components/moderation/PostAlerts.tsx +++ b/src/components/moderation/PostAlerts.tsx @@ -24,31 +24,38 @@ import * as Pills from '#/components/Pills' export function PostAlerts({ post, modui, - size = 'sm', + view = 'compact', style, additionalCauses, }: { post?: AppBskyFeedDefs.PostView modui: ModerationUI - size?: Pills.CommonProps['size'] + /** + * Expanded views (e.g. the thread anchor post) render larger pills and + * surface the "+n" additional labels pill. Compact views (feeds, replies) + * keep the alerts minimal. + */ + view?: 'expanded' | 'compact' includeMute?: boolean style?: StyleProp additionalCauses?: ModerationCause[] | Pills.AppModerationCause[] }) { const {currentAccount} = useSession() + const size: Pills.CommonProps['size'] = view === 'expanded' ? 'lg' : 'sm' const alerts = modui.alerts.filter(unique) const informs = modui.informs.filter(unique) /* * The "+n" pill surfaces labels for the author to review and appeal, so it - * only applies when the viewer is the author. It renders even when no other - * moderation is visible, since it may be the author's only entry point to - * appeal labels on their content. + * only applies when the viewer is the author, and only in expanded views. + * It renders even when no other moderation is visible, since it may be the + * author's only entry point to appeal labels on their content. */ const isOwnPost = !!post && post.author.did === currentAccount?.did - const allLabels: ComAtprotoLabelDefs.Label[] = isOwnPost - ? [...(post.labels ?? []), ...(post.author.labels ?? [])] - : [] + const allLabels: ComAtprotoLabelDefs.Label[] = + isOwnPost && view === 'expanded' + ? [...(post.labels ?? []), ...(post.author.labels ?? [])] + : [] /* * Labels that the moderation system already surfaces in this context - * whether as an alert, an inform, or a blur handled by ContentHider - should diff --git a/src/screens/Messages/components/ChatListItem.tsx b/src/screens/Messages/components/ChatListItem.tsx index d8de21209d..0acd0c28e7 100644 --- a/src/screens/Messages/components/ChatListItem.tsx +++ b/src/screens/Messages/components/ChatListItem.tsx @@ -164,7 +164,6 @@ function DirectChatItem({ isWithinLeftPanel ? null : ( ) diff --git a/src/screens/Messages/components/MessageInputEmbed.tsx b/src/screens/Messages/components/MessageInputEmbed.tsx index 8ded1868ba..477939cd3e 100644 --- a/src/screens/Messages/components/MessageInputEmbed.tsx +++ b/src/screens/Messages/components/MessageInputEmbed.tsx @@ -243,7 +243,6 @@ function MessageInputPostEmbed({ post={post} modui={moderation.ui('contentView')} style={a.py_xs} - size="sm" /> {rt.text && (