-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: report when player state is error #26989
Changes from 21 commits
f4e59f0
922381a
0b15784
eef4c55
447aaf6
35f31db
a33aa9d
2008d71
7c9059f
396635b
65087da
8c2f730
e8186c9
572f423
1a2d79d
278f656
c23abb4
e1231ff
f66e139
87b9196
8bc9f36
f470b61
3260f78
4874f20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import './PlayerMeta.scss' | ||
|
||
import { LemonBanner, LemonSelect, LemonSelectOption, Link } from '@posthog/lemon-ui' | ||
import { LemonSelect, LemonSelectOption, Link } from '@posthog/lemon-ui' | ||
import clsx from 'clsx' | ||
import { useActions, useValues } from 'kea' | ||
import { CopyToClipboardInline } from 'lib/components/CopyToClipboard' | ||
|
@@ -59,26 +59,6 @@ function URLOrScreen({ lastUrl }: { lastUrl: string | undefined }): JSX.Element | |
) | ||
} | ||
|
||
function PlayerWarningsRow(): JSX.Element | null { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we don't set these anywhere any more. so we don't need this code |
||
const { messageTooLargeWarnings } = useValues(sessionRecordingPlayerLogic) | ||
|
||
return messageTooLargeWarnings.length ? ( | ||
<div> | ||
<LemonBanner | ||
type="error" | ||
action={{ | ||
children: 'Learn more', | ||
to: 'https://posthog.com/docs/session-replay/troubleshooting#message-too-large-warning', | ||
targetBlank: true, | ||
}} | ||
> | ||
This session recording had recording data that was too large and could not be captured. This will mean | ||
playback is not 100% accurate.{' '} | ||
</LemonBanner> | ||
</div> | ||
) : null | ||
} | ||
|
||
export function PlayerMeta({ iconsOnly }: { iconsOnly: boolean }): JSX.Element { | ||
const { logicProps, isFullScreen } = useValues(sessionRecordingPlayerLogic) | ||
|
||
|
@@ -206,7 +186,6 @@ export function PlayerMeta({ iconsOnly }: { iconsOnly: boolean }): JSX.Element { | |
<PlayerMetaLinks iconsOnly={iconsOnly} /> | ||
{resolutionView} | ||
</div> | ||
<PlayerWarningsRow /> | ||
</div> | ||
</DraggableToNotebook> | ||
) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,7 @@ function ShowMouseTail(): JSX.Element { | |
|
||
return ( | ||
<SettingsToggle | ||
title="Show mouse tail" | ||
title="Show a tail following the cursor to make it easier to see" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. various changes to ensure there are tooltips on buttons |
||
label="Show mouse tail" | ||
active={showMouseTail} | ||
data-attr="show-mouse-tail" | ||
|
@@ -97,7 +97,7 @@ function SkipInactivity(): JSX.Element { | |
|
||
return ( | ||
<SettingsToggle | ||
title="Skip inactivity" | ||
title="Skip inactivite parts of the recording" | ||
label="Skip inactivity" | ||
active={skipInactivitySetting} | ||
data-attr="skip-inactivity" | ||
|
@@ -106,6 +106,36 @@ function SkipInactivity(): JSX.Element { | |
) | ||
} | ||
|
||
function SetTimeFormat(): JSX.Element { | ||
const { timestampFormat } = useValues(playerSettingsLogic) | ||
const { setTimestampFormat } = useActions(playerSettingsLogic) | ||
|
||
return ( | ||
<SettingsMenu | ||
highlightWhenActive={false} | ||
items={[ | ||
{ | ||
label: 'UTC', | ||
onClick: () => setTimestampFormat(TimestampFormat.UTC), | ||
active: timestampFormat === TimestampFormat.UTC, | ||
}, | ||
{ | ||
label: 'Device', | ||
onClick: () => setTimestampFormat(TimestampFormat.Device), | ||
active: timestampFormat === TimestampFormat.Device, | ||
}, | ||
{ | ||
label: 'Relative', | ||
onClick: () => setTimestampFormat(TimestampFormat.Relative), | ||
active: timestampFormat === TimestampFormat.Relative, | ||
}, | ||
]} | ||
icon={<IconClock />} | ||
label={TimestampFormatToLabel[timestampFormat]} | ||
/> | ||
) | ||
} | ||
|
||
function InspectDOM(): JSX.Element { | ||
const { sessionPlayerMetaData } = useValues(sessionRecordingPlayerLogic) | ||
const { openExplorer } = useActions(sessionRecordingPlayerLogic) | ||
|
@@ -125,39 +155,15 @@ function InspectDOM(): JSX.Element { | |
} | ||
|
||
function PlayerBottomSettings(): JSX.Element { | ||
const { timestampFormat } = useValues(playerSettingsLogic) | ||
const { setTimestampFormat } = useActions(playerSettingsLogic) | ||
|
||
return ( | ||
<SettingsBar border="top" className="justify-between"> | ||
<div className="flex flex-row gap-0.5"> | ||
<SkipInactivity /> | ||
<ShowMouseTail /> | ||
<SetPlaybackSpeed /> | ||
<SettingsMenu | ||
highlightWhenActive={false} | ||
items={[ | ||
{ | ||
label: 'UTC', | ||
onClick: () => setTimestampFormat(TimestampFormat.UTC), | ||
active: timestampFormat === TimestampFormat.UTC, | ||
}, | ||
{ | ||
label: 'Device', | ||
onClick: () => setTimestampFormat(TimestampFormat.Device), | ||
active: timestampFormat === TimestampFormat.Device, | ||
}, | ||
{ | ||
label: 'Relative', | ||
onClick: () => setTimestampFormat(TimestampFormat.Relative), | ||
active: timestampFormat === TimestampFormat.Relative, | ||
}, | ||
]} | ||
icon={<IconClock />} | ||
label={TimestampFormatToLabel[timestampFormat]} | ||
/> | ||
<InspectDOM /> | ||
<SetTimeFormat /> | ||
</div> | ||
<InspectDOM /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and to separate the inspect dom button from the player buttons |
||
</SettingsBar> | ||
) | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { actions, connect, kea, path, reducers, selectors } from 'kea' | ||
import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea' | ||
import posthog from 'posthog-js' | ||
import { teamLogic } from 'scenes/teamLogic' | ||
|
||
import { AutoplayDirection, SessionRecordingSidebarStacking } from '~/types' | ||
|
@@ -122,4 +123,13 @@ export const playerSettingsLogic = kea<playerSettingsLogicType>([ | |
(preferredSidebarStacking) => preferredSidebarStacking === SessionRecordingSidebarStacking.Vertical, | ||
], | ||
}), | ||
|
||
listeners({ | ||
setSpeed: ({ speed }) => { | ||
posthog.capture('recording player speed changed', { new_speed: speed }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moved these captures closer to the source |
||
}, | ||
setSkipInactivitySetting: ({ skipInactivitySetting }) => { | ||
posthog.capture('recording player skip inactivity toggled', { skip_inactivity: skipInactivitySetting }) | ||
}, | ||
}), | ||
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i hate this gigantic logic that just hides calling posthog capture