From 882a5573af53c94268e28b35fa18bcbb2b204ec1 Mon Sep 17 00:00:00 2001 From: Alex Benzer Date: Tue, 7 Jul 2026 04:22:42 -0700 Subject: [PATCH] Clean up feature gate for follow buttons in expanded notifications (#11068) --- src/analytics/features/types.ts | 1 - .../notifications/NotificationFeedItem.tsx | 133 +++--------------- 2 files changed, 19 insertions(+), 115 deletions(-) diff --git a/src/analytics/features/types.ts b/src/analytics/features/types.ts index 3d8d20a856..4b2035fa53 100644 --- a/src/analytics/features/types.ts +++ b/src/analytics/features/types.ts @@ -12,7 +12,6 @@ export enum Features { GroupChatsDisable = 'group_chats:disable', ComposerLanguageDetectionEnable = 'composer:language_detection:enable', PostGalleryEmbedEnable = 'post_gallery_embed:enable', - NotificationsExpandedProfileCardEnable = 'notifications:expanded_profile_card:enable', SearchV2Enable = 'search_v2:enable', AdvancedSearchV2Enable = 'advanced_search_v2:enable', diff --git a/src/view/com/notifications/NotificationFeedItem.tsx b/src/view/com/notifications/NotificationFeedItem.tsx index 05f69a7409..894d7fcd3c 100644 --- a/src/view/com/notifications/NotificationFeedItem.tsx +++ b/src/view/com/notifications/NotificationFeedItem.tsx @@ -31,7 +31,6 @@ import {makeProfileLink} from '#/lib/routes/links' import {type NavigationProp} from '#/lib/routes/types' import {forceLTR} from '#/lib/strings/bidi' import {sanitizeDisplayName} from '#/lib/strings/display-names' -import {sanitizeHandle} from '#/lib/strings/handles' import {niceDate} from '#/lib/strings/time' import {s} from '#/lib/styles' import {logger} from '#/logger' @@ -44,7 +43,7 @@ import {FeedSourceCard} from '#/view/com/feeds/FeedSourceCard' import {Post} from '#/view/com/post/Post' import {formatCount} from '#/view/com/util/numeric/format' import {TimeElapsed} from '#/view/com/util/TimeElapsed' -import {PreviewableUserAvatar, UserAvatar} from '#/view/com/util/UserAvatar' +import {PreviewableUserAvatar} from '#/view/com/util/UserAvatar' import {atoms as a, platform, useTheme} from '#/alf' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import {BellRinging_Filled_Corner0_Rounded as BellRingingIcon} from '#/components/icons/BellRinging' @@ -75,8 +74,6 @@ import * as bsky from '#/types/bsky' const MAX_AUTHORS = 5 -const EXPANDED_AUTHOR_EL_HEIGHT = 35 - interface Author { profile: AppBskyActorDefs.ProfileView href: string @@ -98,9 +95,6 @@ let NotificationFeedItem = ({ const t = useTheme() const {_, i18n} = useLingui() const ax = useAnalytics() - const profileCardEnabled = ax.features.enabled( - ax.features.NotificationsExpandedProfileCardEnable, - ) const [isAuthorsExpanded, setIsAuthorsExpanded] = useState(false) const [isHoveringAuthorsList, setIsHoveringAuthorsList] = useState(false) const itemHref = useMemo(() => { @@ -633,9 +627,7 @@ let NotificationFeedItem = ({ }}> {({hovered}) => ( <> - + {/* TODO: Prevent conditional rendering and move toward composable notifications for clearer accessibility labeling */} @@ -645,16 +637,8 @@ let NotificationFeedItem = ({ setIsHoveringAuthorsList(true) - : undefined - } - onHoverOut={ - profileCardEnabled - ? () => setIsHoveringAuthorsList(false) - : undefined - }> + onHoverIn={() => setIsHoveringAuthorsList(true)} + onHoverOut={() => setIsHoveringAuthorsList(false)}> { - Animated.timing(isNativeFade ? opacityInterp : heightInterp, { + Animated.timing(IS_WEB ? heightInterp : opacityInterp, { toValue: visible ? 1 : 0, duration: 200, - useNativeDriver: isNativeFade, + useNativeDriver: !IS_WEB, }).start() - }, [heightInterp, opacityInterp, visible, isNativeFade]) + }, [heightInterp, opacityInterp, visible]) const onInnerLayout = (e: LayoutChangeEvent) => { if (measuredHeight === 0) { setMeasuredHeight(e.nativeEvent.layout.height) } } - if (isNativeFade) { + if (!IS_WEB) { return ( {visible && ( @@ -1065,31 +1044,22 @@ function ExpandedAuthorsList({ ) } - const targetHeight = profileCardEnabled - ? measuredHeight - : authors.length * (EXPANDED_AUTHOR_EL_HEIGHT + 10) /*10=margin*/ const heightStyle = { - height: Animated.multiply(heightInterp, targetHeight), + height: Animated.multiply(heightInterp, measuredHeight), opacity: Animated.divide(heightInterp, 1), } return ( - {profileCardEnabled ? ( - - {authors.map((author, i) => ( - - ))} - - ) : ( - authors.map(author => ( - - )) - )} + + {authors.map((author, i) => ( + + ))} + ) } @@ -1134,65 +1104,6 @@ function ExpandedAuthorProfileCard({ ) } -function ExpandedAuthorCard({author}: {author: Author}) { - const t = useTheme() - const {_} = useLingui() - return ( - - - - - - - - - - {sanitizeDisplayName( - author.profile.displayName || author.profile.handle, - )} - - - - {sanitizeHandle(author.profile.handle, '@')} - - - - - ) -} - function AdditionalPostText({post}: {post?: AppBskyFeedDefs.PostView}) { const t = useTheme() if ( @@ -1256,10 +1167,4 @@ const styles = StyleSheet.create({ paddingTop: 10, paddingBottom: 6, }, - expandedAuthor: { - flexDirection: 'row', - alignItems: 'center', - marginTop: 10, - height: EXPANDED_AUTHOR_EL_HEIGHT, - }, })