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.

feat(replay): show debug replay button while impersonating (#112423)

Christian Rafferty73a0acad6ab7
diff --git a/frontend/src/scenes/session-recordings/player/SessionRecordingPlayer.tsx b/frontend/src/scenes/session-recordings/player/SessionRecordingPlayer.tsx
index 50130273508e..abdf8280a0db 100644
--- a/frontend/src/scenes/session-recordings/player/SessionRecordingPlayer.tsx
+++ b/frontend/src/scenes/session-recordings/player/SessionRecordingPlayer.tsx
@@ -7,6 +7,7 @@ import { useRef } from 'react'
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { MatchingEventsMatchType } from 'scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic'
+import { userLogic } from 'scenes/userLogic'
import { ObservationsDock } from 'products/replay_vision/frontend/components/ObservationsDock'
import { visionSurfaceShown } from 'products/replay_vision/frontend/utils/visionSurface'
@@ -101,6 +102,8 @@ function SessionRecordingPlayerInternal({
const { isVerticallyStacked, sidebarOpen } = useValues(playerSettingsLogic)
const { logicProps } = useValues(sessionRecordingPlayerLogic)
const { featureFlags } = useValues(featureFlagLogic)
+ const { user } = useValues(userLogic)
+ const showDebugReplayButton = featureFlags[FEATURE_FLAGS.REPLAY_DEBUG_WITH_AI] || user?.is_impersonated
return (
<div
@@ -115,9 +118,7 @@ function SessionRecordingPlayerInternal({
<ObservationsDock
// The player modal covers the side panel, so the conversation would open out of sight.
extraActions={
- featureFlags[FEATURE_FLAGS.REPLAY_DEBUG_WITH_AI] && logicProps.playerKey !== 'modal' ? (
- <DebugReplayButton />
- ) : null
+ showDebugReplayButton && logicProps.playerKey !== 'modal' ? <DebugReplayButton /> : null
}
/>
)}