From 3fdd365bb5943928ffbc8d1170be1f34b2e58acd Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 20 Oct 2026 14:28:42 +0300 Subject: [PATCH] APP-3517: Suppress the notification row highlight while hovering a follow button (#12091) Co-authored-by: Claude Sonnet 5.5 --- .../components/NotificationItem/Item/Root.tsx | 82 ++++++------- .../NotificationItem/Item/hover.tsx | 41 +++++++ .../NotificationItem/Item/profile.tsx | 112 +++++++++--------- 3 files changed, 142 insertions(+), 93 deletions(-) create mode 100644 src/screens/Notifications/components/NotificationItem/Item/hover.tsx diff --git a/src/screens/Notifications/components/NotificationItem/Item/Root.tsx b/src/screens/Notifications/components/NotificationItem/Item/Root.tsx index 1117bef59..074564eaf 100644 --- a/src/screens/Notifications/components/NotificationItem/Item/Root.tsx +++ b/src/screens/Notifications/components/NotificationItem/Item/Root.tsx @@ -1,4 +1,4 @@ -import {createContext, useContext, useState} from 'react' +import {createContext, useContext} from 'react' import { type AccessibilityActionEvent, type AccessibilityProps, @@ -13,6 +13,7 @@ import {WebAuxClickWrapper} from '#/view/com/util/WebAuxClickWrapper' import {atoms as a, select, useTheme} from '#/alf' import {useLink} from '#/components/Link' import {SubtleHover} from '#/components/SubtleHover' +import {SuppressHoverContext, useRowHover} from './hover' type ItemContextValue = { isRead: boolean @@ -114,49 +115,50 @@ export function Root({ children: React.ReactNode }) { const backgroundColor = useRowBackgroundColor(isRead) - const [hover, setHover] = useState(false) + const {hover, hoverProps, setSuppressed} = useRowHover() const {onPress: followLink} = useLink({to: href, displayText: ''}) return ( - - { - if (onPressProp) { - onPressProp(event) - return - } - onBeforePress?.() - followLink(event) - }} - onPointerEnter={() => setHover(true)} - onPointerLeave={() => setHover(false)} - style={[ - a.flex_row, - a.align_start, - a.gap_lg, - /* - * As a button it's a `