Skip to content
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

feat: show duration when sped up #26909

Merged
merged 4 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useActions, useValues } from 'kea'
import { useKeyboardHotkeys } from 'lib/hooks/useKeyboardHotkeys'
import { IconFullScreen, IconSync } from 'lib/lemon-ui/icons'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { humanFriendlyDuration } from 'lib/utils'
import {
SettingsBar,
SettingsButton,
Expand All @@ -25,13 +26,18 @@ import { SeekSkip, Timestamp } from './PlayerControllerTime'
import { Seekbar } from './Seekbar'

function SetPlaybackSpeed(): JSX.Element {
const { speed } = useValues(sessionRecordingPlayerLogic)
const { speed, sessionPlayerData } = useValues(sessionRecordingPlayerLogic)
const { setSpeed } = useActions(sessionRecordingPlayerLogic)
return (
<SettingsMenu
data-attr="session-recording-speed-select"
items={PLAYBACK_SPEEDS.map((speedToggle) => ({
label: `${speedToggle}x`,
label: (
<div className="flex w-full space-x-2 justify-between">
<span>{speedToggle}x</span>
<span>({humanFriendlyDuration(sessionPlayerData.durationMs / speedToggle / 1000)})</span>
</div>
),
onClick: () => setSpeed(speedToggle),
active: speed === speedToggle && speedToggle !== 1,
status: speed === speedToggle ? 'danger' : 'default',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ export function SessionRecordingPreview({
)}
onClick={() => onClick?.()}
>
<div className="grow overflow-hidden space-y-0.5">
<div className="flex items-center justify-between gap-0.5">
<div className="grow overflow-hidden space-y-1">
<div className="flex items-center justify-between space-x-0.5">
<div className="flex overflow-hidden font-medium text-link ph-no-capture">
<span className="truncate">{asDisplay(recording.person)}</span>
</div>
Expand All @@ -218,8 +218,8 @@ export function SessionRecordingPreview({
)}
</div>

<div className="flex justify-between items-center gap-0.5">
<div className="flex space-x-2 text-muted text-xs">
<div className="flex justify-between items-center space-x-0.5">
<div className="flex space-x-2 text-muted text-sm">
<PropertyIcons
recordingProperties={iconProperties}
iconClassNames={iconClassNames}
Expand Down Expand Up @@ -259,7 +259,7 @@ export function SessionRecordingPreview({

<div
className={clsx(
'min-w-6 flex flex-col gap-0.5 items-center',
'min-w-6 flex flex-col space-x-0.5 items-center',
// need different margin if the first item is an icon
recording.ongoing || pinned ? 'mt-1' : 'mt-2'
)}
Expand Down
Loading