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.

chore(today): keep recent and frequent items in jump back and remove its flag (#129581)

Shy Alter8f54731d1ca4
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 690ba44b83d3..75e53d3a06dc 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -548,7 +548,6 @@ export const FEATURE_FLAGS = {
TAXONOMIC_FILTER_SEARCH_INTENT: 'taxonomic-filter-search-intent', // owner: @pauldambra multivariate=control,banner,promote, classifies a picker search with the decision model. control changes nothing, banner suggests the right tab, promote moves the predicted group to the top of the All tab
TAXONOMIC_FILTER_VALUE_SEARCH_GATING: 'taxonomic-filter-value-search-gating', // owner: @pauldambra
TEXT_CARD_WORD_ART: 'text-card-word-art', // owner: @jonmcwest, gates the word art insert button in dashboard text cards
- TODAY_JUMP_BACK_RANKING: 'today-jump-back-ranking',
TODAY_RAIL_NAV: 'today-rail-nav', // owner: @k11kirky, replaces the left navigation with a rail (Home, Spaces, Library, Tools) and makes the Today page the homepage
TODAY_REPORT_JEV: 'today-report-jev', // owner: @puemos, asks the decision model to label the problem, cause and fix in a Today report, to mark the numbers a source states, and to pick the code excerpt a finding describes
TOOLBAR_PAID_HEATMAPS: 'toolbar-paid-heatmaps', // owner: #team-web-analytics
diff --git a/frontend/src/scenes/project-homepage/today/Today.stories.tsx b/frontend/src/scenes/project-homepage/today/Today.stories.tsx
index fd43b7d5c1e8..f90794c950c3 100644
--- a/frontend/src/scenes/project-homepage/today/Today.stories.tsx
+++ b/frontend/src/scenes/project-homepage/today/Today.stories.tsx
@@ -932,7 +932,6 @@ export const HomeWithFrequentItems: Story = {
featureFlags: {
[FEATURE_FLAGS.TODAY_RAIL_NAV]: true,
[FEATURE_FLAGS.POSTHOG_CODE_TASK_ANALYSIS]: true,
- [FEATURE_FLAGS.TODAY_JUMP_BACK_RANKING]: 'test',
},
},
decorators: [
@@ -961,17 +960,6 @@ export const HomeWithFrequentItems: Story = {
],
}
-export const HomeWithRecentRanking: Story = {
- ...HomeWithFrequentItems,
- parameters: {
- featureFlags: {
- [FEATURE_FLAGS.TODAY_RAIL_NAV]: true,
- [FEATURE_FLAGS.POSTHOG_CODE_TASK_ANALYSIS]: true,
- [FEATURE_FLAGS.TODAY_JUMP_BACK_RANKING]: 'control',
- },
- },
-}
-
export const HomeWithSampleReports: Story = {
parameters: { pageUrl: `${urls.projectHomepage()}?sample=1` },
}
diff --git a/frontend/src/scenes/project-homepage/today/TodayRecents.tsx b/frontend/src/scenes/project-homepage/today/TodayRecents.tsx
index 88832d47ab82..bb9e29b66ce4 100644
--- a/frontend/src/scenes/project-homepage/today/TodayRecents.tsx
+++ b/frontend/src/scenes/project-homepage/today/TodayRecents.tsx
@@ -58,8 +58,7 @@ function RecentObjectRow({
export function TodayRecents(): JSX.Element {
useMountedLogic(todayObjectGlanceLogic)
- const { recentObjects, frequentObjectsLoading, recentsHasLoaded, listExpanded, useFrequentJumpBack } =
- useValues(todayLogic)
+ const { recentObjects, frequentObjectsLoading, recentsHasLoaded, listExpanded } = useValues(todayLogic)
const { setListExpanded } = useActions(todayLogic)
const { pickPane } = useActions(todayShellLogic)
const titleId = useId()
@@ -81,7 +80,7 @@ export function TodayRecents(): JSX.Element {
</Collapsible.Trigger>
)}
</div>
- {!recentsHasLoaded || (useFrequentJumpBack && frequentObjectsLoading) ? (
+ {!recentsHasLoaded || frequentObjectsLoading ? (
<p className="TodayHome__note">Finding your items…</p>
) : recentObjects.length === 0 ? (
<p className="TodayHome__note">
diff --git a/frontend/src/scenes/project-homepage/today/todayLogic.test.ts b/frontend/src/scenes/project-homepage/today/todayLogic.test.ts
index fe7dc8936096..8a28cd7da917 100644
--- a/frontend/src/scenes/project-homepage/today/todayLogic.test.ts
+++ b/frontend/src/scenes/project-homepage/today/todayLogic.test.ts
@@ -2,9 +2,6 @@ import { router } from 'kea-router'
import { expectLogic } from 'kea-test-utils'
import posthog from 'posthog-js'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-
import { useMocks } from '~/mocks/jest'
import { recentItemsModel } from '~/models/recentItemsModel'
import { initKeaTests } from '~/test/init'
@@ -57,11 +54,9 @@ describe('todayLogic', () => {
})
it.each([
- { status: 200, variant: 'test' },
- { status: 500, variant: 'test' },
- { status: 200, variant: 'control' },
- { status: 200, variant: false },
- ])('selects $variant ranking when the request returns $status', async ({ status, variant }) => {
+ { status: 200, mixed: true },
+ { status: 500, mixed: false },
+ ])('mixes frequent items into Jump back: $mixed when the request returns $status', async ({ status, mixed }) => {
const entry = (id: string): { id: string; path: string; type: string; ref: string } => ({
id,
path: `Dashboards/${id}`,
@@ -69,12 +64,10 @@ describe('todayLogic', () => {
ref: id,
})
frequentResponse = [status, status === 200 ? [entry('daily'), entry('weekly')] : {}]
- featureFlagLogic.actions.setFeatureFlags([], { [FEATURE_FLAGS.TODAY_JUMP_BACK_RANKING]: variant })
const logic = todayLogic()
logic.mount()
await expectLogic(logic).toFinishAllListeners()
recentItemsModel.actions.loadRecentsSuccess(['a', 'b', 'c', 'd'].map(entry))
- const mixed = status === 200 && variant === 'test'
expect(logic.values.recentObjects.map((item) => item.id)).toEqual(
mixed ? ['a', 'b', 'daily', 'weekly', 'c', 'd'] : ['a', 'b', 'c', 'd']
)
@@ -84,7 +77,6 @@ describe('todayLogic', () => {
expect.objectContaining({
position: 3,
reason: mixed ? 'frequent' : 'recent',
- ranking_variant: variant === 'test' ? 'test' : 'control',
})
)
})
diff --git a/frontend/src/scenes/project-homepage/today/todayLogic.ts b/frontend/src/scenes/project-homepage/today/todayLogic.ts
index 3d1d5c4e9fb1..65400ac7c39e 100644
--- a/frontend/src/scenes/project-homepage/today/todayLogic.ts
+++ b/frontend/src/scenes/project-homepage/today/todayLogic.ts
@@ -5,9 +5,7 @@ import type { LocationChangedPayload } from 'kea-router/lib/types'
import posthog from 'posthog-js'
import { ApiError } from 'lib/api'
-import { FEATURE_FLAGS } from 'lib/constants'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
-import { FeatureFlagsSet, featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { getProductAccessDisabledReason } from 'lib/utils/accessControlUtils'
import { withTimeout } from 'lib/utils/async'
import { isObject } from 'lib/utils/guards'
@@ -45,7 +43,7 @@ import {
type TodayForYouRows,
} from './todayForYouRows'
import { todayHighlightsLogic } from './todayHighlightsLogic'
-import { JumpBackObject, jumpBackObjectsForHome, recentObjectsForHome } from './todayRecentObjects'
+import { JumpBackObject, jumpBackObjectsForHome } from './todayRecentObjects'
import { type TodayReportPreview, reportPreview } from './todayReportPreviews'
import type { TodayReportState } from './todayReportState'
import { isSampleReportId, parseSampleParam, sampleTopReports } from './todaySampleReports'
@@ -160,7 +158,6 @@ interface TodayRankedReport {
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface todayLogicValues {
- featureFlags: FeatureFlagsSet // featureFlagLogic
recents: FileSystemEntry[] // recentItemsModel
recentsHasLoaded: boolean // recentItemsModel
currentProjectId: number | string // teamLogic
@@ -210,7 +207,6 @@ export interface todayLogicValues {
shownReportIds: string[]
topReports: TodayReports | null
topReportsLoading: boolean
- useFrequentJumpBack: boolean
useSampleData: boolean
}
@@ -370,12 +366,7 @@ export interface todayLogicMeta {
moreReportCount: (topReports: TodayReports | null) => number
hour: (now: number) => number
greeting: (hour: number, user: UserType | null) => string
- useFrequentJumpBack: (featureFlags: FeatureFlagsSet) => boolean
- recentObjects: (
- recents: FileSystemEntry[],
- frequentObjects: FileSystemEntry[],
- useFrequentJumpBack: boolean
- ) => JumpBackObject[]
+ recentObjects: (recents: FileSystemEntry[], frequentObjects: FileSystemEntry[]) => JumpBackObject[]
shownReportIds: (reports: SignalReport[]) => string[]
currentMoreReports: (
moreReports: TodayMoreReports | null,
@@ -428,8 +419,6 @@ export const todayLogic = kea<todayLogicType>([
path(['scenes', 'project-homepage', 'today', 'todayLogic']),
connect(() => ({
values: [
- featureFlagLogic,
- ['featureFlags'],
userLogic,
['user'],
teamLogic,
@@ -644,23 +633,10 @@ export const todayLogic = kea<todayLogicType>([
(s) => [s.hour, s.user],
(hour: number, user: UserType | null): string => greetingForHour(hour, user?.first_name),
],
- useFrequentJumpBack: [
- (s) => [s.featureFlags],
- (featureFlags: FeatureFlagsSet): boolean => featureFlags[FEATURE_FLAGS.TODAY_JUMP_BACK_RANKING] === 'test',
- ],
recentObjects: [
- (s) => [s.recents, s.frequentObjects, s.useFrequentJumpBack],
- (
- recents: FileSystemEntry[],
- frequentObjects: FileSystemEntry[],
- useFrequentJumpBack: boolean
- ): JumpBackObject[] =>
- useFrequentJumpBack
- ? jumpBackObjectsForHome(recents, frequentObjects, RECENT_OBJECT_MORE_COUNT)
- : recentObjectsForHome(recents, RECENT_OBJECT_MORE_COUNT).map((entry) => ({
- ...entry,
- jumpBackReason: 'recent',
- })),
+ (s) => [s.recents, s.frequentObjects],
+ (recents: FileSystemEntry[], frequentObjects: FileSystemEntry[]): JumpBackObject[] =>
+ jumpBackObjectsForHome(recents, frequentObjects, RECENT_OBJECT_MORE_COUNT),
],
shownReportIds: [(s) => [s.reports], (reports: SignalReport[]): string[] => reports.map((report) => report.id)],
currentMoreReports: [
@@ -839,7 +815,6 @@ export const todayLogic = kea<todayLogicType>([
object_ref: entry.ref ?? entry.id,
position,
reason: frequent ? 'frequent' : 'recent',
- ranking_variant: values.useFrequentJumpBack ? 'test' : 'control',
})
}
},
@@ -943,7 +918,7 @@ export const todayLogic = kea<todayLogicType>([
posthog.capture('today home loaded', {
report_count: topReports.results.length,
more_report_count: values.moreReportCount,
- jump_back_ranking: values.useFrequentJumpBack ? 'recent-and-frequent-v1' : 'recent-v1',
+ jump_back_ranking: 'recent-and-frequent-v1',
})
},
loadMoreReports: () => {