Skip to content

Commit

Permalink
feat: remember filters in replay home (#27839)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
pauldambra and github-actions[bot] authored Jan 23, 2025
1 parent a3cd34e commit 8ba0bf5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
13 changes: 6 additions & 7 deletions frontend/src/scenes/session-recordings/player/PlayerMeta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function URLOrScreen({ lastUrl }: { lastUrl: string | undefined }): JSX.Element
)
}

function ResolutionView({ isCompact }: { isCompact: boolean }): JSX.Element {
function ResolutionView(): JSX.Element {
const { logicProps } = useValues(sessionRecordingPlayerLogic)

const { resolutionDisplay, scaleDisplay, loading } = useValues(playerMetaLogic(logicProps))
Expand All @@ -84,9 +84,8 @@ function ResolutionView({ isCompact }: { isCompact: boolean }): JSX.Element {
}
>
<span className="text-muted-alt text-xs">
<>
{resolutionDisplay} {!isCompact && `(${scaleDisplay})`}
</>
<span className="hidden @[30rem]:inline-block">{resolutionDisplay} </span>
<span>({scaleDisplay})</span>
</span>
</Tooltip>
)
Expand Down Expand Up @@ -125,7 +124,7 @@ export function PlayerMeta({ iconsOnly }: { iconsOnly: boolean }): JSX.Element {
</Link>
</Tooltip>
) : null}
<ResolutionView isCompact={isSmallPlayer} />
<ResolutionView />
</div>
</div>
)
Expand Down Expand Up @@ -158,7 +157,7 @@ export function PlayerMeta({ iconsOnly }: { iconsOnly: boolean }): JSX.Element {
'PlayerMeta--fullscreen': isFullScreen,
})}
>
<div className="flex items-center justify-between gap-1 whitespace-nowrap overflow-hidden px-1 py-0.5 text-xs">
<div className="flex items-center justify-between gap-1 whitespace-nowrap overflow-hidden px-1 py-0.5 text-xs @container">
{loading ? (
<LemonSkeleton className="w-1/3 h-4 my-1" />
) : (
Expand All @@ -184,7 +183,7 @@ export function PlayerMeta({ iconsOnly }: { iconsOnly: boolean }): JSX.Element {
)}
<div className={clsx('flex-1', isSmallPlayer ? 'min-w-[1rem]' : 'min-w-[5rem]')} />
<PlayerMetaLinks iconsOnly={iconsOnly} />
<ResolutionView isCompact={isSmallPlayer} />
<ResolutionView />
</div>
</div>
</DraggableToNotebook>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export const playerMetaLogic = kea<playerMetaLogicType>([
resolutionDisplay: [
(s) => [s.resolution],
(resolution) => {
return `${resolution?.width || '??'} x ${resolution?.height || '??'}`
return `${resolution?.width || '--'} x ${resolution?.height || '--'}`
},
],
scaleDisplay: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { objectClean, objectsEqual } from 'lib/utils'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { getCurrentTeamId } from 'lib/utils/getAppContext'

import { NodeKind, RecordingOrder, RecordingsQuery, RecordingsQueryResponse } from '~/queries/schema/schema-general'
import {
Expand Down Expand Up @@ -401,7 +402,7 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic
},
],
})),
reducers(({ props }) => ({
reducers(({ props, key }) => ({
unusableEventsInFilter: [
[] as string[],
{
Expand All @@ -414,6 +415,7 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic
],
filters: [
props.filters ?? getDefaultFilters(props.personUUID),
{ persist: true, prefix: `${getCurrentTeamId()}__${key}` },
{
setFilters: (state, { filters }) => {
return {
Expand Down

0 comments on commit 8ba0bf5

Please sign in to comment.