Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(mobile): restore android report header blur (#130339)

Chris Volzer9346ba2b5cf1
diff --git a/products/mobile/docs/DESIGN.md b/products/mobile/docs/DESIGN.md
index 2a0dbb1b59b6..197380740d5c 100644
--- a/products/mobile/docs/DESIGN.md
+++ b/products/mobile/docs/DESIGN.md
@@ -238,6 +238,8 @@ Optional recovery actions sit below the message and wrap on narrow screens.
- **Report**: top chrome, headline, the byline with the Owner and Priority chips (`ReportMeta`), lede,
"Read the full report" (only when there is a summary or a signal), evidence (trace, quotes, replay), facts,
the observation card, impact tiles, charts, activity, and the action bar.
+ The report and full report wrap their scrolling content in `BlurTargetView` and pass its ref to the top chrome.
+ Android uses this target to blur content behind the header; iOS uses its native background blur.
- **Full report** (`report/[id]/details`): top chrome with Back only and the headline as its scroll title,
a "Full report" eyebrow, the headline and the byline, the whole summary, then "Signals" with a count and one card per
signal, newest first, and "Open in PostHog" at the end (hidden in demo mode).
diff --git a/products/mobile/src/features/report/ReportScreen.tsx b/products/mobile/src/features/report/ReportScreen.tsx
index 4dccff7e492d..a8633dbdaed8 100644
--- a/products/mobile/src/features/report/ReportScreen.tsx
+++ b/products/mobile/src/features/report/ReportScreen.tsx
@@ -1,7 +1,8 @@
import { useQueryClient } from '@tanstack/react-query'
+import { BlurTargetView } from 'expo-blur'
import { useIsFocused, useRouter } from 'expo-router'
-import { type ReactElement, useEffect, useState } from 'react'
-import { View } from 'react-native'
+import { type ReactElement, useEffect, useRef, useState } from 'react'
+import { View, type ViewInstance } from 'react-native'
import Animated, { useAnimatedScrollHandler, useSharedValue } from 'react-native-reanimated'
import { useProjectScope } from '@/auth/useProjectScope'
import { useViewer } from '@/auth/useViewer'
@@ -425,6 +426,7 @@ function ReportBody({
const styles = useStyles()
const insets = useScreenInsets()
const [headlineHeight, setHeadlineHeight] = useState(0)
+ const blurTarget = useRef<ViewInstance>(null)
const scrollY = useSharedValue(0)
const reading = useReportReadTracking(report.id)
const { maxScrollY } = reading
@@ -434,39 +436,44 @@ function ReportBody({
})
return (
<View style={styles.body}>
- <Animated.ScrollView
- style={styles.scroll}
- contentContainerStyle={[styles.content, { paddingTop: topOffset(insets, SCREEN_CONTENT_TOP) }]}
- keyboardShouldPersistTaps="handled"
- onScroll={onScroll}
- onLayout={reading.onLayout}
- onContentSizeChange={reading.onContentSizeChange}
- scrollEventThrottle={16}
- testID="report-scroll"
- >
- <Headline
- headline={report.headline}
- accent={report.accent}
- lede={report.lede}
- meta={<ReportMeta report={report} onReassign={onReassign} onChangePriority={onChangePriority} />}
- onHeadlineHeight={setHeadlineHeight}
- />
- {hasReportDetail(report) ? (
- <View style={styles.readFull}>
- <TextLinkRow label="Read the full report" onPress={onReadFull} testID="report-read-full" />
- </View>
- ) : null}
- <Evidence blocks={report.evidence} reportId={report.id} />
- <Facts facts={report.facts} />
- {report.observation ? (
- <ObservationCard metric={report.observation} reportId={report.id} accent={report.accent} />
- ) : null}
- <ImpactMetrics metrics={report.supportingMetrics} reportId={report.id} />
- <ReportCharts charts={report.charts} reportId={report.id} accent={report.accent} />
- <Activity events={report.activity} viewerName={viewerName} />
- </Animated.ScrollView>
+ <BlurTargetView ref={blurTarget} style={styles.scroll}>
+ <Animated.ScrollView
+ style={styles.scroll}
+ contentContainerStyle={[styles.content, { paddingTop: topOffset(insets, SCREEN_CONTENT_TOP) }]}
+ keyboardShouldPersistTaps="handled"
+ onScroll={onScroll}
+ onLayout={reading.onLayout}
+ onContentSizeChange={reading.onContentSizeChange}
+ scrollEventThrottle={16}
+ testID="report-scroll"
+ >
+ <Headline
+ headline={report.headline}
+ accent={report.accent}
+ lede={report.lede}
+ meta={
+ <ReportMeta report={report} onReassign={onReassign} onChangePriority={onChangePriority} />
+ }
+ onHeadlineHeight={setHeadlineHeight}
+ />
+ {hasReportDetail(report) ? (
+ <View style={styles.readFull}>
+ <TextLinkRow label="Read the full report" onPress={onReadFull} testID="report-read-full" />
+ </View>
+ ) : null}
+ <Evidence blocks={report.evidence} reportId={report.id} />
+ <Facts facts={report.facts} />
+ {report.observation ? (
+ <ObservationCard metric={report.observation} reportId={report.id} accent={report.accent} />
+ ) : null}
+ <ImpactMetrics metrics={report.supportingMetrics} reportId={report.id} />
+ <ReportCharts charts={report.charts} reportId={report.id} accent={report.accent} />
+ <Activity events={report.activity} viewerName={viewerName} />
+ </Animated.ScrollView>
+ </BlurTargetView>
<TopChrome
refreshing={refreshing}
+ blurTarget={blurTarget}
onBack={onBack}
onPrevious={onPrevious}
onNext={onNext}
diff --git a/products/mobile/src/features/report/TopChrome.tsx b/products/mobile/src/features/report/TopChrome.tsx
index 7a8fff58ba85..6aef994dd1de 100644
--- a/products/mobile/src/features/report/TopChrome.tsx
+++ b/products/mobile/src/features/report/TopChrome.tsx
@@ -1,6 +1,6 @@
import { Stack, useRouter } from 'expo-router'
-import { type ReactElement, useMemo } from 'react'
-import { ActivityIndicator, Platform, useWindowDimensions, View } from 'react-native'
+import { type ReactElement, type RefObject, useMemo } from 'react'
+import { ActivityIndicator, Platform, useWindowDimensions, View, type ViewInstance } from 'react-native'
import Animated, { FadeIn, FadeOut } from 'react-native-reanimated'
import { ChevronLeftIcon } from '@/ui/icons/ChevronLeftIcon'
import { ChevronRightIcon } from '@/ui/icons/ChevronRightIcon'
@@ -21,6 +21,7 @@ interface TopChromeProps {
onNext?: () => void
title?: ScrollTitle
refreshing?: boolean
+ blurTarget?: RefObject<ViewInstance | null>
/** False leaves out the Previous and Next pill, for a screen that is not one report of the inbox list. */
withPager?: boolean
}
@@ -32,6 +33,7 @@ export function TopChrome({
title,
refreshing = false,
withPager = true,
+ blurTarget,
}: TopChromeProps): ReactElement {
const router = useRouter()
const { contentWidth, paired } = useAppLayout()
@@ -72,6 +74,7 @@ export function TopChrome({
onBack={onBack}
backTestID="report-back"
title={title}
+ blurTarget={blurTarget}
hideNativeTitle={withPager && paired}
nativeActions={
Platform.OS === 'ios' && withPager ? (
diff --git a/products/mobile/src/features/report/details/ReportDetailsScreen.tsx b/products/mobile/src/features/report/details/ReportDetailsScreen.tsx
index a5788e05d93f..d2ad0e5d22c8 100644
--- a/products/mobile/src/features/report/details/ReportDetailsScreen.tsx
+++ b/products/mobile/src/features/report/details/ReportDetailsScreen.tsx
@@ -1,6 +1,7 @@
+import { BlurTargetView } from 'expo-blur'
import { useIsFocused, useRouter } from 'expo-router'
import { type ReactElement, useEffect, useRef, useState } from 'react'
-import { Text, View } from 'react-native'
+import { Text, View, type ViewInstance } from 'react-native'
import Animated, { useAnimatedScrollHandler, useSharedValue } from 'react-native-reanimated'
import { useDataMode } from '@/demo/demoMode'
import { track } from '@/lib/analytics'
@@ -120,6 +121,7 @@ function DetailsBody({ report, refreshing, onBack }: DetailsBodyProps): ReactEle
const styles = useStyles()
const insets = useScreenInsets()
const [headlineBottom, setHeadlineBottom] = useState(0)
+ const blurTarget = useRef<ViewInstance>(null)
const scrollY = useSharedValue(0)
const reading = useReportReadTracking(report.id, 'mobile_report_details_read')
const { maxScrollY } = reading
@@ -129,37 +131,40 @@ function DetailsBody({ report, refreshing, onBack }: DetailsBodyProps): ReactEle
})
return (
<>
- <Animated.ScrollView
- style={styles.scroll}
- contentContainerStyle={[
- styles.content,
- {
- paddingTop: topOffset(insets, SCREEN_CONTENT_TOP),
- paddingBottom: bottomOffset(insets, CONTENT_BOTTOM),
- },
- ]}
- onScroll={onScroll}
- onLayout={reading.onLayout}
- onContentSizeChange={reading.onContentSizeChange}
- scrollEventThrottle={16}
- testID="report-details-scroll"
- >
- <DetailsHeader report={report} onHeadlineBottom={setHeadlineBottom} />
- {hasReportDetail(report) ? (
- <>
- {report.summary ? <DetailsSummary summary={report.summary} reportId={report.id} /> : null}
- <ReportCharts charts={report.charts} reportId={report.id} accent={report.accent} />
- <SignalsSection signals={report.signals} reportId={report.id} />
- </>
- ) : (
- <Text style={styles.empty} testID="report-details-empty">
- This report has no more detail yet.
- </Text>
- )}
- {report.webUrl ? <DetailsFooter webUrl={report.webUrl} reportId={report.id} /> : null}
- </Animated.ScrollView>
+ <BlurTargetView ref={blurTarget} style={styles.scroll}>
+ <Animated.ScrollView
+ style={styles.scroll}
+ contentContainerStyle={[
+ styles.content,
+ {
+ paddingTop: topOffset(insets, SCREEN_CONTENT_TOP),
+ paddingBottom: bottomOffset(insets, CONTENT_BOTTOM),
+ },
+ ]}
+ onScroll={onScroll}
+ onLayout={reading.onLayout}
+ onContentSizeChange={reading.onContentSizeChange}
+ scrollEventThrottle={16}
+ testID="report-details-scroll"
+ >
+ <DetailsHeader report={report} onHeadlineBottom={setHeadlineBottom} />
+ {hasReportDetail(report) ? (
+ <>
+ {report.summary ? <DetailsSummary summary={report.summary} reportId={report.id} /> : null}
+ <ReportCharts charts={report.charts} reportId={report.id} accent={report.accent} />
+ <SignalsSection signals={report.signals} reportId={report.id} />
+ </>
+ ) : (
+ <Text style={styles.empty} testID="report-details-empty">
+ This report has no more detail yet.
+ </Text>
+ )}
+ {report.webUrl ? <DetailsFooter webUrl={report.webUrl} reportId={report.id} /> : null}
+ </Animated.ScrollView>
+ </BlurTargetView>
<TopChrome
refreshing={refreshing}
+ blurTarget={blurTarget}
onBack={onBack}
withPager={false}
title={{
diff --git a/products/mobile/src/ui/ScreenChrome.tsx b/products/mobile/src/ui/ScreenChrome.tsx
index c89bfe5ef83e..d976440fbe86 100644
--- a/products/mobile/src/ui/ScreenChrome.tsx
+++ b/products/mobile/src/ui/ScreenChrome.tsx
@@ -1,5 +1,5 @@
-import { type ReactElement, type ReactNode, useState } from 'react'
-import { View } from 'react-native'
+import { type ReactElement, type ReactNode, type RefObject, useState } from 'react'
+import { View, type ViewInstance } from 'react-native'
import Animated, { useAnimatedStyle } from 'react-native-reanimated'
import { BackChip } from './BackChip'
@@ -21,6 +21,7 @@ export interface ScreenChromeProps {
right?: ReactNode
nativeActions?: ReactNode
hideNativeTitle?: boolean
+ blurTarget?: RefObject<ViewInstance | null>
}
export function ScreenChrome(props: ScreenChromeProps): ReactElement {
@@ -39,6 +40,7 @@ function CustomScreenChrome({
title,
right,
nativeRail,
+ blurTarget,
}: ScreenChromeProps & { nativeRail: boolean }): ReactElement {
const styles = useStyles()
const insets = useScreenInsets()
@@ -52,7 +54,7 @@ function CustomScreenChrome({
}))
return (
<View style={[styles.chrome, { paddingTop: top }]}>
- <BlurEdge solid={solid} />
+ <BlurEdge solid={solid} blurTarget={blurTarget} />
<FadeEdge direction="down" solid={solid} opacity={layout.chromeTint} />
<View onLayout={(event) => setLeftWidth(event.nativeEvent.layout.width)}>
{nativeRail ? null : <BackChip onPress={onBack} testID={backTestID} />}