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-vision): simplify the watch feed card on the jev arm (#111339)

Kim Svatos Dugan997a2d121448
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index b0d4a60d58e2..453f87bb4453 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -12526,6 +12526,10 @@ snapshots:
hash: v1.k794b7964.b6c0021cb654a1959c5f31038f0d0bfc677d02e14feee183cd6c4e116db5242b.z8lywqGVYD1SrmfpwUCvjNguFhzC69zsQh8dHfKnhGM
scenes-app-replay-vision--home-watch-feed-grid--light:
hash: v1.k794b7964.eef70399f888f57b020a2ec2df31807c2ab0fab72d763576aa997d792a869677.Q2y0D347yvVcCTX-e9lPPuFzqH1fcfpoXQqwc087OWk
+ scenes-app-replay-vision--home-watch-feed-jev-arm--dark:
+ hash: v1.k794b7964.14c105726bec9b14859f5c22e60a198ffcd45ebb6964396ff29e58a7d28e8a9b._tnsXoKaklpg5mu-_pYlJ7jP4ZgvBVQ8Br26aMTTVno
+ scenes-app-replay-vision--home-watch-feed-jev-arm--light:
+ hash: v1.k794b7964.8fbaeb68c75802f8f94d64de988648eb7bb5bc5da5a0b65556682153bcd951be.Vxqw0lp7Muoy-ftkGrEUVvcHyRKLg_tJ5GzaWzu1kQ4
scenes-app-replay-vision--home-watch-feed-only-newest--dark:
hash: v1.k794b7964.4bdb8bb02fdf4e1402f3187ef680ef0bf1081f23689307facdbbe83906c6077f.LfMy-ghDtnRl-yhFxu1Xc7L8o2ZVkHtnzxtov82AuZY
scenes-app-replay-vision--home-watch-feed-only-newest--light:
diff --git a/products/replay_vision/backend/api/scanners.py b/products/replay_vision/backend/api/scanners.py
index 03ce45b5d201..fa6caa4592b6 100644
--- a/products/replay_vision/backend/api/scanners.py
+++ b/products/replay_vision/backend/api/scanners.py
@@ -1714,6 +1714,14 @@ class WatchFeedResponseSerializer(serializers.Serializer):
"so a quiet window answers with a handful of rows rather than a full page of newest clips."
),
)
+ ranker = serializers.ChoiceField(
+ choices=["weighted-score", "jev"],
+ help_text=(
+ "Which ranker ordered this feed: `jev` ranks on the decision model's cached judgments, "
+ "`weighted-score` on the deterministic blend. The arm is decided server-side per team, so "
+ "clients read it from here rather than evaluating the flag themselves."
+ ),
+ )
class ScannerCreatorsResponseSerializer(serializers.Serializer):
@@ -2412,8 +2420,10 @@ class ReplayScannerViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixin, vi
)
# The flag selects one of two independent rankers; nothing is blended between them. Shadow
# teams rank on the weighted score too, because only the `jev` arm reads the probabilities
- # the hourly sweep cached. Neither arm makes a model call here.
- if watch_feed_ranker(self.team_id) == "jev":
+ # the hourly sweep cached. Neither arm makes a model call here. The response names the
+ # ranker that ordered it, so the shadow arm reads as weighted-score to the client.
+ ranker = "jev" if watch_feed_ranker(self.team_id) == "jev" else "weighted-score"
+ if ranker == "jev":
probabilities = load_watch_ranks(self.team_id, allowed_ids)
jev_rows = list(candidate_rows)
# The recency slice above holds only each scanner's newest rows, which on a high-volume
@@ -2469,7 +2479,7 @@ class ReplayScannerViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixin, vi
for entry in ranked
if entry.observation_id in rows
]
- return Response({"results": results})
+ return Response({"results": results, "ranker": ranker})
@extend_schema(
request=ObserveRequestSerializer,
diff --git a/products/replay_vision/backend/tests/test_api.py b/products/replay_vision/backend/tests/test_api.py
index a7fe397a1a3c..a32914e47c0b 100644
--- a/products/replay_vision/backend/tests/test_api.py
+++ b/products/replay_vision/backend/tests/test_api.py
@@ -4953,6 +4953,8 @@ class TestWatchFeedAPI(_VisionAPITestCase):
with patch(ranker, return_value=mode):
resp = self.client.get(self.feed_url)
items = resp.json()["results"]
+ # The shadow arm ranks on the weighted score, so the response names that ranker too.
+ self.assertEqual(resp.json()["ranker"], "weighted-score", mode)
# The signal and the verdict hit lead as today; the cached 0.95 moves nothing.
self.assertEqual(
[item["observation"]["session_id"] for item in items],
@@ -4965,6 +4967,7 @@ class TestWatchFeedAPI(_VisionAPITestCase):
with patch(ranker, return_value="jev"):
resp = self.client.get(self.feed_url)
items = resp.json()["results"]
+ self.assertEqual(resp.json()["ranker"], "jev")
# jev-high carries evidence; the 0.2 row and the unjudged row fall to the filler tier by
# recency, so neither claims the model judged it worth watching.
self.assertEqual(
diff --git a/products/replay_vision/frontend/generated/api.schemas.ts b/products/replay_vision/frontend/generated/api.schemas.ts
index 49c07f959ea5..2cfad8713b92 100644
--- a/products/replay_vision/frontend/generated/api.schemas.ts
+++ b/products/replay_vision/frontend/generated/api.schemas.ts
@@ -2742,12 +2742,28 @@ export interface WatchFeedItemApi {
reason: WatchFeedReasonApi
}
+/**
+ * * `weighted-score` - weighted-score
+ * * `jev` - jev
+ */
+export type RankerEnumApi = (typeof RankerEnumApi)[keyof typeof RankerEnumApi]
+
+export const RankerEnumApi = {
+ WeightedScore: 'weighted-score',
+ Jev: 'jev',
+} as const
+
/**
* Response of GET /vision/scanners/watch_feed/.
*/
export interface WatchFeedResponseApi {
/** Succeeded observations in the window worth watching, most interesting first, each carrying the reason it ranked. Every observation that carries a finding is returned; observations that carry none (`unviewed_recent`, `recent`) are returned only to pad a near-empty feed to three items, so a quiet window answers with a handful of rows rather than a full page of newest clips. */
results: WatchFeedItemApi[]
+ /** Which ranker ordered this feed: `jev` ranks on the decision model's cached judgments, `weighted-score` on the deterministic blend. The arm is decided server-side per team, so clients read it from here rather than evaluating the flag themselves.
+ *
+ * * `weighted-score` - weighted-score
+ * * `jev` - jev */
+ ranker: RankerEnumApi
}
export type VisionAlertsListParams = {
diff --git a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx
index 6bf5344ccc40..9a5d651a4ebf 100644
--- a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx
+++ b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx
@@ -948,6 +948,91 @@ export const HomeWatchFeedGrid: StoryObj = {
},
}
+// The jev ranker arm serves the simplified card: the scan's own sentence plus a scanner chip and
+// person line, with the question and verdict behind the chip's tooltip. The first card leads with
+// the scan's notability sentence, the second falls back to the derived headline, and the filler
+// row reads muted with no finding claim.
+export const HomeWatchFeedJevArm: StoryObj = {
+ decorators: [
+ mswDecorator({
+ get: {
+ '/api/projects/:team_id/vision/scanners/watch_feed/': {
+ ranker: 'jev',
+ results: [
+ {
+ observation: observation({
+ id: '00000000-0000-0000-0000-0000000000e1',
+ prompt_question: 'Did the user hesitate at checkout?',
+ scanner_id: scanners.results[0].id,
+ scanner_snapshot: {
+ name: 'Confused checkout',
+ scanner_type: 'monitor',
+ scanner_version: 1,
+ model: 'gemini-3.8-flash',
+ provider: 'google',
+ emits_signals: true,
+ scanner_config: { prompt: 'Did the user hesitate at checkout?' },
+ },
+ scanner_result: {
+ model_output: {
+ scanner_type: 'monitor',
+ verdict: 'yes',
+ confidence: 0.92,
+ reasoning: 'Retried the payment form twice before completing.',
+ key_moment_ms: 154000,
+ },
+ signals_count: 0,
+ },
+ viewed: false,
+ }),
+ reason: {
+ kind: 'jev_watchable',
+ jev_probability: 0.91,
+ notability_reason:
+ 'The card form rejected a valid card three times before the user abandoned the checkout.',
+ },
+ },
+ {
+ observation: observation({
+ id: '00000000-0000-0000-0000-0000000000e2',
+ prompt_question: 'How strong is the buying intent in this session?',
+ scanner_id: scanners.results[3].id,
+ scanner_snapshot: {
+ name: 'Intent score',
+ scanner_type: 'scorer',
+ scanner_version: 1,
+ model: 'gemini-3.8-flash',
+ provider: 'google',
+ emits_signals: false,
+ scanner_config: { prompt: 'Score this session.', scale: { min: 0, max: 10 } },
+ },
+ scanner_result: {
+ model_output: {
+ scanner_type: 'scorer',
+ score: 9.5,
+ confidence: 0.88,
+ reasoning: 'Compared plans, opened billing, invited a teammate.',
+ },
+ signals_count: 0,
+ },
+ viewed: true,
+ }),
+ reason: { kind: 'jev_watchable', jev_probability: 0.48 },
+ },
+ {
+ observation: observation({ id: '00000000-0000-0000-0000-0000000000e3' }),
+ reason: { kind: 'unviewed_recent' },
+ },
+ ],
+ },
+ },
+ }),
+ ],
+ parameters: {
+ featureFlags: { [FEATURE_FLAGS.REPLAY_VISION_HOME_REDESIGN_EXPERIMENT]: 'test' },
+ },
+}
+
// A quiet window: nothing scored on any source, so the feed pads to three newest clips and says so
// rather than filling the page with them.
export const HomeWatchFeedOnlyNewest: StoryObj = {
diff --git a/products/replay_vision/frontend/replay_scanners/components/WatchFeedCard.test.ts b/products/replay_vision/frontend/replay_scanners/components/WatchFeedCard.test.ts
index 62628217b115..581b17ad610f 100644
--- a/products/replay_vision/frontend/replay_scanners/components/WatchFeedCard.test.ts
+++ b/products/replay_vision/frontend/replay_scanners/components/WatchFeedCard.test.ts
@@ -1,5 +1,12 @@
import type { ReplayObservationApi, WatchFeedReasonApi } from '../../generated/api.schemas'
-import { observationKeyMomentMs, watchCardHeadline, watchReasonCopy, watchStartSeconds } from './WatchFeedCard'
+import {
+ jevCardContext,
+ jevCardSentence,
+ observationKeyMomentMs,
+ watchCardHeadline,
+ watchReasonCopy,
+ watchStartSeconds,
+} from './WatchFeedCard'
describe('WatchFeedCard helpers', () => {
describe('watchReasonCopy', () => {
@@ -155,6 +162,66 @@ describe('WatchFeedCard helpers', () => {
})
})
+ describe('jevCardSentence', () => {
+ it("prefers the scan's notability sentence over the derived headline", () => {
+ const sentence = jevCardSentence(
+ observation('monitor', { reasoning: 'Retried the form twice. The submit then failed.' }),
+ {
+ kind: 'jev_watchable',
+ jev_probability: 0.9,
+ notability_reason: 'The card form rejected a valid card three times.',
+ } as WatchFeedReasonApi
+ )
+ expect(sentence).toBe('The card form rejected a valid card three times.')
+ })
+
+ it('derives the headline when the reason carries no notability sentence', () => {
+ const sentence = jevCardSentence(
+ observation('monitor', { reasoning: 'Retried the form twice. The submit then failed.' }),
+ { kind: 'jev_watchable', jev_probability: 0.9 } as WatchFeedReasonApi
+ )
+ expect(sentence).toBe('Retried the form twice.')
+ })
+
+ it('falls back to the scanner name when the scan wrote no prose', () => {
+ const bare = {
+ scanner_snapshot: { name: 'Confused checkout', scanner_type: 'monitor' },
+ scanner_result: { model_output: {} },
+ } as unknown as ReplayObservationApi
+ expect(jevCardSentence(bare, { kind: 'unviewed_recent' } as WatchFeedReasonApi)).toBe('Confused checkout')
+ })
+ })
+
+ describe('jevCardContext', () => {
+ it('gives the whole derived narration when the notability sentence leads', () => {
+ const context = jevCardContext(
+ observation('monitor', { reasoning: 'Retried the form twice. The submit then failed.' }),
+ {
+ kind: 'jev_watchable',
+ jev_probability: 0.9,
+ notability_reason: 'The card form rejected a valid card three times.',
+ } as WatchFeedReasonApi
+ )
+ expect(context).toBe('Retried the form twice. The submit then failed.')
+ })
+
+ it('never repeats the lead sentence when the derived headline leads', () => {
+ const context = jevCardContext(
+ observation('monitor', { reasoning: 'Retried the form twice. The submit then failed.' }),
+ { kind: 'jev_watchable', jev_probability: 0.9 } as WatchFeedReasonApi
+ )
+ expect(context).toBe('The submit then failed.')
+ })
+
+ it('gives a filler row no context, so it stays small', () => {
+ const context = jevCardContext(
+ observation('monitor', { reasoning: 'Retried the form twice. The submit then failed.' }),
+ { kind: 'unviewed_recent' } as WatchFeedReasonApi
+ )
+ expect(context).toBeNull()
+ })
+ })
+
describe('watchCardHeadline', () => {
it.each<{
name: string
diff --git a/products/replay_vision/frontend/replay_scanners/components/WatchFeedCard.tsx b/products/replay_vision/frontend/replay_scanners/components/WatchFeedCard.tsx
index 1e45f82c4e14..b5ecfe1f6f7e 100644
--- a/products/replay_vision/frontend/replay_scanners/components/WatchFeedCard.tsx
+++ b/products/replay_vision/frontend/replay_scanners/components/WatchFeedCard.tsx
@@ -2,7 +2,7 @@ import { useActions } from 'kea'
import { combineUrl, router } from 'kea-router'
import { IconFlag, IconPlay, IconPlayFilled } from '@posthog/icons'
-import { LemonButton, LemonCard, Link, Tooltip } from '@posthog/lemon-ui'
+import { LemonButton, LemonCard, LemonTag, Link, Tooltip } from '@posthog/lemon-ui'
import { TZLabel } from 'lib/components/TZLabel'
import posthog from 'lib/posthog-typed'
@@ -18,7 +18,7 @@ import type { ReplayObservationApi, WatchFeedItemApi, WatchFeedReasonApi } from
import { OBSERVATION_ORIGIN_PARAM, WATCH_FEED_ORIGIN } from '../../utils/breadcrumbs'
import { citedTextToPlainText } from '../../utils/citations'
import { ScannerType } from '../types'
-import type { WatchFeedView } from '../watchFeedLogic'
+import { type WatchFeedView, watchFeedLogic } from '../watchFeedLogic'
const roundScore = (value: number): number => Math.round(value * 100) / 100
@@ -445,6 +445,166 @@ export function WatchFeedCard({ item, position }: WatchFeedCardProps): JSX.Eleme
)
}
+/**
+ * The one sentence a jev-arm card leads with. The scan's notability sentence names the finding, so
+ * it outranks prose derived from the result; the derived headline covers scans from before
+ * notability shipped, and the scanner's name covers scans with no prose at all.
+ */
+export function jevCardSentence(observation: ReplayObservationApi, reason: WatchFeedReasonApi): string {
+ if (reason.notability_reason) {
+ return reason.notability_reason
+ }
+ const headline = watchCardHeadline(observation)
+ return headline?.title ?? ((observation.scanner_snapshot?.name as string | undefined) || '(untitled scanner)')
+}
+
+/**
+ * One muted line of context under the sentence: the scan's prose the sentence did not use. A card
+ * leading with the notability sentence gets the whole derived narration; a card already leading
+ * with the derived headline gets the prose after it. A filler row gets none, so it stays small.
+ */
+export function jevCardContext(observation: ReplayObservationApi, reason: WatchFeedReasonApi): string | null {
+ if (FILLER_REASON_KINDS.has(reason.kind)) {
+ return null
+ }
+ const headline = watchCardHeadline(observation)
+ if (reason.notability_reason) {
+ return [headline?.title, headline?.body?.text].filter(Boolean).join(' ') || null
+ }
+ return headline?.body?.text ?? null
+}
+
+function JevCardScannerChip({
+ observation,
+ scannerName,
+}: {
+ observation: ReplayObservationApi
+ scannerName: string
+}): JSX.Element {
+ const { setScannerIdsFilter } = useActions(watchFeedLogic)
+ const verdict = readResult(observation)?.verdict
+ return (
+ <Tooltip
+ title={
+ <div className="flex flex-col gap-0.5">
+ <span className="font-semibold">{scannerName}</span>
+ {observation.prompt_question && (
+ <span>
+ {observation.prompt_question}
+ {typeof verdict === 'string' && verdict ? ` Answered ${verdict}.` : ''}
+ </span>
+ )}
+ <span className="italic">Click to show only this scanner's clips</span>
+ </div>
+ }
+ >
+ <LemonTag
+ className="max-w-60 cursor-pointer"
+ forceClickable
+ onClick={() => setScannerIdsFilter([observation.scanner_id])}
+ data-attr="vision-watch-feed-scanner-chip"
+ >
+ <span className="truncate">{scannerName}</span>
+ </LemonTag>
+ </Tooltip>
+ )
+}
+
+/** The jev arm's card body: one sentence plus one meta line. The scanner's question, verdict, and
+ * remaining prose sit behind the chip's tooltip and the observation page, so the feed stays scannable. */
+function JevCardBody({ item, data }: { item: WatchFeedItemApi; data: WatchFeedCardData }): JSX.Element {
+ const { observation, reason } = item
+ // A filler row carries no finding, so it must not read like one.
+ const filler = FILLER_REASON_KINDS.has(reason.kind)
+ const context = jevCardContext(observation, reason)
+ return (
+ <>
+ <Link
+ to={data.observationUrl}
+ onClick={data.captureObservationOpened}
+ className="text-default after:absolute after:inset-0 after:content-['']"
+ data-attr="vision-watch-feed-card-body"
+ >
+ <h3 className={`text-sm m-0 line-clamp-2 ${filler ? 'font-medium text-secondary' : 'font-semibold'}`}>
+ {!observation.viewed && <span className="sr-only">New: </span>}
+ {jevCardSentence(observation, reason)}
+ </h3>
+ </Link>
+ {context && <p className="text-muted text-xs m-0 line-clamp-1">{context}</p>}
+ <div className="relative z-10 flex flex-wrap items-center gap-x-2 gap-y-1 min-w-0">
+ <JevCardScannerChip observation={observation} scannerName={data.scannerName} />
+ <WatchCardPerson observation={observation} person={data.person} />
+ </div>
+ </>
+ )
+}
+
+/** The jev arm's list card. Same shell and affordances as WatchFeedCard, with the body cut to
+ * JevCardBody's three lines and the poster sized down so the card hugs its content. */
+export function JevWatchFeedCard({ item, position }: WatchFeedCardProps): JSX.Element {
+ const { observation } = item
+ const data = useWatchFeedCardData(item, position, 'list')
+ return (
+ <div
+ className="@container relative border rounded bg-bg-light p-3 flex gap-3 hover:border-accent"
+ data-attr="vision-watch-feed-card"
+ >
+ {!observation.viewed && <span className="absolute inset-y-0 left-0 w-1 rounded-l bg-accent" aria-hidden />}
+ <div className="relative hidden @md:block w-44 shrink-0 self-start">
+ <WatchClipPoster
+ observation={observation}
+ keyMomentMs={data.keyMomentMs}
+ onWatch={data.watchClipInModal}
+ />
+ {!observation.viewed && (
+ <UnviewedObservationTag className="absolute top-1 left-1 z-10 pointer-events-none" />
+ )}
+ </div>
+ <div className="flex-1 min-w-0 flex flex-col justify-center gap-1.5">
+ <JevCardBody item={item} data={data} />
+ <LemonButton
+ type="secondary"
+ size="xsmall"
+ icon={<IconPlay />}
+ onClick={data.watchClipInModal}
+ className="@md:hidden self-start relative z-10"
+ data-attr="vision-watch-clip"
+ >
+ Watch clip
+ </LemonButton>
+ </div>
+ </div>
+ )
+}
+
+/** The jev arm's grid card: the same shell as WatchFeedGridCard with the body cut to two lines. */
+export function JevWatchFeedGridCard({ item, position }: WatchFeedCardProps): JSX.Element {
+ const { observation } = item
+ const data = useWatchFeedCardData(item, position, 'grid')
+ return (
+ <LemonCard
+ className="relative flex flex-col rounded-lg p-0 overflow-hidden hover:border-accent"
+ data-attr="vision-watch-feed-grid-card"
+ >
+ {!observation.viewed && <span className="absolute inset-x-0 top-0 h-1 z-20 bg-accent" aria-hidden />}
+ <div className="relative">
+ <WatchClipPoster
+ observation={observation}
+ keyMomentMs={data.keyMomentMs}
+ onWatch={data.watchClipInModal}
+ className="rounded-none border-0"
+ />
+ {!observation.viewed && (
+ <UnviewedObservationTag className="absolute top-2 left-2 z-10 pointer-events-none" />
+ )}
+ </div>
+ <div className="flex flex-col gap-2 p-3 min-w-0 flex-1">
+ <JevCardBody item={item} data={data} />
+ </div>
+ </LemonCard>
+ )
+}
+
/** The thumbnail-first layout for the grid view, with the feed's reason as its own closing section. */
export function WatchFeedGridCard({ item, position }: WatchFeedCardProps): JSX.Element {
const { observation, reason } = item
diff --git a/products/replay_vision/frontend/replay_scanners/components/WatchFeedTab.tsx b/products/replay_vision/frontend/replay_scanners/components/WatchFeedTab.tsx
index 44a1fef68e91..3246c5f8ca23 100644
--- a/products/replay_vision/frontend/replay_scanners/components/WatchFeedTab.tsx
+++ b/products/replay_vision/frontend/replay_scanners/components/WatchFeedTab.tsx
@@ -11,7 +11,13 @@ import { FilterPill } from '../../components/FilterPill'
import { visionScannersListLogic } from '../../logics/visionScannersListLogic'
import { SCANNER_TYPE_OPTIONS, ScannerType } from '../types'
import { type WatchFeedView, watchFeedLogic } from '../watchFeedLogic'
-import { FILLER_REASON_KINDS, WatchFeedCard, WatchFeedGridCard } from './WatchFeedCard'
+import {
+ FILLER_REASON_KINDS,
+ JevWatchFeedCard,
+ JevWatchFeedGridCard,
+ WatchFeedCard,
+ WatchFeedGridCard,
+} from './WatchFeedCard'
import { WatchFeedEmptyState } from './WatchFeedEmptyState'
const TYPE_OPTIONS: { value: ScannerType; label: string }[] = SCANNER_TYPE_OPTIONS.map(({ value, label }) => ({
@@ -71,6 +77,7 @@ export function WatchFeedTab(): JSX.Element {
hasFeedFilters,
emptyReason,
view,
+ feedRanker,
} = useValues(watchFeedLogic)
const {
setDateRange,
@@ -95,6 +102,9 @@ export function WatchFeedTab(): JSX.Element {
// Every card carrying a no-evidence reason means the window produced no findings. A feed that mixes a
// finding with padding needs no explaining, so this stays off unless the whole feed is padding.
const onlyFiller = items.length > 0 && items.every((item) => FILLER_REASON_KINDS.has(item.reason.kind))
+ // The jev arm gets the simplified card, so the experiment compares rankings and layouts as one arm.
+ const ListCard = feedRanker === 'jev' ? JevWatchFeedCard : WatchFeedCard
+ const GridCard = feedRanker === 'jev' ? JevWatchFeedGridCard : WatchFeedGridCard
return (
<div className="@container flex flex-col gap-4">
@@ -210,12 +220,12 @@ export function WatchFeedTab(): JSX.Element {
view === 'grid' ? (
<div className={GRID_CLASS_NAME}>
{items.map((item, index) => (
- <WatchFeedGridCard key={item.observation.id} item={item} position={index} />
+ <GridCard key={item.observation.id} item={item} position={index} />
))}
</div>
) : (
items.map((item, index) => (
- <WatchFeedCard key={item.observation.id} item={item} position={index} />
+ <ListCard key={item.observation.id} item={item} position={index} />
))
)
) : feedFailed ? null : emptyReason ? (
diff --git a/products/replay_vision/frontend/replay_scanners/watchFeedLogic.test.ts b/products/replay_vision/frontend/replay_scanners/watchFeedLogic.test.ts
index 6b88618c89ac..0d672d6cfbbc 100644
--- a/products/replay_vision/frontend/replay_scanners/watchFeedLogic.test.ts
+++ b/products/replay_vision/frontend/replay_scanners/watchFeedLogic.test.ts
@@ -41,7 +41,10 @@ describe('watchFeedLogic', () => {
await expectLogic(logic).toDispatchActions(['loadFeed', 'loadFeedSuccess']).toFinishAllListeners()
expect(logic.values.feedItems).toHaveLength(2)
expect(new URL(feedSpy.mock.calls[0][0].request.url).searchParams.get('date_from')).toBe('-7d')
+ // A response without a ranker (an older API) reads as the default arm.
+ expect(logic.values.feedRanker).toBe('weighted-score')
+ feedSpy.mockImplementation(() => [200, { results: [item('o1', 'jev_watchable')], ranker: 'jev' }])
await expectLogic(logic, () => {
logic.actions.setScannerTypeFilter('monitor')
})
@@ -49,6 +52,8 @@ describe('watchFeedLogic', () => {
.toFinishAllListeners()
const lastUrl = new URL(feedSpy.mock.calls.at(-1)[0].request.url)
expect(lastUrl.searchParams.get('scanner_type')).toBe('monitor')
+ // The response names the ranker, which picks the card layout.
+ expect(logic.values.feedRanker).toBe('jev')
await expectLogic(logic, () => {
logic.actions.setDateRange('-30d', null)
diff --git a/products/replay_vision/frontend/replay_scanners/watchFeedLogic.ts b/products/replay_vision/frontend/replay_scanners/watchFeedLogic.ts
index 6c89174bf0a5..f7b1df79c2c1 100644
--- a/products/replay_vision/frontend/replay_scanners/watchFeedLogic.ts
+++ b/products/replay_vision/frontend/replay_scanners/watchFeedLogic.ts
@@ -13,9 +13,10 @@ import { urls } from 'scenes/urls'
import { tagsModel } from '~/models/tagsModel'
import { visionScannersWatchFeedRetrieve } from '../generated/api'
-import type { ReplayScannerApi, VisionQuotaApi } from '../generated/api.schemas'
+import type { ReplayScannerApi, VisionQuotaApi, WatchFeedResponseApi } from '../generated/api.schemas'
import type { VisionScannersWatchFeedRetrieveParams, WatchFeedItemApi } from '../generated/api.schemas'
import type { ScannerTypeEnumApi } from '../generated/api.schemas'
+import type { RankerEnumApi } from '../generated/api.schemas'
import { visionQuotaLogic } from '../logics/visionQuotaLogic'
import { visionScannersListLogic } from '../logics/visionScannersListLogic'
import { csvParam, parseCsvParam } from '../utils/urlParams'
@@ -35,6 +36,7 @@ export interface watchFeedLogicValues {
feedFailed: boolean
feedItems: WatchFeedItemApi[] | null
feedItemsLoading: boolean
+ feedRanker: WatchFeedRanker
hasFeedFilters: boolean
scannerIdsFilter: string[]
scannerTypeFilter: ScannerType | null
@@ -92,6 +94,9 @@ export interface watchFeedLogicActions {
dateFrom: string | null
dateTo: string | null
}
+ setFeedRanker: (ranker: WatchFeedRanker) => {
+ ranker: RankerEnumApi
+ }
setScannerIdsFilter: (scannerIds: string[]) => {
scannerIds: string[]
}
@@ -146,6 +151,10 @@ export const DEFAULT_FEED_DATE_FROM: string = '-7d'
export type WatchFeedView = 'grid' | 'list'
+/** Which ranker ordered the loaded feed. Server-decided per team (the flag evaluates against the
+ * team, not the viewer), so the client reads it from the response instead of checking the flag. */
+export type WatchFeedRanker = WatchFeedResponseApi['ranker']
+
function reportFiltered(values: watchFeedLogicValues): void {
posthog.capture('replay_vision_watch_feed_filtered', {
date_from: values.dateFrom,
@@ -187,9 +196,10 @@ export const watchFeedLogic = kea<watchFeedLogicType>([
clearFeedFilters: true,
loadFeed: true,
setView: (view: WatchFeedView) => ({ view }),
+ setFeedRanker: (ranker: WatchFeedRanker) => ({ ranker }),
}),
- loaders(({ values }) => ({
+ loaders(({ values, actions }) => ({
feedItems: [
null as WatchFeedItemApi[] | null,
{
@@ -220,6 +230,7 @@ export const watchFeedLogic = kea<watchFeedLogicType>([
const response = await visionScannersWatchFeedRetrieve(String(teamId), params)
// Drop out-of-order responses — the most recent filter change owns the feed.
breakpoint()
+ actions.setFeedRanker(response.ranker ?? 'weighted-score')
return response.results
},
},
@@ -291,6 +302,13 @@ export const watchFeedLogic = kea<watchFeedLogicType>([
loadFeedFailure: () => true,
},
],
+ // Set from each response, so the card layout always matches the ranking it shows.
+ feedRanker: [
+ 'weighted-score' as WatchFeedRanker,
+ {
+ setFeedRanker: (_, { ranker }) => ranker,
+ },
+ ],
}),
listeners(({ actions, values }) => ({
@@ -339,6 +357,7 @@ export const watchFeedLogic = kea<watchFeedLogicType>([
clip_count: items.length,
scanner_count: new Set(items.map((item) => item.observation.scanner_id)).size,
reason_kind_counts: countByReasonKind,
+ ranker: values.feedRanker,
view: values.view,
signal_share: items.length > 0 ? (countByReasonKind.signal_emitted ?? 0) / items.length : 0,
// Which dead end the reader hit, so the empty screens can be counted and ranked
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 53a1e53594c6..4fca1f346e31 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -89146,6 +89146,18 @@ export namespace Schemas {
code_usage_billing_active: boolean;
}
+ /**
+ * * `weighted-score` - weighted-score
+ * * `jev` - jev
+ */
+ export type RankerEnum = typeof RankerEnum[keyof typeof RankerEnum];
+
+
+ export const RankerEnum = {
+ WeightedScore: 'weighted-score',
+ Jev: 'jev',
+ } as const;
+
export interface Rapid7InsightvmScannerFindingSignalExtra {
severity: string | null;
cvss_v3_score: string | null;
@@ -106926,6 +106938,11 @@ export namespace Schemas {
export interface WatchFeedResponse {
/** Succeeded observations in the window worth watching, most interesting first, each carrying the reason it ranked. Every observation that carries a finding is returned; observations that carry none (`unviewed_recent`, `recent`) are returned only to pad a near-empty feed to three items, so a quiet window answers with a handful of rows rather than a full page of newest clips. */
results: WatchFeedItem[];
+ /** Which ranker ordered this feed: `jev` ranks on the decision model's cached judgments, `weighted-score` on the deterministic blend. The arm is decided server-side per team, so clients read it from here rather than evaluating the flag themselves.
+ *
+ * * `weighted-score` - weighted-score
+ * * `jev` - jev */
+ ranker: RankerEnum;
}
export interface WebAnalyticsBotCondition {