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): add youtube like UI arm for replay update (#123943)

Hayne Ryuef573871adab
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 9ab236cbe129..66c261d640a2 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -8847,9 +8847,9 @@ snapshots:
replay-tabs-home-success--recent-recordings-empty--light:
hash: v1.k794b7964.0c42a8397f876b6118b6003b38e691b849bccef88f7ce8b04d433149c387272c.AjQt0-zv3hc11T4bFY_chc_VTPx0aZVqQyNWKxWt4NA
replay-tabs-home-success--recordings-play-list-no-pinned-recordings--dark:
- hash: v1.k794b7964.3646b34febaf1f41bf9438e3b497278001c8d69fd427ed14a71b86f6412a8bda.ktDdlMNADUngWV7CXl-AVPhJ6XMMDhyLH8zCy7mnwBY
+ hash: v1.k794b7964.53fa4095ac5a898f35e358de59d7bc311a0de72fe7c057f1b243ce6956e599b9.fHtRF9O6TuTCcn1DzaEeXTZBTCtqnEnJTYyvTLlIq94
replay-tabs-home-success--recordings-play-list-no-pinned-recordings--light:
- hash: v1.k794b7964.a0683ea0a59c86f2d0b3245db8fe807ae82271c393971cece0c7b9c58f0e2f10.UjlpwjlWZaZS9fN-ph4xozP-XM8jx4p4M3MsEYFJpMs
+ hash: v1.k794b7964.9e5063255fd1e5727b9acdefefed7e0a40d46d011a11b8ee05708f20c82584b2.fiNYf5WfX2qo_H9UAYc-xCRcuFR2gehu4J3FAMScgk8
replay-tabs-home-success--second-recording-in-list--dark:
hash: v1.k794b7964.c68c60552b46fc734ea298b8f5eb77d2cdfe6e7955e2ffd748f1f4e2e85615a6.j6HUWRibjb_k6dqSYZPq2WlsgQQGqpl6tcIUFnF41x4
replay-tabs-home-success--second-recording-in-list--light:
@@ -11379,9 +11379,9 @@ snapshots:
scenes-app-experiments--experiment-health-debug-tab--light:
hash: v1.k794b7964.f43d72c3525d5c7dc207b4ee30664dd895faec19a9966dd113bffebf09998bba.zY0dq5GZK_KGHnKFbl24Hf4VfWzRyapUy1DtAv-Wt7g
scenes-app-experiments--experiment-recordings-dropped-metric--dark:
- hash: v1.k794b7964.e0e7181f2c9e61a8324eff9aa7a9230fef25b3cf37e0b24ef875780186ed25dc.9VEvZ4iVieVJwmDol0gwtAsr3wgZYW5gj2KXAGZJfiw
+ hash: v1.k794b7964.9ce950830524de179a4d761af104781fdc05347d59f18de814e72bc40a486158.T1SiGxL_fGBQT61rjwuJe9MPz1NPcjeZBRv6rKiSzrE
scenes-app-experiments--experiment-recordings-dropped-metric--light:
- hash: v1.k794b7964.de0b53459e94712e6c0c4f0681453b75991001bacd607f0beea038153f7e417f.eliDVzi9LI_nnn8x75fuvVNW4V5fYt3_3axA0NDJNGU
+ hash: v1.k794b7964.12dd09be5c9b93fe827a01fdf20654f21348e2e96a2d32cf7de6bae7906fc103.nkW5aNVwMtoE4PI3EvPbbq7ZuvyBptBcBSoq7vkKtS0
scenes-app-experiments--experiment-recordings-dropped-metric-narrow--dark:
hash: v1.k794b7964.e7103ddeba5fa35e141687b4721071200658ad8f832bf5cd695e2b60f8cf7176.YfQ5n5H4_lzVp3FYS000zOgcuUovicGZLJ7S34DIDQY
scenes-app-experiments--experiment-recordings-dropped-metric-narrow--light:
@@ -11393,35 +11393,35 @@ snapshots:
scenes-app-experiments--experiment-recordings-empty-from-results-row--dark:
hash: v1.k794b7964.d4e932d38a0358a1b126c845e10aa8b8fd3eb8fbd110753f1233a378659bbd5b.Ls5oOgNPwwJoKS8MCy9SLrVUZ_kFsThPk2Q5_pf8LpA
scenes-app-experiments--experiment-recordings-empty-from-results-row--light:
- hash: v1.k794b7964.13a695e986f8036d668219a447f6e2f292e7cfb141279b5f9990f056ce198647.sbb7RpkhVNnuu5ancCrY4cC6MJ0mup8ZSdgUEm05b50
+ hash: v1.k794b7964.8976cd8c287e5bac301d3d7f26f683eb5cbe2558a2b555991afe81beffbd4772.4IZA6mHp4K_HsQube5Cys8ofXmExlxU94ll0GWrryO8
scenes-app-experiments--experiment-recordings-empty-in-session-has-none--dark:
- hash: v1.k794b7964.12d662d73d1adb4dce1ec5b277a3534b443288c11c2f4037e257d4e78f266e4f.HfPOUYYMrsHbtDgKU1gWmVoe6mSEO-nYdDgfMRmnozE
+ hash: v1.k794b7964.6d975e8e1cfd2460a0ebff488c389187c5a3e661ffee3ddf84cb13b8013531a1.PnWGTqsR0zXM1M6IcHE9bq25hIwc3R8zp9iohiIZEBc
scenes-app-experiments--experiment-recordings-empty-in-session-has-none--light:
- hash: v1.k794b7964.c284c628a6d80058f35a53bf34e6f146de5f1995bbae27e0c311ba510b513154.OETE7Iy2AhNoSB1lrI0UUw3oOaRLxmA2Tz9BwwLXI2Y
+ hash: v1.k794b7964.5c85105ab9444ffc8ce4a3e9555924cd95137c1877fa967acef8e76b8d961071.ub13Q6e9xXJv4HGQrx1Lx4e-qtFFhlB61nOd1JFRVwg
scenes-app-experiments--experiment-recordings-empty-metric-filter-failed--dark:
- hash: v1.k794b7964.a205ffa81b36d88473ec18ef90d0e1f4f9be0c989ce9b388ad2ca2b64f917031.vtH3UG2QiJXTlb8PnH6xBmF1ZZ4q-PUgG8vRFEu6VrU
+ hash: v1.k794b7964.8a7e5d560bcfe4077b393deebbe0ac6a966c4733a07e988fd565f761fc5d284e.L6c_1rHbqwQCqmjcZfSR-FzBpnUKelxTEKuNzjYkcJs
scenes-app-experiments--experiment-recordings-empty-metric-filter-failed--light:
- hash: v1.k794b7964.9bb123491dc8bd84059361ea26e099b5ee2abbbe3bfe4c170fe73debaf5edbad.HvM3hQE4uj9rdztgS5IbCtMp2rIJ_RgHzGaRKJpKU74
+ hash: v1.k794b7964.f8b5e7def7b6fd6d1a7f1f3122fbc6087dd2c96ce594d99817350912f2a33ef0.NsB81HhpL1SN3e9bGp6t5ygFkeKJ2wbocIWbY4kxOSY
scenes-app-experiments--experiment-recordings-empty-metric-filter-matched-nothing--dark:
- hash: v1.k794b7964.7f193cee14181d58a10aaeae93dfe15af32e8a982489258c2c4984b7178c01cf.74Bh4hltr5kzyQlDT4gd7w2l7WAiebkmdO_64_E9G5Y
+ hash: v1.k794b7964.76401d6b006d3f7da3171290c10fdbddd96eb13d1a61d8303db55ccc697b46d1.zzI53pKMUqwq0Uza0ei5S7fzR8q_hkWRpPHSpvpAKw4
scenes-app-experiments--experiment-recordings-empty-metric-filter-matched-nothing--light:
- hash: v1.k794b7964.20cf876a4d7f16c192d22f963c8ac52ab6e500db3e1ae49ed021e6c9c0bdb254.9OydytceSu_--mrFh55wh71hPh2ZkCQLN_wvuGiGnJE
+ hash: v1.k794b7964.b1ae720741bd3b6382965b0f5ac03467f9f525c752dd31b63ef01df224f25a4b.ApCKxaxjWnJGi1e_hhBViY2JtjO0UwjBn8gV30leNgs
scenes-app-experiments--experiment-recordings-empty-too-early--dark:
- hash: v1.k794b7964.b40fa18023c39d0101a03cda20c24b3dd6b7305fc53519d992e2e83053178f4b.yKEDyXPv-VL_EatHFvDsSqMChDA6qUp9BEvtJf045c8
+ hash: v1.k794b7964.d85e6184e9fa6c5ebde50cbd9f69d43fb5a2852f0fe1faaa0547e510e8af548e.jsyKzWBMSCOFsJGn2OIrKktKaUzMUoZZwB9aVdxNdyM
scenes-app-experiments--experiment-recordings-empty-too-early--light:
- hash: v1.k794b7964.c1212b869b892a14690b4b51e6f08eb4a8deb489328425b8b9451ac63d698ac5.Izd8xF3mXlPCoqVZYB0tI1JhWU4pNHaSBwASGppURso
+ hash: v1.k794b7964.6e0726f8c948c68eccefd62d2d7c23abf1f99d0aaf0d2d244cf984d1b37d7867.BPI6FZE6sSb2RquMuIV2So8fZts9tAsJz31gJwXV4aQ
scenes-app-experiments--experiment-recordings-empty-too-early-with-variant-selected--dark:
- hash: v1.k794b7964.4482f480bb8fcb86855c352e627155f31e1b157a82d4dcff6b674687d42363ec.mSgIaG7wwrzc03lH-ilM_uXqp4hPGefxDNiPiAwap-A
+ hash: v1.k794b7964.130a1a633dbbc8b957140cec919cfdf3263545d5f437017f636b3a3d0d68c5d9.lsDfvKqUqI3hsoQ7Jig3k1emJF6FguFY2GM1eKPKGLg
scenes-app-experiments--experiment-recordings-empty-too-early-with-variant-selected--light:
- hash: v1.k794b7964.8e286a390221a22472bc5fcbd708ea5744551f5f5735f994dbff1871c6018188.CVzNw01xaOVhneXp4P_gzdowGk9kh8MmgzdPMZ3QGTg
+ hash: v1.k794b7964.8ecb046df1c3a2702d374b020170712d051818192e0a1bfe33262c8741dd8355.h_RBhvCv_inW4kl6s9kW2-DaIU6owHo5Ckr8Rx7iPKQ
scenes-app-experiments--experiment-recordings-empty-unknown-in-window--dark:
hash: v1.k794b7964.34dfe8a91c29bf3005b289f6b3735d74a24928942328a9e92fc0798fab41ba8c.rQ5FmrN5ZRBL_AlLR5QlC776VVaiVYPDDvLyGvOjWbw
scenes-app-experiments--experiment-recordings-empty-unknown-in-window--light:
hash: v1.k794b7964.db794b6c843f3d3114754bc16299ef530acc90bacf9cd12d250a39263c0a2fb2.STLn3NsmTpvXN79Uky_2uqJA5Ia3Mh-LqiYc2joY3hY
scenes-app-experiments--experiment-recordings-empty-variant-has-none--dark:
- hash: v1.k794b7964.55369c0918e68722516cd879dc449239eb0aaa4084596395979873069a2cd30d.vZGGwdmZP5ArUb88MPdUvQCi2CTHco6J8M25FKlJoBs
+ hash: v1.k794b7964.529e81da2f2f0d41cbc0863c4b6c6ea2619aaf5327c206a3f42492bb629063e1._S3RVgQ3vhw5D0jVYFsLrW2UrgH6E87n4MzJE2zX-rs
scenes-app-experiments--experiment-recordings-empty-variant-has-none--light:
- hash: v1.k794b7964.712e7e19f88e63be01f2b82380457933303532638a3bcfeb2ab1f2d23bc9a24d.ZjUEYW1PbQNevUrCaqHrEkQBfWUZB3Pi7X8zNEUx8Ts
+ hash: v1.k794b7964.e5697a68e67d05e31515d60524acbe13ece642e115701cac42ded9fd88af489b.fmRm2KbJAKatTUzkHm0VUK4A8dA4-EIFU-TC4I_9Rgo
scenes-app-experiments--experiment-recordings-list-load-failed--dark:
hash: v1.k794b7964.194ac90b974f5ef4ac3d50c4cdf11f0a35a9e3f2fa4ce5368b503cc1bdd04fba.ztHYf5Y_zs7b_13tZBw2_Tv3hWXRa5FxZ9sydnRQEiI
scenes-app-experiments--experiment-recordings-list-load-failed--light:
diff --git a/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFiltersEmbed.tsx b/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFiltersEmbed.tsx
index 3334c49b4b80..2bc6908dbf7d 100644
--- a/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFiltersEmbed.tsx
+++ b/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFiltersEmbed.tsx
@@ -149,6 +149,8 @@ export const RecordingsUniversalFiltersEmbedButton = ({
interface ReplayUniversalFiltersEmbedProps {
filters: RecordingUniversalFilters
setFilters: (filters: Partial<RecordingUniversalFilters>) => void
+ /** Replaces the whole set from a saved filter. Falls back to `setFilters` where no list logic is bound. */
+ applySavedFilter?: (filters: Partial<RecordingUniversalFilters>) => void
resetFilters?: () => void
totalFiltersCount?: number
className?: string
@@ -190,7 +192,7 @@ export const RecordingsUniversalFiltersEmbed = ({ ...props }: ReplayUniversalFil
<span>Saved filters</span>
</div>
),
- content: <SavedFilters setFilters={props.setFilters} />,
+ content: <SavedFilters applyFilters={props.applySavedFilter ?? props.setFilters} />,
'data-attr': 'session-recordings-saved-tab',
},
{
@@ -561,6 +563,7 @@ const SessionIdsFilterChip = ({
export const ReplayFiltersTab = ({
filters,
setFilters,
+ applySavedFilter,
resetFilters,
className,
totalFiltersCount,
@@ -614,6 +617,7 @@ export const ReplayFiltersTab = ({
sessionRecordingSavedFiltersLogic
)
const { setActiveFilterTab } = useActions(playlistFiltersLogic)
+ const applyFilters = applySavedFilter ?? setFilters
useEffect(() => {
if (!pendingFilterApplication) {
@@ -621,13 +625,19 @@ export const ReplayFiltersTab = ({
}
if (pendingFilterApplication.filters) {
- setFilters(stripSessionIds(pendingFilterApplication.filters as Partial<RecordingUniversalFilters>))
+ applyFilters(stripSessionIds(pendingFilterApplication.filters as Partial<RecordingUniversalFilters>))
setAppliedSavedFilter(pendingFilterApplication)
setActiveFilterTab('filters')
}
clearPendingFilterApplication()
- }, [pendingFilterApplication, setFilters, setActiveFilterTab, setAppliedSavedFilter, clearPendingFilterApplication])
+ }, [
+ pendingFilterApplication,
+ applyFilters,
+ setActiveFilterTab,
+ setAppliedSavedFilter,
+ clearPendingFilterApplication,
+ ])
const updateSavedFilter = async (): Promise<void> => {
if (appliedSavedFilter === null) {
@@ -692,7 +702,7 @@ export const ReplayFiltersTab = ({
size="small"
icon={<IconTrash />}
onClick={() =>
- setFilters(
+ applyFilters(
stripSessionIds(
appliedSavedFilter.filters as Partial<RecordingUniversalFilters>
)
diff --git a/frontend/src/scenes/session-recordings/filters/SavedFilters.tsx b/frontend/src/scenes/session-recordings/filters/SavedFilters.tsx
index 6467f61274eb..cefab452822c 100644
--- a/frontend/src/scenes/session-recordings/filters/SavedFilters.tsx
+++ b/frontend/src/scenes/session-recordings/filters/SavedFilters.tsx
@@ -120,9 +120,9 @@ export function countColumn(): LemonTableColumn<SessionRecordingPlaylistType, 'r
}
export function SavedFilters({
- setFilters,
+ applyFilters,
}: {
- setFilters: (filters: Partial<RecordingUniversalFilters>) => void
+ applyFilters: (filters: Partial<RecordingUniversalFilters>) => void
}): JSX.Element {
const { filters, savedFilters, paginationSavedFilters, savedFiltersLoading } = useValues(
sessionRecordingSavedFiltersLogic
@@ -162,7 +162,7 @@ export function SavedFilters({
if (!universalFilters) {
return
}
- setFilters(stripSessionIds(universalFilters))
+ applyFilters(stripSessionIds(universalFilters))
setActiveFilterTab('filters')
setAppliedSavedFilter(filter)
}}
diff --git a/frontend/src/scenes/session-recordings/filters/recordingsQueryConversions.ts b/frontend/src/scenes/session-recordings/filters/recordingsQueryConversions.ts
index f7a860db137a..bb705c573fd9 100644
--- a/frontend/src/scenes/session-recordings/filters/recordingsQueryConversions.ts
+++ b/frontend/src/scenes/session-recordings/filters/recordingsQueryConversions.ts
@@ -161,6 +161,7 @@ export function convertUniversalFiltersToRecordingsQuery(universalFilters: Recor
operand: deriveOperand(universalFilters.filter_group),
limit: universalFilters.limit,
session_ids: universalFilters.session_ids,
+ person_uuid: universalFilters.person_uuid,
experiment_exposure: universalFilters.experiment_exposure,
}
}
@@ -200,5 +201,6 @@ export function recordingsQueryToUniversalFilters(
experiment_exposure: query?.experiment_exposure,
recommended_only: query?.recommended_only,
event_match_scope: query?.event_match_scope,
+ person_uuid: query?.person_uuid,
}
}
diff --git a/frontend/src/scenes/session-recordings/filters/useRecordingFiltersAssist.ts b/frontend/src/scenes/session-recordings/filters/useRecordingFiltersAssist.ts
index 3695658edbf3..46611399304a 100644
--- a/frontend/src/scenes/session-recordings/filters/useRecordingFiltersAssist.ts
+++ b/frontend/src/scenes/session-recordings/filters/useRecordingFiltersAssist.ts
@@ -25,8 +25,7 @@ const RECORDINGS_QUERY_TOOL_CONTEXT_ITEM: AttachedContextItem = {
'the user sees matching recordings both in this chat and on screen.',
}
-// Recording-metric keys of the query's `properties` filters, whose `type: 'recording'` is a zod
-// default the agent may omit from its raw args.
+// Recording-metric keys whose `type: 'recording'` is a zod default the agent may omit.
const RECORDING_METRIC_KEYS = new Set([
...DURATION_KEYS,
'console_error_count',
@@ -39,10 +38,7 @@ const RECORDING_METRIC_KEYS = new Set([
'snapshot_source',
])
-/**
- * Attaches the open list's filters to PostHog AI and mirrors the filters it produces back onto the list, for
- * whichever header holds the filter button.
- */
+/** Attaches the open list's filters to PostHog AI and mirrors what it produces back onto the list. */
export function useRecordingFiltersAssist({
filters,
setFilters,
@@ -62,24 +58,17 @@ export function useRecordingFiltersAssist({
] as AttachedContextItem[])
const applyFilters = (toolOutput: Record<string, any>): void => {
- // Improve type
setFilters(toolOutput.recordings_filters)
setIsFiltersExpanded(true)
}
- // The headless query tool's call input mirrored onto the open list. The input is a complete query:
- // every field is applied, with omitted fields set to the query schema's defaults so the list shows
- // the same recordings the tool returned. The args are raw agent-sent JSON (never zod-validated), so
- // fields are coerced and the recording-metric `type` default is stamped back on before converting to
- // the universal filter shape. person_uuid (query-level constraint), after (pagination cursor), and
- // limit (the agent's page size, which shouldn't shrink the user's list) have no counterpart in the
- // universal filters.
+ // The tool's args are raw agent JSON, so the schema defaults never ran: missing fields are filled here and the
+ // recording-metric `type` is added back. person_uuid, after and limit have no place in the universal filters.
const applyRecordingsQuery = (input: Record<string, any>): void => {
const props = (Array.isArray(input.properties) ? input.properties : []).map((f: Record<string, any>) =>
f && !f.type && RECORDING_METRIC_KEYS.has(f.key) ? { ...f, type: 'recording' } : f
)
- // Duration filters have their own control in the universal shape, so the converter expects
- // them in `having_predicates` rather than `properties`.
+ // The converter expects duration filters in `having_predicates`, not `properties`.
const universal = recordingsQueryToUniversalFilters({
kind: NodeKind.RecordingsQuery,
properties: props.filter((f: Record<string, any>) => !DURATION_KEYS.has(f?.key)),
diff --git a/frontend/src/scenes/session-recordings/player/SessionRecordingPlayer.scss b/frontend/src/scenes/session-recordings/player/SessionRecordingPlayer.scss
index 23e62949d3fd..7ff3aef1a4e0 100644
--- a/frontend/src/scenes/session-recordings/player/SessionRecordingPlayer.scss
+++ b/frontend/src/scenes/session-recordings/player/SessionRecordingPlayer.scss
@@ -35,10 +35,11 @@
}
}
- // The watch layout stacks the player over a scrolling panel. The player keeps a fixed share of the viewport.
+ // The watch layout stacks the player over a scrolling panel. The player's share is of the wrapper, not the viewport.
&--watch {
flex-direction: column;
overflow-y: auto;
+ container-type: size;
.SessionRecordingPlayerWrapper__column {
display: flex;
@@ -58,11 +59,16 @@
}
.SessionRecordingPlayerWrapper__player {
+ position: sticky;
+ top: 0;
+ z-index: 2;
display: flex;
flex: none;
- height: clamp(24rem, 60vh, 48rem);
+ height: clamp(16rem, 55cqh, 48rem);
+ background: var(--color-bg-surface-primary);
&--fullscreen {
+ position: static;
flex: 1;
height: auto;
}
diff --git a/frontend/src/scenes/session-recordings/player/controller/activityCurvePath.ts b/frontend/src/scenes/session-recordings/player/controller/activityCurvePath.ts
index cff19c253382..3844ba1ba04e 100644
--- a/frontend/src/scenes/session-recordings/player/controller/activityCurvePath.ts
+++ b/frontend/src/scenes/session-recordings/player/controller/activityCurvePath.ts
@@ -3,10 +3,8 @@ export interface ActivityPoint {
y: number
}
-/**
- * The SVG path of an activity curve closed along the bottom edge, so it fills as an area. `smooth` joins the points
- * with a Catmull-Rom spline rendered as cubic Béziers. Otherwise they are joined with straight segments.
- */
+// The SVG path of the activity curve, closed along the bottom edge so it fills as an area. `smooth` joins the points
+// with a Catmull-Rom spline as cubic Béziers, otherwise with straight segments.
export function activityAreaPath(points: ActivityPoint[], width: number, height: number, smooth: boolean): string {
if (points.length === 0) {
return ''
diff --git a/frontend/src/scenes/session-recordings/player/playerSettingsLogic.test.ts b/frontend/src/scenes/session-recordings/player/playerSettingsLogic.test.ts
index 49ce7792fa0c..b86962013433 100644
--- a/frontend/src/scenes/session-recordings/player/playerSettingsLogic.test.ts
+++ b/frontend/src/scenes/session-recordings/player/playerSettingsLogic.test.ts
@@ -61,11 +61,23 @@ describe('playerSettingsLogic', () => {
expect(logic.values.debugMode).toBe(false)
})
- it('an old inspectorSideBar link waits for the flags before opening Debug', () => {
+ it.each([
+ ['Debug under the watch layout', { [FEATURE_FLAGS.REPLAY_WATCH_LAYOUT]: 'compact' }, true, false],
+ ['the sidebar under the classic layout', {}, false, true],
+ ])('an old inspectorSideBar link waits for the flags, then opens %s', (_, flags, debug, sidebar) => {
openLink(home, { inspectorSideBar: true })
expect(logic.values.debugMode).toBe(false)
+ expect(logic.values.sidebarOpen).toBe(false)
+ featureFlagLogic.actions.setFeatureFlags([], flags)
+ expect(logic.values.debugMode).toBe(debug)
+ expect(logic.values.sidebarOpen).toBe(sidebar)
+ })
+
+ it('an old inspectorSideBar link under the watch layout leaves the sidebar preference alone', () => {
watchLayout()
+ openLink(home, { inspectorSideBar: true })
expect(logic.values.debugMode).toBe(true)
+ expect(logic.values.userPreferenceSidebarOpen).toBe(false)
})
it('an old inspectorSideBar link leaves Debug off in the classic layout', () => {
diff --git a/frontend/src/scenes/session-recordings/player/playerSettingsLogic.ts b/frontend/src/scenes/session-recordings/player/playerSettingsLogic.ts
index ca2360b3db4a..ea35d50a01d0 100644
--- a/frontend/src/scenes/session-recordings/player/playerSettingsLogic.ts
+++ b/frontend/src/scenes/session-recordings/player/playerSettingsLogic.ts
@@ -265,7 +265,6 @@ export const playerSettingsLogic = kea<playerSettingsLogicType>([
setPlayerControlsOverlay: (_, { playerControlsOverlay }) => playerControlsOverlay,
},
],
- // Lets a person in the watch-layout experiment switch back to the classic page
preferClassicReplayLayout: [
false,
{ persist: true },
@@ -390,8 +389,12 @@ export const playerSettingsLogic = kea<playerSettingsLogicType>([
receivedFeatureFlags: (received: boolean) => {
if (received && values.legacyDebugLinkPending) {
actions.setLegacyDebugLinkPending(false)
- if (isNewReplayLayout(values.replayLayout) && !values.debugMode) {
- actions.setDebugMode(true)
+ if (isNewReplayLayout(values.replayLayout)) {
+ if (!values.debugMode) {
+ actions.setDebugMode(true)
+ }
+ } else if (!values.sidebarOpen) {
+ actions.setSidebarOpen(true)
}
}
},
@@ -407,12 +410,11 @@ export const playerSettingsLogic = kea<playerSettingsLogicType>([
})),
urlToAction(({ actions, values }) => {
- const syncClassicSidebar = (searchParams: Record<string, any>, hashParams: Record<string, any>): boolean => {
+ const syncClassicSidebar = (searchParams: Record<string, any>, hashParams: Record<string, any>): void => {
const inspectorSideBarOpen = searchParams.inspectorSideBar === true || hashParams.inspectorSideBar === true
if (inspectorSideBarOpen && inspectorSideBarOpen !== values.sidebarOpen) {
actions.setSidebarOpen(inspectorSideBarOpen)
}
- return inspectorSideBarOpen
}
return {
['**/shared/*']: (_, searchParams) => {
@@ -440,15 +442,28 @@ export const playerSettingsLogic = kea<playerSettingsLogicType>([
}
},
[urls.replay(ReplayTabs.Home)]: (_, searchParams, hashParams, { initial }) => {
- const inspectorSideBarOpen = syncClassicSidebar(searchParams, hashParams)
+ if (searchParams.debug === true && !values.debugMode) {
+ actions.setDebugMode(true)
+ }
+ const inspectorSideBarOpen =
+ searchParams.inspectorSideBar === true || hashParams.inspectorSideBar === true
+ if (!inspectorSideBarOpen) {
+ return
+ }
// The page copies the param into every URL it writes.
- const legacyLink = inspectorSideBarOpen && !!initial
+ const legacyLink = !!initial
+ // The layout decides whether the link opens the sidebar or Debug, and an opened sidebar persists, so
+ // the choice waits for the flags.
if (legacyLink && !values.receivedFeatureFlags) {
actions.setLegacyDebugLinkPending(true)
+ return
}
- const legacyDebugLink = legacyLink && isNewReplayLayout(values.replayLayout)
- if ((searchParams.debug === true || legacyDebugLink) && !values.debugMode) {
- actions.setDebugMode(true)
+ if (isNewReplayLayout(values.replayLayout)) {
+ if (legacyLink && !values.debugMode) {
+ actions.setDebugMode(true)
+ }
+ } else if (!values.sidebarOpen) {
+ actions.setSidebarOpen(true)
}
},
// Putting `*` last to match it only if more specific routes don't match, as the matching seems to be exclusive
diff --git a/frontend/src/scenes/session-recordings/player/watch/RecordingDebugSection.tsx b/frontend/src/scenes/session-recordings/player/watch/RecordingDebugSection.tsx
index cf22e39042e5..436356bc550c 100644
--- a/frontend/src/scenes/session-recordings/player/watch/RecordingDebugSection.tsx
+++ b/frontend/src/scenes/session-recordings/player/watch/RecordingDebugSection.tsx
@@ -20,7 +20,7 @@ export function RecordingDebugSection(): JSX.Element {
return (
<div
- className="flex flex-col border rounded bg-surface-primary overflow-hidden h-[60vh] min-h-96"
+ className="flex flex-col border rounded bg-surface-primary overflow-hidden h-[calc(45cqh-1.5rem)] min-h-48"
data-attr="watch-panel-debug"
>
<DebugTabBar tabs={DEBUG_TAB_KEYS} activeTab={tab} onChange={setTab}>
diff --git a/frontend/src/scenes/session-recordings/player/watch/RecordingTitleBlock.tsx b/frontend/src/scenes/session-recordings/player/watch/RecordingTitleBlock.tsx
index c901d8d526ed..c48681f48882 100644
--- a/frontend/src/scenes/session-recordings/player/watch/RecordingTitleBlock.tsx
+++ b/frontend/src/scenes/session-recordings/player/watch/RecordingTitleBlock.tsx
@@ -1,4 +1,7 @@
-import { useValues } from 'kea'
+import { useActions, useValues } from 'kea'
+
+import { IconChevronRight } from '@posthog/icons'
+import { LemonButton } from '@posthog/lemon-ui'
import { PropertyIcon } from 'lib/components/PropertyIcon/PropertyIcon'
import { TZLabel } from 'lib/components/TZLabel'
@@ -8,8 +11,10 @@ import { humanFriendlyDuration } from 'lib/utils/durations'
import { PlayerMetaExperimentTags } from 'scenes/session-recordings/player/player-meta/PlayerMetaExperimentTags'
import { PinToPlaylistButton } from 'scenes/session-recordings/player/player-meta/PlayerMetaLinks'
import { playerMetaLogic } from 'scenes/session-recordings/player/player-meta/playerMetaLogic'
+import { playerSettingsLogic } from 'scenes/session-recordings/player/playerSettingsLogic'
import { gatherIconProperties } from 'scenes/session-recordings/playlist/gatherIconProperties'
import { sessionRecordingsListPropertiesLogic } from 'scenes/session-recordings/playlist/sessionRecordingsListPropertiesLogic'
+import { sessionRecordingsPlaylistLogic } from 'scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic'
import { PersonIcon } from 'products/persons/frontend/components/PersonDisplay'
import { asDisplay, asLink } from 'products/persons/frontend/person-utils'
@@ -20,6 +25,9 @@ export function RecordingTitleBlock(): JSX.Element {
const { logicProps, sessionPlayerMetaData } = useValues(sessionRecordingPlayerLogic)
const { sessionPerson, loading, startTime } = useValues(playerMetaLogic(logicProps))
const { recordingPropertiesById } = useValues(sessionRecordingsListPropertiesLogic)
+ // The playlist host binds this logic, so the filter lands on the list beside the player.
+ const { filterByPerson } = useActions(sessionRecordingsPlaylistLogic)
+ const { setPlaylistCollapsed } = useActions(playerSettingsLogic)
if (loading) {
return (
@@ -40,6 +48,13 @@ export function RecordingTitleBlock(): JSX.Element {
const durationSeconds = sessionPlayerMetaData?.recording_duration
const personName = sessionPerson ? asDisplay(sessionPerson) : 'Unknown user'
const personHref = asLink(sessionPerson)
+ const personUUID = sessionPerson?.uuid
+ const showMoreFromPerson = (): void => {
+ if (personUUID) {
+ filterByPerson(personUUID)
+ setPlaylistCollapsed(false)
+ }
+ }
return (
<div className="flex items-start gap-3 min-w-0" data-attr="watch-panel-title">
@@ -54,6 +69,21 @@ export function RecordingTitleBlock(): JSX.Element {
personName
)}
</h2>
+ {personUUID && (
+ <div>
+ <LemonButton
+ size="xsmall"
+ type="tertiary"
+ sideIcon={<IconChevronRight />}
+ onClick={showMoreFromPerson}
+ tooltip="Filter the list to this person's recordings"
+ className="-ml-1"
+ data-attr="watch-panel-more-from-person"
+ >
+ More from this person
+ </LemonButton>
+ </div>
+ )}
<div className="flex items-center gap-x-2 gap-y-0.5 flex-wrap text-xs text-secondary ph-no-capture">
{durationSeconds !== undefined && <span>{humanFriendlyDuration(durationSeconds)}</span>}
{startTime && <TZLabel time={startTime} showPopover={false} />}
diff --git a/frontend/src/scenes/session-recordings/playlist/FilterChips.tsx b/frontend/src/scenes/session-recordings/playlist/FilterChips.tsx
index eb69aa7620ca..59fafafdcaff 100644
--- a/frontend/src/scenes/session-recordings/playlist/FilterChips.tsx
+++ b/frontend/src/scenes/session-recordings/playlist/FilterChips.tsx
@@ -1,7 +1,7 @@
import { useActions, useValues } from 'kea'
import { ReactNode, useState } from 'react'
-import { IconClock, IconEye, IconX } from '@posthog/icons'
+import { IconClock, IconEye, IconPerson, IconX } from '@posthog/icons'
import { LemonButton } from '@posthog/lemon-ui'
import { convertSecondsToDuration } from 'lib/components/DurationPicker/DurationPicker'
@@ -10,8 +10,10 @@ import { playerSettingsLogic } from 'scenes/session-recordings/player/playerSett
import { PropertyOperator, RecordingDurationFilter, RecordingUniversalFilters } from '~/types'
+import { asDisplay } from 'products/persons/frontend/person-utils'
+
import { filterLeaves, removeFilterLeaf } from './filterChipLeaves'
-import { defaultRecordingDurationFilter } from './sessionRecordingsPlaylistLogic'
+import { defaultRecordingDurationFilter, sessionRecordingsPlaylistLogic } from './sessionRecordingsPlaylistLogic'
const MAX_VISIBLE_CHIPS = 4
@@ -44,8 +46,11 @@ export function FilterChips({
}): JSX.Element | null {
const { hideViewedRecordings } = useValues(playerSettingsLogic)
const { setHideViewedRecordings } = useActions(playerSettingsLogic)
+ const { recordings } = useValues(sessionRecordingsPlaylistLogic)
+ const { filterByPerson } = useActions(sessionRecordingsPlaylistLogic)
const [expanded, setExpanded] = useState(false)
const leaves = filterLeaves(filters.filter_group)
+ const filteredPerson = recordings.find((r) => r.person?.uuid === filters.person_uuid)?.person
const chips: ReactNode[] = [
...leaves.map(({ path, filter }) => (
@@ -75,6 +80,18 @@ export function FilterChips({
</FilterChip>,
]
),
+ ...(filters.person_uuid
+ ? [
+ <FilterChip
+ key="person"
+ icon={<IconPerson />}
+ onClose={() => filterByPerson(null)}
+ dataAttr="list-filter-chip-person"
+ >
+ {filteredPerson ? asDisplay(filteredPerson) : 'One person'}
+ </FilterChip>,
+ ]
+ : []),
...(hideViewedRecordings
? [
<FilterChip
diff --git a/frontend/src/scenes/session-recordings/playlist/Playlist.tsx b/frontend/src/scenes/session-recordings/playlist/Playlist.tsx
index 2631818063fd..7d855e50a45e 100644
--- a/frontend/src/scenes/session-recordings/playlist/Playlist.tsx
+++ b/frontend/src/scenes/session-recordings/playlist/Playlist.tsx
@@ -30,10 +30,11 @@ import { playerSettingsLogic } from 'scenes/session-recordings/player/playerSett
import { OngoingRecordingsGroup } from 'scenes/session-recordings/playlist/OngoingRecordingsGroup'
import { playlistFiltersLogic } from 'scenes/session-recordings/playlist/playlistFiltersLogic'
import { ReplayFilterBar } from 'scenes/session-recordings/playlist/ReplayFilterBar'
-import { isNewReplayLayout } from 'scenes/session-recordings/playlist/replayLayout'
+import { isFeedReplayLayout, isNewReplayLayout } from 'scenes/session-recordings/playlist/replayLayout'
import { ReplayListHeader } from 'scenes/session-recordings/playlist/ReplayListHeader'
import { SessionRecordingPreview } from 'scenes/session-recordings/playlist/SessionRecordingPreview'
import { SessionRecordingPreviewCompact } from 'scenes/session-recordings/playlist/SessionRecordingPreviewCompact'
+import { SessionRecordingPreviewFeed } from 'scenes/session-recordings/playlist/SessionRecordingPreviewFeed'
import { sessionRecordingsPlaylistLogic } from 'scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic'
import { SessionRecordingsPlaylistTopSettings } from 'scenes/session-recordings/playlist/SessionRecordingsPlaylistSettings'
import { SessionRecordingsPlaylistTroubleshooting } from 'scenes/session-recordings/playlist/SessionRecordingsPlaylistTroubleshooting'
@@ -91,6 +92,7 @@ export function Playlist({
}: PlaylistProps): JSX.Element {
const { isPlaylistCollapsed, replayLayout } = useValues(playerSettingsLogic)
const newLayout = watchLayout && isNewReplayLayout(replayLayout)
+ const feedLayout = newLayout && isFeedReplayLayout(replayLayout)
const { setPlaylistCollapsed } = useActions(playerSettingsLogic)
const collapseButton = (
<LemonButton
@@ -115,7 +117,8 @@ export function Playlist({
const notebookNode = useNotebookNode()
const embedded = !!notebookNode
const watchListHeader = newLayout && !notebookNode
- const watchFilterBar = watchListHeader && type !== 'collection'
+ // The feed layout hosts the filter bar above both columns, so the list only keeps its header.
+ const watchFilterBar = watchListHeader && type !== 'collection' && !feedLayout
// bound outside here
const {
@@ -159,7 +162,9 @@ export function Playlist({
}
const renderRow = ({ item, isActive }: { item: SessionRecordingType; isActive: boolean }): JSX.Element =>
- newLayout ? (
+ feedLayout ? (
+ <SessionRecordingPreviewFeed recording={item} isActive={isActive} selectable={selectMode} />
+ ) : newLayout ? (
<SessionRecordingPreviewCompact recording={item} isActive={isActive} selectable={selectMode} />
) : (
<SessionRecordingPreview recording={item} isActive={isActive} selectable />
@@ -314,7 +319,7 @@ export function Playlist({
/>
</div>
)}
- {!watchFilterBar && !notebookNode && type !== 'collection' && (
+ {!watchListHeader && !notebookNode && type !== 'collection' && (
<div className="mb-2 flex gap-2">
<DraggableToNotebook className="flex-1" href={urls.replay(ReplayTabs.Home, filters)}>
<RecordingsUniversalFiltersEmbedButton
diff --git a/frontend/src/scenes/session-recordings/playlist/ReplayBulkBar.tsx b/frontend/src/scenes/session-recordings/playlist/ReplayBulkBar.tsx
index 61d06559417d..2ef73c1247d1 100644
--- a/frontend/src/scenes/session-recordings/playlist/ReplayBulkBar.tsx
+++ b/frontend/src/scenes/session-recordings/playlist/ReplayBulkBar.tsx
@@ -3,7 +3,7 @@ import { useActions, useValues } from 'kea'
import { IconEllipsis } from '@posthog/icons'
import { LemonButton } from '@posthog/lemon-ui'
-import { LemonMenu, LemonMenuItem } from 'lib/lemon-ui/LemonMenu/LemonMenu'
+import { LemonMenu, LemonMenuItem, LemonMenuItemLeafCallback } from 'lib/lemon-ui/LemonMenu/LemonMenu'
import { getAccessControlDisabledReason } from 'lib/utils/accessControlUtils'
import { AccessControlLevel, AccessControlResourceType } from '~/types'
@@ -43,37 +43,58 @@ export function ReplayBulkBar({ type, shortId }: { type: 'filters' | 'collection
{ key: 'bulk-scan-recordings', label: () => <BulkScanMenuItem />, custom: true },
]
+ const primaryItems: LemonMenuItemLeafCallback[] = [
+ {
+ label: 'Add to collection',
+ onClick: () => setIsAddToCollectionModalOpen(true),
+ disabledReason: accessControlDisabledReason,
+ 'data-attr': 'add-to-collection',
+ },
+ { label: 'Mark watched', onClick: () => handleBulkMarkAsViewed(shortId), 'data-attr': 'mark-as-viewed' },
+ {
+ label: 'Delete',
+ status: 'danger',
+ onClick: () => setIsDeleteSelectedRecordingsDialogOpen(true),
+ disabledReason: accessControlDisabledReason,
+ 'data-attr': 'delete-recordings',
+ },
+ ]
+
return (
- <div className="flex flex-1 items-center gap-1 flex-wrap text-xs" data-attr="list-bulk-bar">
- <span className="font-semibold px-1">{selectedRecordingsIds.length} selected</span>
- <LemonButton
- size="xsmall"
- onClick={() => setIsAddToCollectionModalOpen(true)}
- disabledReason={accessControlDisabledReason}
- data-attr="add-to-collection"
- >
- Add to collection
- </LemonButton>
- <LemonButton size="xsmall" onClick={() => handleBulkMarkAsViewed(shortId)} data-attr="mark-as-viewed">
- Mark watched
- </LemonButton>
- <LemonButton
- size="xsmall"
- status="danger"
- onClick={() => setIsDeleteSelectedRecordingsDialogOpen(true)}
- disabledReason={accessControlDisabledReason}
- data-attr="delete-recordings"
- >
- Delete
- </LemonButton>
- <LemonMenu items={moreItems} placement="bottom-end" buttonSize="xsmall">
- <LemonButton
- size="xsmall"
- icon={<IconEllipsis />}
- aria-label="More actions"
- data-attr="bulk-action-menu"
- />
- </LemonMenu>
+ <div className="flex flex-1 min-w-0 items-center gap-1 text-xs" data-attr="list-bulk-bar">
+ <span className="font-semibold px-1 shrink-0">{selectedRecordingsIds.length} selected</span>
+ <div className="hidden @min-[24rem]/list-header:flex items-center gap-1">
+ {primaryItems.map((item) => (
+ <LemonButton
+ key={item['data-attr']}
+ size="xsmall"
+ status={item.status}
+ onClick={item.onClick}
+ disabledReason={item.disabledReason}
+ data-attr={item['data-attr']}
+ >
+ {item.label}
+ </LemonButton>
+ ))}
+ <LemonMenu items={moreItems} placement="bottom-end" buttonSize="xsmall">
+ <LemonButton
+ size="xsmall"
+ icon={<IconEllipsis />}
+ aria-label="More actions"
+ data-attr="bulk-action-menu"
+ />
+ </LemonMenu>
+ </div>
+ <div className="@min-[24rem]/list-header:hidden">
+ <LemonMenu items={[...primaryItems, ...moreItems]} placement="bottom-end" buttonSize="xsmall">
+ <LemonButton
+ size="xsmall"
+ icon={<IconEllipsis />}
+ aria-label="Bulk actions"
+ data-attr="bulk-action-menu-narrow"
+ />
+ </LemonMenu>
+ </div>
<ConfirmDeleteRecordings shortId={shortId} />
<AddToCollectionModal shortId={shortId} />
</div>
diff --git a/frontend/src/scenes/session-recordings/playlist/ReplayFilterBar.tsx b/frontend/src/scenes/session-recordings/playlist/ReplayFilterBar.tsx
index c076c105675e..c52778bd0567 100644
--- a/frontend/src/scenes/session-recordings/playlist/ReplayFilterBar.tsx
+++ b/frontend/src/scenes/session-recordings/playlist/ReplayFilterBar.tsx
@@ -15,6 +15,7 @@ import { RecordingUniversalFilters } from '~/types'
import { FilterChips } from './FilterChips'
import { playlistFiltersLogic } from './playlistFiltersLogic'
import { comparableRecordingFilters } from './playlistUtils'
+import { SavedFilterChips } from './SavedFilterChips'
import { SavedFilterEditedBar } from './SavedFilterEditedBar'
import { SavedFilterSelect } from './SavedFilterSelect'
import { sessionRecordingsPlaylistLogic } from './sessionRecordingsPlaylistLogic'
@@ -25,19 +26,20 @@ export function ReplayFilterBar({
totalFiltersCount,
currentSessionRecordingId,
onReload,
+ savedFilterChips,
}: {
filters: RecordingUniversalFilters
setFilters: (filters: Partial<RecordingUniversalFilters>) => void
totalFiltersCount?: number
currentSessionRecordingId?: string
onReload: () => void
+ savedFilterChips?: boolean
}): JSX.Element {
const { sessionRecordingsResponseLoading } = useValues(sessionRecordingsPlaylistLogic)
const { isFiltersExpanded } = useValues(playlistFiltersLogic)
const { setIsFiltersExpanded } = useActions(playlistFiltersLogic)
const { appliedSavedFilter, appliedSavedFilterFilters } = useValues(sessionRecordingSavedFiltersLogic)
const { applyFilters } = useRecordingFiltersAssist({ filters, setFilters, currentSessionRecordingId })
- // registers the filter tool so the PostHog AI side panel can drive this list
useMaxTool({
identifier: 'filter_session_recordings',
context: { current_filters: filters, current_session_id: currentSessionRecordingId },
@@ -71,6 +73,7 @@ export function ReplayFilterBar({
{totalFiltersCount ? <LemonBadge.Number count={totalFiltersCount} size="small" /> : null}
</LemonButton>
<SavedFilterSelect edited={edited} onSaveCurrent={() => setSaveModalOpen(true)} />
+ {savedFilterChips && <SavedFilterChips edited={edited} />}
<FilterChips filters={filters} setFilters={setFilters} />
</div>
<LemonButton
diff --git a/frontend/src/scenes/session-recordings/playlist/ReplayListHeader.tsx b/frontend/src/scenes/session-recordings/playlist/ReplayListHeader.tsx
index d7bbcfe7f9cd..0eb8c72735d5 100644
--- a/frontend/src/scenes/session-recordings/playlist/ReplayListHeader.tsx
+++ b/frontend/src/scenes/session-recordings/playlist/ReplayListHeader.tsx
@@ -58,7 +58,7 @@ export function ReplayListHeader({
return (
<div
- className="shrink-0 bg-bg-3000 flex items-center gap-0.5 whitespace-nowrap border-b text-xs"
+ className="@container/list-header shrink-0 min-w-0 bg-bg-3000 flex items-center gap-0.5 whitespace-nowrap border-b text-xs"
data-attr="list-header-bar"
>
{selectMode ? (
diff --git a/frontend/src/scenes/session-recordings/playlist/SavedFilterChips.tsx b/frontend/src/scenes/session-recordings/playlist/SavedFilterChips.tsx
new file mode 100644
index 000000000000..7de0051c73c2
--- /dev/null
+++ b/frontend/src/scenes/session-recordings/playlist/SavedFilterChips.tsx
@@ -0,0 +1,51 @@
+import { useActions, useValues } from 'kea'
+
+import { LemonButton } from '@posthog/lemon-ui'
+
+import { sessionRecordingSavedFiltersLogic } from 'scenes/session-recordings/filters/sessionRecordingSavedFiltersLogic'
+
+import { SessionRecordingPlaylistType } from '~/types'
+
+import { stripSessionIds } from './playlistUtils'
+import { asUniversalFilters, sessionRecordingsPlaylistLogic } from './sessionRecordingsPlaylistLogic'
+
+// The select beside the chips lists every saved filter, so only the first few get a chip.
+const MAX_CHIPS = 4
+
+export function SavedFilterChips({ edited }: { edited: boolean }): JSX.Element | null {
+ const { savedFilters, appliedSavedFilter } = useValues(sessionRecordingSavedFiltersLogic)
+ const { setAppliedSavedFilter } = useActions(sessionRecordingSavedFiltersLogic)
+ const { applySavedFilter } = useActions(sessionRecordingsPlaylistLogic)
+
+ if (savedFilters.results.length === 0) {
+ return null
+ }
+
+ const apply = (filter: SessionRecordingPlaylistType): void => {
+ const universal = asUniversalFilters(filter.filters)
+ if (!universal) {
+ return
+ }
+ applySavedFilter(stripSessionIds(universal))
+ setAppliedSavedFilter(filter)
+ }
+
+ return (
+ <>
+ {savedFilters.results.slice(0, MAX_CHIPS).map((filter) => (
+ <LemonButton
+ key={filter.short_id}
+ size="small"
+ type="secondary"
+ active={!edited && filter.short_id === appliedSavedFilter?.short_id}
+ onClick={() => apply(filter)}
+ className="max-w-60"
+ truncate
+ data-attr="list-saved-filter-chip"
+ >
+ {filter.name || filter.derived_name || 'Unnamed'}
+ </LemonButton>
+ ))}
+ </>
+ )
+}
diff --git a/frontend/src/scenes/session-recordings/playlist/SessionRecordingPreview.tsx b/frontend/src/scenes/session-recordings/playlist/SessionRecordingPreview.tsx
index a13c41d3d560..165ee4d48011 100644
--- a/frontend/src/scenes/session-recordings/playlist/SessionRecordingPreview.tsx
+++ b/frontend/src/scenes/session-recordings/playlist/SessionRecordingPreview.tsx
@@ -257,6 +257,10 @@ const SessionRecordingPreviewBase = memo(
// The row renders matches_filters, and the same recording flips in and out of matching
// as filters change around an open player, so comparing only the id would keep it stale.
prevProps.recording.matches_filters === nextProps.recording.matches_filters &&
+ // Mark watched and a session ending reload the same ids with viewed and ongoing flipped.
+ prevProps.recording.viewed === nextProps.recording.viewed &&
+ prevProps.recording.ongoing === nextProps.recording.ongoing &&
+ prevProps.recording.viewers?.length === nextProps.recording.viewers?.length &&
prevProps.isActive === nextProps.isActive &&
prevProps.selectable === nextProps.selectable &&
prevProps.order === nextProps.order
@@ -280,6 +284,10 @@ export const SessionRecordingPreview = memo(
// The row renders matches_filters, and the same recording flips in and out of matching
// as filters change around an open player, so comparing only the id would keep it stale.
prevProps.recording.matches_filters === nextProps.recording.matches_filters &&
+ // Mark watched and a session ending reload the same ids with viewed and ongoing flipped.
+ prevProps.recording.viewed === nextProps.recording.viewed &&
+ prevProps.recording.ongoing === nextProps.recording.ongoing &&
+ prevProps.recording.viewers?.length === nextProps.recording.viewers?.length &&
prevProps.isActive === nextProps.isActive &&
prevProps.selectable === nextProps.selectable &&
prevProps.order === nextProps.order
diff --git a/frontend/src/scenes/session-recordings/playlist/SessionRecordingPreviewCompact.tsx b/frontend/src/scenes/session-recordings/playlist/SessionRecordingPreviewCompact.tsx
index e7677045d590..64b3fe67ab79 100644
--- a/frontend/src/scenes/session-recordings/playlist/SessionRecordingPreviewCompact.tsx
+++ b/frontend/src/scenes/session-recordings/playlist/SessionRecordingPreviewCompact.tsx
@@ -2,21 +2,18 @@ import clsx from 'clsx'
import { useValues } from 'kea'
import { memo } from 'react'
-import { IconBug, IconCursorClick, IconHourglass, IconKeyboard, IconLive } from '@posthog/icons'
+import { IconBug, IconCursorClick, IconKeyboard, IconLive } from '@posthog/icons'
import { LemonTag } from '@posthog/lemon-ui'
import { PropertyIcon } from 'lib/components/PropertyIcon/PropertyIcon'
import { TZLabel } from 'lib/components/TZLabel'
-import { SESSION_RECORDINGS_TTL_WARNING_THRESHOLD_DAYS } from 'lib/constants'
import { LemonSkeleton } from 'lib/lemon-ui/LemonSkeleton'
import { Tooltip } from 'lib/lemon-ui/Tooltip'
-import { colonDelimitedDuration } from 'lib/utils/durations'
import { DraggableToNotebook } from 'scenes/notebooks/AddToNotebook/DraggableToNotebook'
import { SimpleTimeLabel } from 'scenes/session-recordings/components/SimpleTimeLabel'
import { TimestampFormat, playerSettingsLogic } from 'scenes/session-recordings/player/playerSettingsLogic'
import { urls } from 'scenes/urls'
-import { RecordingsQuery } from '~/queries/schema/schema-general'
import { SessionRecordingType } from '~/types'
import { asDisplay } from 'products/persons/frontend/person-utils'
@@ -25,6 +22,7 @@ import { gatherIconProperties } from './gatherIconProperties'
import { ItemCheckbox } from './ItemCheckbox'
import { sessionRecordingsListPropertiesLogic } from './sessionRecordingsListPropertiesLogic'
import { DEFAULT_RECORDING_FILTERS_ORDER_BY, sessionRecordingsPlaylistLogic } from './sessionRecordingsPlaylistLogic'
+import { SortMetric } from './SortMetric'
import { UnwatchedIndicator } from './UnwatchedIndicator'
export interface SessionRecordingPreviewCompactProps {
@@ -33,46 +31,6 @@ export interface SessionRecordingPreviewCompactProps {
selectable?: boolean
}
-function formatDuration(seconds: number): string {
- const [hours, minutes, rest] = colonDelimitedDuration(seconds).split(':')
- return hours === '00' ? `${minutes}:${rest}` : `${hours}:${minutes}:${rest}`
-}
-
-function SortMetric({
- recording,
- order,
-}: {
- recording: SessionRecordingType
- order: RecordingsQuery['order']
-}): JSX.Element {
- if (order === 'console_error_count') {
- return (
- <span className="flex items-center gap-x-0.5 font-semibold">
- <IconBug className="text-secondary" />
- {recording.console_error_count ?? '-'}
- </span>
- )
- }
- if (order === 'recording_ttl') {
- const ttl = recording.recording_ttl
- const ttlColor =
- ttl !== undefined && ttl <= SESSION_RECORDINGS_TTL_WARNING_THRESHOLD_DAYS ? 'text-danger' : undefined
- return (
- <span className={clsx('flex items-center gap-x-0.5', ttlColor)}>
- <IconHourglass />
- {ttl === undefined ? '-' : `${ttl}d`}
- </span>
- )
- }
- const seconds =
- order === 'active_seconds'
- ? recording.active_seconds
- : order === 'inactive_seconds'
- ? recording.inactive_seconds
- : recording.recording_duration
- return <span className="tabular-nums">{seconds === undefined ? '-' : formatDuration(seconds)}</span>
-}
-
export const SessionRecordingPreviewCompact = memo(
function SessionRecordingPreviewCompact({
recording,
@@ -231,9 +189,13 @@ export const SessionRecordingPreviewCompact = memo(
},
(prevProps, nextProps) =>
prevProps.recording.id === nextProps.recording.id &&
- // The row renders matches_filters, and the same recording flips in and out of matching
- // as filters change around an open player, so comparing only the id would keep it stale.
+ // The open recording stays listed when filters change, with matches_filters flipped, so the id alone would
+ // keep the row stale.
prevProps.recording.matches_filters === nextProps.recording.matches_filters &&
+ // Mark watched and a session ending reload the same ids with viewed and ongoing flipped.
+ prevProps.recording.viewed === nextProps.recording.viewed &&
+ prevProps.recording.ongoing === nextProps.recording.ongoing &&
+ prevProps.recording.viewers?.length === nextProps.recording.viewers?.length &&
prevProps.isActive === nextProps.isActive &&
prevProps.selectable === nextProps.selectable
)
diff --git a/frontend/src/scenes/session-recordings/playlist/SessionRecordingPreviewFeed.tsx b/frontend/src/scenes/session-recordings/playlist/SessionRecordingPreviewFeed.tsx
new file mode 100644
index 000000000000..695cf8610190
--- /dev/null
+++ b/frontend/src/scenes/session-recordings/playlist/SessionRecordingPreviewFeed.tsx
@@ -0,0 +1,172 @@
+import clsx from 'clsx'
+import { useValues } from 'kea'
+import { memo } from 'react'
+
+import { IconBug, IconCursorClick, IconKeyboard, IconLive } from '@posthog/icons'
+import { LemonTag } from '@posthog/lemon-ui'
+
+import { PropertyIcon } from 'lib/components/PropertyIcon/PropertyIcon'
+import { TZLabel } from 'lib/components/TZLabel'
+import { LemonSkeleton } from 'lib/lemon-ui/LemonSkeleton'
+import { Tooltip } from 'lib/lemon-ui/Tooltip'
+import { DraggableToNotebook } from 'scenes/notebooks/AddToNotebook/DraggableToNotebook'
+import { SimpleTimeLabel } from 'scenes/session-recordings/components/SimpleTimeLabel'
+import { TimestampFormat, playerSettingsLogic } from 'scenes/session-recordings/player/playerSettingsLogic'
+import { urls } from 'scenes/urls'
+
+import { SessionRecordingType } from '~/types'
+
+import { asDisplay } from 'products/persons/frontend/person-utils'
+
+import { gatherIconProperties } from './gatherIconProperties'
+import { ItemCheckbox } from './ItemCheckbox'
+import { sessionRecordingsListPropertiesLogic } from './sessionRecordingsListPropertiesLogic'
+import { DEFAULT_RECORDING_FILTERS_ORDER_BY, sessionRecordingsPlaylistLogic } from './sessionRecordingsPlaylistLogic'
+import { SortMetric } from './SortMetric'
+import { UnwatchedIndicator } from './UnwatchedIndicator'
+
+export interface SessionRecordingPreviewFeedProps {
+ recording: SessionRecordingType
+ isActive?: boolean
+ selectable?: boolean
+}
+
+export const SessionRecordingPreviewFeed = memo(
+ function SessionRecordingPreviewFeed({
+ recording,
+ isActive,
+ selectable = false,
+ }: SessionRecordingPreviewFeedProps): JSX.Element {
+ const { playlistTimestampFormat } = useValues(playerSettingsLogic)
+ const { filters, nextSessionRecording } = useValues(sessionRecordingsPlaylistLogic)
+ const { recordingPropertiesById, recordingPropertiesLoading } = useValues(sessionRecordingsListPropertiesLogic)
+
+ const order = filters.order || DEFAULT_RECORDING_FILTERS_ORDER_BY
+ const recordingProperties = recordingPropertiesById[recording.id]
+ const loading = !recordingProperties && recordingPropertiesLoading
+ const iconProperties = gatherIconProperties(recordingProperties, recording)
+ const errorCount = recording.console_error_count ?? 0
+ const startUrl = recording.start_url?.replace(/https?:\/\//g, '').split(/[?|#]/)[0]
+ // nextSessionRecording is undefined while autoplay is off, so the label disappears with it
+ const upNext = !isActive && nextSessionRecording?.id === recording.id
+
+ return (
+ <DraggableToNotebook href={urls.replaySingle(recording.id)}>
+ <div
+ className={clsx(
+ 'SessionRecordingPreview SessionRecordingPreview--compact group flex items-start gap-x-2 overflow-hidden cursor-pointer py-2 px-2 text-[11px]',
+ isActive && 'SessionRecordingPreview--active'
+ )}
+ >
+ {selectable && (
+ <span className="shrink-0 flex items-center self-center [&_label]:min-h-0">
+ <ItemCheckbox recording={recording} />
+ </span>
+ )}
+ {loading ? (
+ <LemonSkeleton className="w-16 h-16 shrink-0 rounded" />
+ ) : (
+ <div className="grid grid-cols-2 grid-rows-2 gap-0.5 p-0.5 w-16 h-16 shrink-0 rounded border bg-surface-secondary overflow-hidden ph-no-capture">
+ {iconProperties.map(({ property, value, label }) => (
+ <Tooltip key={property} title={label}>
+ <span className="flex items-center justify-center rounded-sm bg-surface-primary leading-none text-base">
+ <PropertyIcon property={property} value={value} />
+ </span>
+ </Tooltip>
+ ))}
+ </div>
+ )}
+ <div className="grow min-w-0 flex flex-col gap-y-0.5">
+ <div className="flex items-start gap-x-1.5">
+ <span
+ className={clsx(
+ 'line-clamp-2 grow text-xs leading-snug ph-no-capture',
+ recording.viewed ? 'font-medium' : 'font-semibold'
+ )}
+ >
+ {asDisplay(recording.person)}
+ </span>
+ {upNext && (
+ <Tooltip title="Autoplay opens this recording when the current one ends.">
+ <LemonTag size="small" className="shrink-0" data-attr="feed-up-next">
+ Up next
+ </LemonTag>
+ </Tooltip>
+ )}
+ {recording.ongoing && (
+ <Tooltip title="This recording is still ongoing - we received data within the last 5 minutes.">
+ <IconLive className="shrink-0 mt-0.5 animate-[pulse_1s_ease-out_infinite] text-primary-3000" />
+ </Tooltip>
+ )}
+ {!recording.viewed && (
+ <span className="shrink-0 pt-1">
+ <UnwatchedIndicator otherViewersCount={recording.viewers?.length || 0} />
+ </span>
+ )}
+ </div>
+ {recording.matches_filters === false && (
+ <Tooltip title="This recording is listed only because it's open. It doesn't match the current filters.">
+ <LemonTag type="warning" size="small" className="self-start">
+ Doesn't match filters
+ </LemonTag>
+ </Tooltip>
+ )}
+ <div className="flex items-center gap-x-2 flex-wrap text-secondary">
+ <Tooltip title="Clicks">
+ <span className="flex items-center gap-x-0.5 shrink-0">
+ <IconCursorClick />
+ {recording.click_count}
+ </span>
+ </Tooltip>
+ <Tooltip title="Key presses">
+ <span className="flex items-center gap-x-0.5 shrink-0">
+ <IconKeyboard />
+ {recording.keypress_count}
+ </span>
+ </Tooltip>
+ {errorCount > 0 && order !== 'console_error_count' && (
+ <Tooltip title="Console errors">
+ <span className="flex items-center gap-x-0.5 shrink-0 text-danger">
+ <IconBug />
+ {errorCount}
+ </span>
+ </Tooltip>
+ )}
+ {playlistTimestampFormat === TimestampFormat.Relative ? (
+ <TZLabel className="shrink-0" time={recording.start_time} placement="right" />
+ ) : (
+ <SimpleTimeLabel
+ startTime={recording.start_time}
+ timestampFormat={playlistTimestampFormat}
+ />
+ )}
+ <span className="grow" />
+ <span className="shrink-0 font-semibold">
+ <SortMetric recording={recording} order={order} />
+ </span>
+ </div>
+ {startUrl && (
+ <span
+ title={`First URL: ${recording.start_url}`}
+ className="truncate text-secondary ph-no-capture"
+ >
+ {startUrl}
+ </span>
+ )}
+ </div>
+ </div>
+ </DraggableToNotebook>
+ )
+ },
+ (prevProps, nextProps) =>
+ prevProps.recording.id === nextProps.recording.id &&
+ // The open recording stays listed when filters change, with matches_filters flipped, so the id alone would
+ // keep the row stale.
+ prevProps.recording.matches_filters === nextProps.recording.matches_filters &&
+ // Mark watched and a session ending reload the same ids with viewed and ongoing flipped.
+ prevProps.recording.viewed === nextProps.recording.viewed &&
+ prevProps.recording.ongoing === nextProps.recording.ongoing &&
+ prevProps.recording.viewers?.length === nextProps.recording.viewers?.length &&
+ prevProps.isActive === nextProps.isActive &&
+ prevProps.selectable === nextProps.selectable
+)
diff --git a/frontend/src/scenes/session-recordings/playlist/SessionRecordingsPlaylist.tsx b/frontend/src/scenes/session-recordings/playlist/SessionRecordingsPlaylist.tsx
index 2a86119e5de3..65f3b6e0526d 100644
--- a/frontend/src/scenes/session-recordings/playlist/SessionRecordingsPlaylist.tsx
+++ b/frontend/src/scenes/session-recordings/playlist/SessionRecordingsPlaylist.tsx
@@ -24,7 +24,8 @@ import { RecordingsUniversalFiltersEmbed } from '../filters/RecordingsUniversalF
import { playerSettingsLogic } from '../player/playerSettingsLogic'
import { SessionRecordingPlayer } from '../player/SessionRecordingPlayer'
import { playlistFiltersLogic } from './playlistFiltersLogic'
-import { isNewReplayLayout } from './replayLayout'
+import { ReplayFilterBar } from './ReplayFilterBar'
+import { isFeedReplayLayout, isNewReplayLayout } from './replayLayout'
import { ReplayListColumn } from './ReplayListColumn'
import { replayListColumnLogic } from './replayListColumnLogic'
import { ReplayListColumnWithPicks } from './ReplayListColumnWithPicks'
@@ -62,9 +63,6 @@ export function SessionRecordingsPlaylist({
}
}, [watchLayout, receivedFeatureFlags, featureFlags, layoutOverridden])
- // The column unmounts while the list is collapsed.
- useMountedLogic(replayListColumnLogic({ logicKey: props.logicKey ?? 'playlist' }))
-
const { sidePanelWidth } = useValues(panelLayoutLogic)
const { isWindowLessThan } = useWindowSize({ widthOffset: sidePanelWidth })
const windowSaysVertical = isWindowLessThan('xl')
@@ -76,15 +74,27 @@ export function SessionRecordingsPlaylist({
}
const isVerticalLayout = layoutRef.current
- const layout = (
- <div className={cn('w-full h-full flex', isVerticalLayout ? 'flex-col' : 'flex-row gap-2')}>
- {isVerticalLayout ? (
- <VerticalLayout {...props} picksInList={picksInList} watchLayout={watchLayout} />
- ) : (
- <HorizontalLayout {...props} picksInList={picksInList} watchLayout={watchLayout} />
- )}
- </div>
+ const { replayLayout } = useValues(playerSettingsLogic)
+ const feedLayout = watchLayout && isFeedReplayLayout(replayLayout)
+
+ const columns = isVerticalLayout ? (
+ <VerticalLayout {...props} picksInList={picksInList} watchLayout={watchLayout} />
+ ) : feedLayout ? (
+ <FeedHorizontalLayout {...props} picksInList={picksInList} watchLayout={watchLayout} />
+ ) : (
+ <HorizontalLayout {...props} picksInList={picksInList} watchLayout={watchLayout} />
)
+ const columnsClassName = cn('w-full flex', isVerticalLayout ? 'flex-col' : 'flex-row gap-2')
+
+ const layout =
+ feedLayout && props.type !== 'collection' ? (
+ <div className="w-full h-full flex flex-col gap-2">
+ <FeedFilterBar />
+ <div className={cn(columnsClassName, 'flex-1 min-h-0')}>{columns}</div>
+ </div>
+ ) : (
+ <div className={cn(columnsClassName, 'h-full')}>{columns}</div>
+ )
return (
<BindLogic logic={sessionRecordingsPlaylistLogic} props={logicProps}>
@@ -109,21 +119,30 @@ type LayoutProps = Omit<SessionRecordingsPlaylistProps, 'picksInList' | 'watchLa
function PlaylistColumn({ picksInList, ...props }: LayoutProps): JSX.Element {
const { isPlaylistCollapsed, replayLayout } = useValues(playerSettingsLogic)
- if (isPlaylistCollapsed) {
- return <Playlist {...props} />
- }
if (props.watchLayout && isNewReplayLayout(replayLayout)) {
- const logicKey = props.logicKey ?? 'playlist'
- return picksInList ? (
- <ReplayListColumnWithPicks logicKey={logicKey} recordingsList={<Playlist {...props} />} />
- ) : (
- <ReplayListColumn logicKey={logicKey} recordingsList={<Playlist {...props} />} picksMode={null} />
- )
+ return <WatchPlaylistColumn {...props} picksInList={picksInList} />
+ }
+ if (isPlaylistCollapsed || !picksInList) {
+ return <Playlist {...props} />
}
- if (picksInList) {
- return <HighlightPicksListColumn recordingsList={<Playlist {...props} />} />
+ return <HighlightPicksListColumn recordingsList={<Playlist {...props} />} />
+}
+
+// Owns the column logic, so the chosen segment survives the column unmounting when the list collapses, and only
+// the new layout mounts it.
+function WatchPlaylistColumn({ picksInList, ...props }: LayoutProps): JSX.Element {
+ const { isPlaylistCollapsed } = useValues(playerSettingsLogic)
+ const playlistLogic = useMountedLogic(sessionRecordingsPlaylistLogic)
+ const logicKey = props.logicKey ?? 'playlist'
+ useMountedLogic(replayListColumnLogic({ logicKey, playlistLogicProps: playlistLogic.props }))
+ if (isPlaylistCollapsed) {
+ return <Playlist {...props} />
}
- return <Playlist {...props} />
+ return picksInList ? (
+ <ReplayListColumnWithPicks logicKey={logicKey} recordingsList={<Playlist {...props} />} />
+ ) : (
+ <ReplayListColumn logicKey={logicKey} recordingsList={<Playlist {...props} />} picksMode={null} />
+ )
}
function HorizontalLayout({ picksInList, ...props }: LayoutProps): JSX.Element {
@@ -171,6 +190,68 @@ function HorizontalLayout({ picksInList, ...props }: LayoutProps): JSX.Element {
)
}
+function FeedHorizontalLayout({ picksInList, ...props }: LayoutProps): JSX.Element {
+ const feedRef = useRef<HTMLDivElement>(null)
+
+ const { isPlaylistCollapsed } = useValues(playerSettingsLogic)
+ const { setPlaylistCollapsed } = useActions(playerSettingsLogic)
+ const resizerLogicProps: ResizerLogicProps = {
+ logicKey: 'playlist-resizer-feed',
+ containerRef: feedRef,
+ persistent: true,
+ persistPrefix: '2026-10-23',
+ placement: 'left',
+ closeThreshold: 100,
+ onToggleClosed: (shouldBeClosed) => setPlaylistCollapsed(shouldBeClosed),
+ }
+
+ const { desiredSize } = useValues(resizerLogic(resizerLogicProps))
+
+ return (
+ <>
+ <PlayerWrapper {...props} className="h-full flex-1 shrink" />
+ <div
+ ref={feedRef}
+ className={cn('relative flex flex-col shrink-0', {
+ 'w-3': isPlaylistCollapsed,
+ })}
+ // eslint-disable-next-line react/forbid-dom-props
+ style={
+ isPlaylistCollapsed
+ ? {}
+ : {
+ width: desiredSize ?? 400,
+ minWidth: 'min-content',
+ maxWidth: '50%',
+ }
+ }
+ data-attr="replay-feed-column"
+ >
+ <PlaylistColumn {...props} picksInList={picksInList} />
+ {!isPlaylistCollapsed && (
+ <Resizer {...resizerLogicProps} visible={false} offset="0.25rem" handleClassName="rounded my-1" />
+ )}
+ </div>
+ </>
+ )
+}
+
+function FeedFilterBar(): JSX.Element {
+ const { filters, totalFiltersCount, activeSessionRecordingId } = useValues(sessionRecordingsPlaylistLogic)
+ const { setFilters, maybeLoadSessionRecordings } = useActions(sessionRecordingsPlaylistLogic)
+
+ return (
+ <ReplayFilterBar
+ filters={filters}
+ setFilters={setFilters}
+ totalFiltersCount={totalFiltersCount}
+ currentSessionRecordingId={activeSessionRecordingId}
+ onReload={() => maybeLoadSessionRecordings()}
+ savedFilterChips
+ />
+ )
+}
+
function VerticalLayout({ picksInList, ...props }: LayoutProps): JSX.Element {
const playerRef = useRef<HTMLDivElement>(null)
@@ -255,7 +336,7 @@ function PlayerWrapper({
pinnedFilters,
sessionRecordingsResponseLoading,
} = useValues(sessionRecordingsPlaylistLogic)
- const { setFilters, resetFilters, setSelectedRecordingId, loadAllRecordings } =
+ const { setFilters, applySavedFilter, resetFilters, setSelectedRecordingId, loadAllRecordings } =
useActions(sessionRecordingsPlaylistLogic)
const { isFiltersExpanded } = useValues(playlistFiltersLogic)
@@ -279,6 +360,7 @@ function PlayerWrapper({
resetFilters={resetFilters}
filters={filters}
setFilters={setFilters}
+ applySavedFilter={applySavedFilter}
totalFiltersCount={totalFiltersCount}
allowReplayHogQLFilters={allowHogQLFilters}
pinnedFilters={pinnedFilters}
@@ -339,7 +421,7 @@ function PlayerWrapper({
<div className="mt-20">
<EmptyMessage
title="No recording selected"
- description="Please select a recording from the list on the left"
+ description="Pick a recording from the list to watch it"
buttonText="Learn more about recordings"
buttonTo="https://posthog.com/docs/user-guides/recordings"
/>
diff --git a/frontend/src/scenes/session-recordings/playlist/SortMetric.tsx b/frontend/src/scenes/session-recordings/playlist/SortMetric.tsx
new file mode 100644
index 000000000000..ccd4dcfb58b0
--- /dev/null
+++ b/frontend/src/scenes/session-recordings/playlist/SortMetric.tsx
@@ -0,0 +1,49 @@
+import clsx from 'clsx'
+
+import { IconBug, IconHourglass } from '@posthog/icons'
+
+import { SESSION_RECORDINGS_TTL_WARNING_THRESHOLD_DAYS } from 'lib/constants'
+import { colonDelimitedDuration } from 'lib/utils/durations'
+
+import { RecordingsQuery } from '~/queries/schema/schema-general'
+import { SessionRecordingType } from '~/types'
+
+function formatDuration(seconds: number): string {
+ const [hours, minutes, rest] = colonDelimitedDuration(seconds).split(':')
+ return hours === '00' ? `${minutes}:${rest}` : `${hours}:${minutes}:${rest}`
+}
+
+export function SortMetric({
+ recording,
+ order,
+}: {
+ recording: SessionRecordingType
+ order: RecordingsQuery['order']
+}): JSX.Element {
+ if (order === 'console_error_count') {
+ return (
+ <span className="flex items-center gap-x-0.5 font-semibold">
+ <IconBug className="text-secondary" />
+ {recording.console_error_count ?? '-'}
+ </span>
+ )
+ }
+ if (order === 'recording_ttl') {
+ const ttl = recording.recording_ttl
+ const ttlColor =
+ ttl !== undefined && ttl <= SESSION_RECORDINGS_TTL_WARNING_THRESHOLD_DAYS ? 'text-danger' : undefined
+ return (
+ <span className={clsx('flex items-center gap-x-0.5', ttlColor)}>
+ <IconHourglass />
+ {ttl === undefined ? '-' : `${ttl}d`}
+ </span>
+ )
+ }
+ const seconds =
+ order === 'active_seconds'
+ ? recording.active_seconds
+ : order === 'inactive_seconds'
+ ? recording.inactive_seconds
+ : recording.recording_duration
+ return <span className="tabular-nums">{seconds === undefined ? '-' : formatDuration(seconds)}</span>
+}
diff --git a/frontend/src/scenes/session-recordings/playlist/filterChipLeaves.ts b/frontend/src/scenes/session-recordings/playlist/filterChipLeaves.ts
index 4b53654003a2..5d64484a737d 100644
--- a/frontend/src/scenes/session-recordings/playlist/filterChipLeaves.ts
+++ b/frontend/src/scenes/session-recordings/playlist/filterChipLeaves.ts
@@ -8,7 +8,6 @@ export interface FilterLeaf {
filter: UniversalFilterValue
}
-/** Every condition in the group tree, in display order. */
export function filterLeaves(group: UniversalFiltersGroup, path: number[] = []): FilterLeaf[] {
return group.values.flatMap((value, index) =>
isUniversalGroupFilterLike(value)
diff --git a/frontend/src/scenes/session-recordings/playlist/playlistUtils.test.ts b/frontend/src/scenes/session-recordings/playlist/playlistUtils.test.ts
index bfcde8d6c3a5..468697adf5da 100644
--- a/frontend/src/scenes/session-recordings/playlist/playlistUtils.test.ts
+++ b/frontend/src/scenes/session-recordings/playlist/playlistUtils.test.ts
@@ -203,12 +203,11 @@ describe('stripSessionIds()', () => {
},
}
- it('strips session ids, leaves other filter fields untouched', () => {
- const result = stripSessionIds({
- ...baseFilters,
- session_ids: ['019d68e1-1165-7cf9-b87b-759fe1604d99'],
- })
- expect(result).toEqual(baseFilters)
+ it.each([
+ ['session ids', { session_ids: ['019d68e1-1165-7cf9-b87b-759fe1604d99'] }],
+ ['the person picked from the player', { person_uuid: '019d68e1-1165-7cf9-b87b-759fe1604d99' }],
+ ])('strips %s, leaves other filter fields untouched', (_name, extra) => {
+ expect(stripSessionIds({ ...baseFilters, ...extra })).toEqual(baseFilters)
})
it('returns the same reference when session_ids is absent', () => {
diff --git a/frontend/src/scenes/session-recordings/playlist/playlistUtils.ts b/frontend/src/scenes/session-recordings/playlist/playlistUtils.ts
index 78dd08e0bed1..ae3013a1f36b 100644
--- a/frontend/src/scenes/session-recordings/playlist/playlistUtils.ts
+++ b/frontend/src/scenes/session-recordings/playlist/playlistUtils.ts
@@ -24,15 +24,12 @@ import {
UniversalFilterValue,
} from '~/types'
-/**
- * There's an edge case (ticket) where depending on entrypoint to Replay, pre-seeded
- * session IDs can be accidentally saved explicilty as part of a saved filter (unintentionally)
- */
+// Pre-seeded session ids and the person picked from the player belong to the open list, not to a saved filter.
export function stripSessionIds<T extends Partial<RecordingUniversalFilters> | undefined | null>(filters: T): T {
- if (!filters || !('session_ids' in filters)) {
+ if (!filters || !('session_ids' in filters || 'person_uuid' in filters)) {
return filters
}
- const { session_ids: _session_ids, ...rest } = filters
+ const { session_ids: _session_ids, person_uuid: _person_uuid, ...rest } = filters
return rest as T
}
diff --git a/frontend/src/scenes/session-recordings/playlist/replayLayout.ts b/frontend/src/scenes/session-recordings/playlist/replayLayout.ts
index d1a9b2578e2a..50027cb3b261 100644
--- a/frontend/src/scenes/session-recordings/playlist/replayLayout.ts
+++ b/frontend/src/scenes/session-recordings/playlist/replayLayout.ts
@@ -20,7 +20,6 @@ export function replayLayoutFrom(
return offered && !preferClassicLayout ? offered : 'classic'
}
-/** Every arm shares the compact list, the filter header and the watch player until its own surfaces exist. */
export function isNewReplayLayout(layout: ReplayLayout): boolean {
return layout !== 'classic'
}
@@ -29,3 +28,7 @@ export function isNewReplayLayout(layout: ReplayLayout): boolean {
export function playerUsesWatchLayout(layout: ReplayLayout, logicProps: { watchLayout?: boolean }): boolean {
return isNewReplayLayout(layout) && !!logicProps.watchLayout
}
+
+export function isFeedReplayLayout(layout: ReplayLayout): boolean {
+ return layout === 'youtube'
+}
diff --git a/frontend/src/scenes/session-recordings/playlist/replayListColumnLogic.test.ts b/frontend/src/scenes/session-recordings/playlist/replayListColumnLogic.test.ts
index b0427d6da919..ac9928df7334 100644
--- a/frontend/src/scenes/session-recordings/playlist/replayListColumnLogic.test.ts
+++ b/frontend/src/scenes/session-recordings/playlist/replayListColumnLogic.test.ts
@@ -5,6 +5,7 @@ import { SessionRecordingSidebarTab } from '~/types'
import { playerSidebarLogic } from '../player/sidebar/playerSidebarLogic'
import { replayListColumnLogic } from './replayListColumnLogic'
+import { sessionRecordingsPlaylistLogic } from './sessionRecordingsPlaylistLogic'
describe('replayListColumnLogic', () => {
let logic: ReturnType<typeof replayListColumnLogic.build>
@@ -51,6 +52,15 @@ describe('replayListColumnLogic', () => {
}
)
+ it('shows the recordings when its list is filtered to a person', () => {
+ const playlistLogicProps = { logicKey: 'person' }
+ const column = replayListColumnLogic({ logicKey: 'person', playlistLogicProps })
+ column.mount()
+ column.actions.setSegment('moments')
+ sessionRecordingsPlaylistLogic(playlistLogicProps).actions.filterByPerson('p')
+ expect(column.values.segment).toBe('recordings')
+ })
+
it('switches to moments when something asks for the observations tab', async () => {
await expectLogic(logic, () => {
playerSidebarLogic.actions.setTab(SessionRecordingSidebarTab.OBSERVATIONS)
diff --git a/frontend/src/scenes/session-recordings/playlist/replayListColumnLogic.ts b/frontend/src/scenes/session-recordings/playlist/replayListColumnLogic.ts
index 43c8f64f3ef7..51b2c753de05 100644
--- a/frontend/src/scenes/session-recordings/playlist/replayListColumnLogic.ts
+++ b/frontend/src/scenes/session-recordings/playlist/replayListColumnLogic.ts
@@ -5,12 +5,22 @@ import { playerSidebarLogic } from 'scenes/session-recordings/player/sidebar/pla
import { SessionRecordingSidebarTab } from '~/types'
+import { SessionRecordingPlaylistLogicProps, sessionRecordingsPlaylistLogic } from './sessionRecordingsPlaylistLogic'
+
export type ReplayListSegment = 'picks' | 'recordings' | 'moments'
-export type ReplayListSegmentSource = 'user' | 'observations'
+export type ReplayListSegmentSource = 'user' | 'observations' | 'person-filter'
export type ReplayListPicksMode = 'picks' | 'recordings' | null
+// A column built without its list, as the tests and findMounted callers do, listens to nothing.
+const listActionType = (props: ReplayListColumnLogicProps, action: 'filterByPerson'): string =>
+ props.playlistLogicProps
+ ? sessionRecordingsPlaylistLogic(props.playlistLogicProps).actionTypes[action]
+ : `unbound.${action}`
+
export interface ReplayListColumnLogicProps {
logicKey: string
+ /** The list this column belongs to, so a person filter from the player lands on its recordings. */
+ playlistLogicProps?: SessionRecordingPlaylistLogicProps
}
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
@@ -99,7 +109,12 @@ export const replayListColumnLogic = kea<replayListColumnLogicType>([
},
],
}),
- listeners(({ actions, values }) => ({
+ listeners(({ actions, values, props }) => ({
+ [listActionType(props, 'filterByPerson')]: ({ personUUID }: { personUUID: string | null }) => {
+ if (personUUID) {
+ actions.setSegment('recordings', 'person-filter')
+ }
+ },
setSegment: ({ segment, source }) => {
posthog.capture('session recording list segment changed', { segment, source })
},
diff --git a/frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic.test.ts b/frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic.test.ts
index 6a1fb59a539d..dcc5218d3b1c 100644
--- a/frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic.test.ts
+++ b/frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic.test.ts
@@ -1426,6 +1426,7 @@ describe('sessionRecordingsPlaylistLogic', () => {
it('replaces the filters with the defaults plus the saved keys in one load', async () => {
logic.actions.setFilters({ filter_test_accounts: true, date_from: '-30d' })
+ logic.actions.filterByPerson('p')
await expectLogic(logic, () => {
logic.actions.applySavedFilter({ date_from: '-7d' })
})
@@ -1435,6 +1436,44 @@ describe('sessionRecordingsPlaylistLogic', () => {
})
})
+ describe('filtering by a person', () => {
+ beforeEach(() => {
+ logic = sessionRecordingsPlaylistLogic({ logicKey: 'person_filter', updateSearchParams: true })
+ logic.mount()
+ })
+
+ it.each([
+ { name: 'a second person replaces the first', calls: ['a', 'b'], expected: 'b' },
+ { name: 'null drops the key', calls: ['a', null], expected: undefined },
+ ])('$name', ({ calls, expected }) => {
+ for (const personUUID of calls) {
+ logic.actions.filterByPerson(personUUID)
+ }
+ expect(logic.values.filters.person_uuid).toBe(expected)
+ expect('person_uuid' in logic.values.filters).toBe(expected !== undefined)
+ expect(router.values.searchParams.filters?.person_uuid).toBe(expected)
+ expect(logic.values.totalFiltersCount).toBe(expected ? 1 : 0)
+ })
+
+ it.each([
+ { name: 'reads the person from the URL', picked: null, urlFilters: { person_uuid: 'p' }, expected: 'p' },
+ {
+ name: 'drops the picked person for a URL without one',
+ picked: 'p',
+ urlFilters: { date_from: '-7d' },
+ expected: undefined,
+ },
+ ])('$name', async ({ picked, urlFilters, expected }) => {
+ if (picked) {
+ logic.actions.filterByPerson(picked)
+ }
+ router.actions.push('/replay', { filters: urlFilters })
+ await expectLogic(logic).toFinishAllListeners()
+ expect(logic.values.filters.person_uuid).toBe(expected)
+ expect('person_uuid' in logic.values.filters).toBe(expected !== undefined)
+ })
+ })
+
describe('rehydrating persisted filters', () => {
const props = { logicKey: 'persist_regression', personUUID: 'persist_regression', updateSearchParams: false }
diff --git a/frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic.ts b/frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic.ts
index 5d6bcb69e3a2..20db7149f9ff 100644
--- a/frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic.ts
+++ b/frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic.ts
@@ -353,6 +353,10 @@ export function isValidRecordingFilters(filters: Partial<RecordingUniversalFilte
return false
}
+ if ('person_uuid' in filters && filters.person_uuid !== undefined && typeof filters.person_uuid !== 'string') {
+ return false
+ }
+
if ('duration' in filters) {
if (!Array.isArray(filters.duration)) {
return false
@@ -586,6 +590,9 @@ const applyFilterUpdate = (
date_to: update.date_from && isRelativeDate(update.date_from) ? null : state.date_to,
...update,
}
+ if ('person_uuid' in update && !update.person_uuid) {
+ delete newState.person_uuid
+ }
if (pinnedFilters) {
newState.filter_group = mergePinnedFilters(newState.filter_group, pinnedFilters)
}
@@ -724,6 +731,9 @@ export interface sessionRecordingsPlaylistLogicActions {
applySavedFilter: (filters: Partial<RecordingUniversalFilters>) => {
filters: Partial<RecordingUniversalFilters>
}
+ filterByPerson: (personUUID: string | null) => {
+ personUUID: string | null
+ }
handleBulkAddToPlaylist: (short_id: string) => {
short_id: string
}
@@ -1061,6 +1071,7 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic
setShowSettings: (showSettings: boolean) => ({ showSettings }),
resetFilters: true,
applySavedFilter: (filters: Partial<RecordingUniversalFilters>) => ({ filters }),
+ filterByPerson: (personUUID: string | null) => ({ personUUID }),
applyPropertyFilter: (propertyKey: string, propertyValue: string | undefined) => ({
propertyKey,
propertyValue,
@@ -1179,7 +1190,7 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic
const convertedQuery = convertUniversalFiltersToRecordingsQuery(filters)
const params: RecordingsQuery & { add_events_to_property_queries?: '1' } = {
...convertedQuery,
- person_uuid: props.personUUID ?? '',
+ person_uuid: props.personUUID ?? convertedQuery.person_uuid ?? '',
// KLUDGE: some persons have >8MB of distinct_ids,
// which wouldn't fit in the URL,
// so we limit to 100 distinct_ids for now
@@ -1402,6 +1413,11 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic
resetFilters: () => getResetFilters(props),
applySavedFilter: (_, { filters }) =>
applyFilterUpdate(getResetFilters(props), filters, props.pinnedFilters),
+ // A second person replaces the first. Null drops the key, so the filters match a link without one.
+ filterByPerson: (state, { personUUID }) => {
+ const { person_uuid: _person, ...rest } = state
+ return personUUID ? { ...rest, person_uuid: personUUID } : rest
+ },
},
],
/**
@@ -1428,6 +1444,12 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic
},
resetFilters: () => [],
applySavedFilter: () => [],
+ filterByPerson: (state, { personUUID }) =>
+ personUUID
+ ? state.includes('person_uuid')
+ ? state
+ : [...state, 'person_uuid']
+ : state.filter((viewerKey) => viewerKey !== 'person_uuid'),
},
],
showFilters: [
@@ -1509,6 +1531,7 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic
loadSessionRecordingsSuccess: () => false,
setFilters: () => false,
applySavedFilter: () => false,
+ filterByPerson: () => false,
setAdvancedFilters: () => false,
loadNext: () => false,
loadPrev: () => false,
@@ -1531,6 +1554,7 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic
setFilters: () => [],
resetFilters: () => [],
applySavedFilter: () => [],
+ filterByPerson: () => [],
},
],
isDeleteSelectedRecordingsDialogOpen: [
@@ -1712,6 +1736,12 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic
})
},
+ filterByPerson: () => {
+ actions.loadSessionRecordings()
+ props.onFiltersChange?.(values.filters)
+ actions.loadEventsHaveSessionId()
+ },
+
togglePropertyFilter: ({ propertyKey, propertyValue }) => {
// Validate property value
if (propertyValue === undefined || propertyValue === null) {
@@ -2291,6 +2321,7 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic
return (
changedGroupCount +
(durationChanged ? 1 : 0) +
+ (filters.person_uuid ? 1 : 0) +
(filters.date_from === baselineFilters.date_from && filters.date_to === baselineFilters.date_to
? 0
: 1) +
@@ -2497,6 +2528,7 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic
setFilters: () => buildURL(true),
resetFilters: () => buildURL(true),
applySavedFilter: () => buildURL(true),
+ filterByPerson: () => buildURL(true),
}
}),
@@ -2564,6 +2596,8 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic
...(params.filters && !equal(params.filters, values.filters)
? {
...getDefaultFilters(props.personUUID, props.pinnedFilters, params.filters),
+ // A link without a person drops the one picked from the player.
+ person_uuid: undefined,
...params.filters,
}
: {}),
diff --git a/frontend/src/scenes/session-recordings/playlist/usePlayerMounted.ts b/frontend/src/scenes/session-recordings/playlist/usePlayerMounted.ts
index 17c7062e71f4..ae7f110c856a 100644
--- a/frontend/src/scenes/session-recordings/playlist/usePlayerMounted.ts
+++ b/frontend/src/scenes/session-recordings/playlist/usePlayerMounted.ts
@@ -9,11 +9,9 @@ const PLAYER_MOUNT_WAIT_FRAMES = 20
export type PlayerMountState = 'mounted' | 'waiting' | 'missing'
-/**
- * The player logic is keyed, and the list column renders before the player in the same commit, so the first frame
- * after a recording changes can find no instance yet. Building one from the list would start a second player, so wait
- * a few frames instead, and give up when a host renders the list without a player at all.
- */
+// The list column renders before the keyed player in the same commit, so the first frame after a recording changes
+// finds no instance. Building one here would start a second player, so wait a few frames, and give up when the host
+// renders no player at all.
export function usePlayerMounted(playerLogicProps: SessionRecordingPlayerLogicProps): PlayerMountState {
const [attempts, setAttempts] = useState(0)
const mounted = !!sessionRecordingPlayerLogic.findMounted(playerLogicProps)
diff --git a/frontend/src/scenes/session-recordings/playlist/watchListViewMenuItems.tsx b/frontend/src/scenes/session-recordings/playlist/watchListViewMenuItems.tsx
index 6a83489bd4ac..138880fbaa7f 100644
--- a/frontend/src/scenes/session-recordings/playlist/watchListViewMenuItems.tsx
+++ b/frontend/src/scenes/session-recordings/playlist/watchListViewMenuItems.tsx
@@ -18,10 +18,7 @@ import {
} from './sessionRecordingsPlaylistLogic'
import { getRecommendedFilterChange, getSortChangedEvent } from './SessionRecordingsPlaylistSettings'
-/**
- * The watch layout's sort options. Clicks, keystrokes, mouse activity, expiration, active and inactive duration
- * were dropped for low use. A list already sorted by one of them keeps it until the sort changes.
- */
+// A list already sorted by an order outside this set keeps it until the sort changes.
const WATCH_SORTS: { label: string; order: NonNullable<RecordingUniversalFilters['order']> }[] = [
{ label: 'Latest', order: 'start_time' },
{ label: 'Activity', order: 'activity_score' },
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index d5448a375a90..250ba99a03aa 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -1649,6 +1649,7 @@ export interface RecordingUniversalFilters {
filter_test_accounts?: boolean
filter_group: UniversalFiltersGroup
session_ids?: string[]
+ person_uuid?: string
order?: RecordingsQuery['order']
order_direction?: RecordingsQuery['order_direction']
limit?: RecordingsQuery['limit']
diff --git a/products/replay_vision/frontend/components/RecordingMoments.tsx b/products/replay_vision/frontend/components/RecordingMoments.tsx
index a38e843cf135..2aae5c3c28ea 100644
--- a/products/replay_vision/frontend/components/RecordingMoments.tsx
+++ b/products/replay_vision/frontend/components/RecordingMoments.tsx
@@ -312,7 +312,6 @@ function FocusPane({
export interface RecordingMomentsProps {
sessionId: string
- /** The player this column seeks and follows. It is keyed, so the exact mounted instance is named. */
playerLogicProps: SessionRecordingPlayerLogicProps
}
@@ -374,8 +373,7 @@ export function RecordingMoments({ sessionId, playerLogicProps }: RecordingMomen
) : observations.length === 0 ? (
<div className="flex flex-col flex-1 items-center justify-center gap-2 p-4 text-center">
{scanBlock ? (
- // No scanner can clear the gate for this recording, so offering the picker would
- // only lead to an ineligible result.
+ // No scanner can clear the gate, so the picker would only lead to an ineligible result.
<>
<p className="text-muted text-sm mb-0" data-attr="vision-observations-tab-skipped">
Replay vision skipped this recording, so it has no summary.
diff --git a/products/replay_vision/frontend/components/SummarizeButton.tsx b/products/replay_vision/frontend/components/SummarizeButton.tsx
index 978ee2f30257..0f787c913b40 100644
--- a/products/replay_vision/frontend/components/SummarizeButton.tsx
+++ b/products/replay_vision/frontend/components/SummarizeButton.tsx
@@ -36,14 +36,13 @@ export function SummarizeButton({
const [consentRequested, setConsentRequested] = useState(false)
const { tooltip: quotaTooltip } = quotaUx(quota)
const blockedReason = useSummarizeBlockedReason(scanBlock)
- // `loading` only disables the button itself. The caret and the menu rows are their own buttons, so
- // without this a second summarizer is one click away mid-run, and it spends the quota again.
+ // `loading` only disables this button. The caret and the menu rows are their own buttons, so without this a
+ // second summarizer can start mid-run and spend the quota again.
const inFlightDisabledReason = summarizePending ? 'A summary is already running' : null
const builtInDisabledReason = inFlightDisabledReason ?? blockedReason()
const scannerDisabledReason = (scanner: ReplayScannerApi): string | null | undefined =>
inFlightDisabledReason ?? blockedReason(scanner)
- // Nobody could tell which summarizer the button used, so it says so. While a scan is running the
- // label is the only thing that says the click landed: the summary takes minutes to arrive.
+ // While a scan runs the label is the only sign the click landed, because the summary takes minutes.
const idleLabel = hasSummary
? 'Summarize again'
: defaultSummarizer
@@ -67,8 +66,7 @@ export function SummarizeButton({
})),
{
key: 'built-in',
- // Every other row is a scanner the team owns and can open. This one is PostHog's, so it
- // carries the logomark and says so, rather than reading as a scanner they cannot find.
+ // This row is PostHog's built-in prompt, not a team scanner they could open, so it says so.
label: (
<span className="flex items-center justify-between gap-2 w-full">
<span className="truncate">{BUILT_IN_SUMMARY_LABEL}</span>
@@ -95,8 +93,7 @@ export function SummarizeButton({
// The endpoint refuses without org AI approval, so ask for it here rather than toasting a 400.
onClick={() => {
posthog.capture('replay_vision_summarize_clicked', {
- // Repeat clicks are the point of this event, and `$session_id` cannot tell them
- // apart from one click each on two recordings.
+ // Repeat clicks on one recording are the point, and `$session_id` cannot tell them from one click each on two.
recording_id: sessionId,
summarizer: defaultSummarizer ? 'configured' : 'built-in',
consent_needed: !dataProcessingAccepted,
diff --git a/products/replay_vision/frontend/components/SummarizeExplainer.tsx b/products/replay_vision/frontend/components/SummarizeExplainer.tsx
index 2bd756ae332a..65b08e59b76e 100644
--- a/products/replay_vision/frontend/components/SummarizeExplainer.tsx
+++ b/products/replay_vision/frontend/components/SummarizeExplainer.tsx
@@ -3,10 +3,7 @@ import { Tooltip } from '@posthog/lemon-ui'
import { visionDocsUrl } from './DocsLink'
-/**
- * The bar sits on every standard replay player, so it reaches people who have never heard of Replay
- * vision and meet the summarize button with no idea what it is or what it will spend.
- */
+/** The bar sits on every standard player, so it reaches people who have never heard of Replay vision. */
export function SummarizeExplainer(): JSX.Element {
return (
<Tooltip
diff --git a/products/replay_vision/frontend/components/SummarizeRecordingBar.tsx b/products/replay_vision/frontend/components/SummarizeRecordingBar.tsx
index e2ed462df3a6..c892348b3953 100644
--- a/products/replay_vision/frontend/components/SummarizeRecordingBar.tsx
+++ b/products/replay_vision/frontend/components/SummarizeRecordingBar.tsx
@@ -63,7 +63,8 @@ function SummarizeRecordingBarContent({
/>
<SummarizeExplainer />
{extraActions}
- {summarizeBlockedReason && (
+ {/* The inline row has no room for it, and the disabled button already says why on hover. */}
+ {!inline && summarizeBlockedReason && (
<Tooltip title={summarizeBlockedReason}>
<span className="ml-auto text-muted text-xs truncate" data-attr="vision-dock-skipped">
{scanBlock ? `Skipped: ${scanBlock.label.toLowerCase()}` : summarizeBlockedReason}
diff --git a/products/replay_vision/frontend/components/useSummarizeBlockedReason.ts b/products/replay_vision/frontend/components/useSummarizeBlockedReason.ts
index b9fecda6682b..58182db4f31b 100644
--- a/products/replay_vision/frontend/components/useSummarizeBlockedReason.ts
+++ b/products/replay_vision/frontend/components/useSummarizeBlockedReason.ts
@@ -9,18 +9,8 @@ import { getReplayVisionEditDisabledReason } from '../utils/accessControl'
import { quotaUx } from '../utils/quotaProjection'
import { ScanBlock } from '../utils/scanEligibility'
-/**
- * Why a summary cannot run on this recording right now, whatever summarizer would run it.
- *
- * Both paths are scanner writes: an inline scan mints a scanner, and `observe` is a write action on
- * the scanner it runs. Each also exposes recording contents, so both need recording read as well. A
- * recording the scan-time gate would refuse is refused for every summarizer, so it blocks the button
- * and each menu row rather than spending a scan that comes back ineligible. Pass a scanner for the
- * object-level check, so one this user cannot edit is refused here rather than by a 403.
- *
- * The bar reads this too: a disabled button explains itself on hover only, which is why people kept
- * clicking one that could never run.
- */
+// Summarizing writes a scanner, named or minted, and reads the recording, and the scan gate refuses a recording for
+// every summarizer alike. So the reason blocks the button and each menu row instead of spending an ineligible scan.
export function useSummarizeBlockedReason(
scanBlock: ScanBlock | null
): (scanner?: ReplayScannerApi | null) => string | null | undefined {
@@ -28,8 +18,7 @@ export function useSummarizeBlockedReason(
const { disabledReason: quotaDisabledReason } = quotaUx(quota)
return (scanner) =>
getReplayVisionEditDisabledReason((scanner?.user_access_level as AccessControlLevel | null) ?? undefined) ??
- // `observe` answers 402 for a scanner that has spent its own credit limit, so a capped one is
- // refused here rather than by a failed request. The built-in prompt has no per-scanner limit.
+ // A scanner past its credit limit answers 402 on observe, so it is refused here. The built-in prompt has no limit.
(scanner?.limit_reached ? limitReachedTooltip(scanner) : null) ??
scanBlock?.reason ??
quotaDisabledReason
diff --git a/products/replay_vision/frontend/logics/observationsDockLogic.ts b/products/replay_vision/frontend/logics/observationsDockLogic.ts
index 21cd019e9aaf..a7f5ce453290 100644
--- a/products/replay_vision/frontend/logics/observationsDockLogic.ts
+++ b/products/replay_vision/frontend/logics/observationsDockLogic.ts
@@ -541,8 +541,8 @@ export const observationsDockLogic = kea<observationsDockLogicType>([
},
showObservations: ({ inWatchLayout }) => {
- // In the watch layout the observations live in the list column's Moments segment, which follows the
- // tab change on its own. Opening the sidebar there would switch the page into Debug mode instead.
+ // In the watch layout the observations live in the list's Moments segment, which follows the tab change
+ // itself. Opening the sidebar there would switch the page into Debug mode.
if (!inWatchLayout) {
actions.setSidebarOpen(true)
}