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(experiments): migrating the staff scene to the product folder (#108567)

Rodrigo Iloro41739d35d2cd
diff --git a/frontend/src/productScenes.tsx b/frontend/src/productScenes.tsx
index aa7813bfc947..cd51d56236b4 100644
--- a/frontend/src/productScenes.tsx
+++ b/frontend/src/productScenes.tsx
@@ -99,6 +99,7 @@ export const productScenes: Record<string, () => Promise<any>> = {
ErrorTrackingFingerprint: () =>
import('../../products/error_tracking/frontend/scenes/ErrorTrackingFingerprintScene/ErrorTrackingFingerprintScene'),
Experiments: () => import('../../products/experiments/frontend/scenes/ExperimentsScene'),
+ ExperimentsStaffTools: () => import('../../products/experiments/frontend/scenes/ExperimentsStaffToolsScene'),
FeatureFlagTemplates: () => import('../../products/feature_flags/frontend/FeatureFlagTemplatesScene'),
FeatureFlagsStaffTools: () => import('../../products/feature_flags/frontend/staff/FeatureFlagsStaffToolsScene'),
Game368Hedgehogs: () => import('../../products/games/368Hedgehogs/368Hedgehogs'),
diff --git a/frontend/src/products.tsx b/frontend/src/products.tsx
index 362c0f669b55..f17709f05f6f 100644
--- a/frontend/src/products.tsx
+++ b/frontend/src/products.tsx
@@ -180,6 +180,7 @@ export const productRoutes: Record<string, [string, string]> = {
'/error_tracking/alerts/:id': ['HogFunction', 'errorTrackingAlert'],
'/error_tracking/:id': ['ErrorTrackingIssue', 'errorTrackingIssue'],
'/experiments': ['Experiments', 'experiments'],
+ '/experiments/staff': ['ExperimentsStaffTools', 'experimentsStaffTools'],
'/feature_flags/templates': ['FeatureFlagTemplates', 'featureFlagTemplates'],
'/feature_flags/staff': ['FeatureFlagsStaffTools', 'featureFlagsStaffTools'],
'/games/368hedgehogs': ['Game368Hedgehogs', 'game368Hedgehogs'],
@@ -812,6 +813,7 @@ export const productConfiguration: Record<string, any> = {
iconType: 'experiment',
docsHref: 'https://posthog.com/docs/experiments',
},
+ ExperimentsStaffTools: { instanceLevel: true, name: 'Experiments staff tools' },
FeatureFlagTemplates: { projectBased: true, name: 'Feature flag templates' },
FeatureFlagsStaffTools: { instanceLevel: true, name: 'Flags staff tools' },
Game368Hedgehogs: { name: '368Hedgehogs', projectBased: true, activityScope: 'Games' },
@@ -1444,6 +1446,7 @@ export const productUrls = {
return params ? `${baseUrl}?${params}` : baseUrl
},
experiments: (): string => '/experiments',
+ experimentsStaffTools: (): string => '/experiments/staff',
experimentsSharedMetrics: (): string => '/experiments/shared-metrics',
experimentsSharedMetric: (id: string | number, action?: string): string =>
action ? `/experiments/shared-metrics/${id}/${action}` : `/experiments/shared-metrics/${id}`,
diff --git a/frontend/src/scenes/appScenes.ts b/frontend/src/scenes/appScenes.ts
index 36423db21515..9741993dc4fe 100644
--- a/frontend/src/scenes/appScenes.ts
+++ b/frontend/src/scenes/appScenes.ts
@@ -42,7 +42,6 @@ export const appScenes: Record<Scene | string, () => any> = {
[Scene.EventDefinition]: () => import('./data-management/definition/DefinitionView'),
[Scene.Experiment]: () => import('./experiments/Experiment'),
[Scene.ExperimentsSharedMetric]: () => import('./experiments/SharedMetrics/SharedMetric'),
- [Scene.ExperimentsStaffTools]: () => import('./experiments/staff/ExperimentsStaffTools'),
[Scene.ExploreEvents]: () => import('./activity/explore/EventsScene'),
[Scene.ExploreSessions]: () => import('./activity/explore/SessionsScene'),
[Scene.FeatureFlag]: () => import('./feature-flags/FeatureFlag'),
diff --git a/frontend/src/scenes/sceneTypes.ts b/frontend/src/scenes/sceneTypes.ts
index d821bc9e1fc5..a8edffef3a86 100644
--- a/frontend/src/scenes/sceneTypes.ts
+++ b/frontend/src/scenes/sceneTypes.ts
@@ -71,7 +71,6 @@ export enum Scene {
Subscription = 'Subscription',
ExperimentsSharedMetric = 'ExperimentsSharedMetric',
ExperimentsSharedMetrics = 'ExperimentsSharedMetrics',
- ExperimentsStaffTools = 'ExperimentsStaffTools',
ExploreEvents = 'ExploreEvents',
ExploreSessions = 'ExploreSessions',
FeatureFlag = 'FeatureFlag',
diff --git a/frontend/src/scenes/scenes.ts b/frontend/src/scenes/scenes.ts
index 7ae29af06401..baca32ae8aff 100644
--- a/frontend/src/scenes/scenes.ts
+++ b/frontend/src/scenes/scenes.ts
@@ -140,7 +140,6 @@ export const sceneConfigurations: Record<Scene | string, SceneConfig> = {
activityScope: ActivityScope.HOG_FUNCTION,
},
[Scene.DeadLetterQueue]: { instanceLevel: true },
- [Scene.ExperimentsStaffTools]: { instanceLevel: true, name: 'Experiments staff tools' },
[Scene.Destinations]: {
projectBased: true,
name: 'Destinations',
@@ -804,7 +803,7 @@ export const routes: Record<string, [Scene | string, string]> = {
[urls.cohorts()]: [Scene.Cohorts, 'cohorts'],
[urls.experiments()]: [Scene.Experiments, 'experiments'],
// Must come before the parameterized /experiments/:id route
- [urls.experimentsStaffTools()]: [Scene.ExperimentsStaffTools, 'experimentsStaffTools'],
+ [urls.experimentsStaffTools()]: ['ExperimentsStaffTools' as Scene, 'experimentsStaffTools'],
[urls.experimentsSharedMetrics()]: [Scene.ExperimentsSharedMetrics, 'experimentsSharedMetrics'],
[urls.experimentsSharedMetric(':id')]: [Scene.ExperimentsSharedMetric, 'experimentsSharedMetric'],
[urls.experimentsSharedMetric(':id', ':action')]: [Scene.ExperimentsSharedMetric, 'experimentsSharedMetric'],
diff --git a/frontend/src/scenes/urls.ts b/frontend/src/scenes/urls.ts
index 8f1e3c8000fa..88bd9b6dbec1 100644
--- a/frontend/src/scenes/urls.ts
+++ b/frontend/src/scenes/urls.ts
@@ -274,7 +274,6 @@ export const urls = {
asyncMigrationsSettings: (): string => '/instance/async_migrations/settings',
// nosemgrep: frontend-url-hyphen -- shipped app URL, existing links point here
deadLetterQueue: (): string => '/instance/dead_letter_queue',
- experimentsStaffTools: (): string => '/experiments/staff',
materializedColumns: (): string => '/data-management/materialized-columns',
unsubscribe: (): string => '/unsubscribe',
codeCanvasLink: (channelId: string, dashboardId: string): string => `/code/canvas/${channelId}/${dashboardId}`,
diff --git a/frontend/src/scenes/experiments/staff/CacheHealth.tsx b/products/experiments/frontend/components/staff/CacheHealth.tsx
similarity index 98%
rename from frontend/src/scenes/experiments/staff/CacheHealth.tsx
rename to products/experiments/frontend/components/staff/CacheHealth.tsx
index bddfe0ac57d3..e225cb6171da 100644
--- a/frontend/src/scenes/experiments/staff/CacheHealth.tsx
+++ b/products/experiments/frontend/components/staff/CacheHealth.tsx
@@ -12,7 +12,12 @@ import { LemonTable, LemonTableColumns } from 'lib/lemon-ui/LemonTable'
import { LemonTag, LemonTagType } from 'lib/lemon-ui/LemonTag'
import { humanFriendlyLargeNumber, humanFriendlyNumber, humanizeBytes } from 'lib/utils/numbers'
-import { CacheGrowthResponse, CachePartitionRow, CacheTableStats, queryPerformanceLogic } from './queryPerformanceLogic'
+import {
+ CacheGrowthResponse,
+ CachePartitionRow,
+ CacheTableStats,
+ queryPerformanceLogic,
+} from 'products/experiments/frontend/scenes/queryPerformanceLogic'
const GROWTH_RANGE_OPTIONS = [
{ label: '48h', hours: 48 },
diff --git a/frontend/src/scenes/experiments/staff/PrecomputeOverview.tsx b/products/experiments/frontend/components/staff/PrecomputeOverview.tsx
similarity index 99%
rename from frontend/src/scenes/experiments/staff/PrecomputeOverview.tsx
rename to products/experiments/frontend/components/staff/PrecomputeOverview.tsx
index 2203400a72d1..24c80545fa67 100644
--- a/frontend/src/scenes/experiments/staff/PrecomputeOverview.tsx
+++ b/products/experiments/frontend/components/staff/PrecomputeOverview.tsx
@@ -10,8 +10,13 @@ import { Tooltip } from 'lib/lemon-ui/Tooltip'
import { humanFriendlyDuration } from 'lib/utils/durations'
import { humanFriendlyNumber, humanizeBytes } from 'lib/utils/numbers'
+import {
+ EXCEPTION_CODE_LABELS,
+ PrecomputePathStats,
+ queryPerformanceLogic,
+} from 'products/experiments/frontend/scenes/queryPerformanceLogic'
+
import { PrecomputeTrends } from './PrecomputeTrends'
-import { EXCEPTION_CODE_LABELS, PrecomputePathStats, queryPerformanceLogic } from './queryPerformanceLogic'
const TIME_RANGE_OPTIONS = [
{ label: '1h', hours: 1 },
diff --git a/frontend/src/scenes/experiments/staff/PrecomputeTrends.tsx b/products/experiments/frontend/components/staff/PrecomputeTrends.tsx
similarity index 98%
rename from frontend/src/scenes/experiments/staff/PrecomputeTrends.tsx
rename to products/experiments/frontend/components/staff/PrecomputeTrends.tsx
index 346e2666a192..3df7276ac7d9 100644
--- a/frontend/src/scenes/experiments/staff/PrecomputeTrends.tsx
+++ b/products/experiments/frontend/components/staff/PrecomputeTrends.tsx
@@ -9,7 +9,10 @@ import { LemonSkeleton } from 'lib/lemon-ui/LemonSkeleton'
import { formatDurationMilliseconds } from 'lib/utils/durations'
import { humanizeBytes } from 'lib/utils/numbers'
-import { EXCEPTION_CODE_LABELS, queryPerformanceLogic } from './queryPerformanceLogic'
+import {
+ EXCEPTION_CODE_LABELS,
+ queryPerformanceLogic,
+} from 'products/experiments/frontend/scenes/queryPerformanceLogic'
const TIMESERIES_RANGE_OPTIONS = [
{ label: '48h', hours: 48 },
diff --git a/frontend/src/scenes/experiments/staff/ExperimentsStaffTools.tsx b/products/experiments/frontend/scenes/ExperimentsStaffToolsScene.tsx
similarity index 99%
rename from frontend/src/scenes/experiments/staff/ExperimentsStaffTools.tsx
rename to products/experiments/frontend/scenes/ExperimentsStaffToolsScene.tsx
index 92b104ed231f..bee1e8433d85 100644
--- a/frontend/src/scenes/experiments/staff/ExperimentsStaffTools.tsx
+++ b/products/experiments/frontend/scenes/ExperimentsStaffToolsScene.tsx
@@ -21,12 +21,13 @@ import { userLogic } from 'scenes/userLogic'
import { SceneContent } from '~/layout/scenes/components/SceneContent'
import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'
-import { CacheHealth } from './CacheHealth'
-import { PrecomputeOverview } from './PrecomputeOverview'
+import { CacheHealth } from 'products/experiments/frontend/components/staff/CacheHealth'
+import { PrecomputeOverview } from 'products/experiments/frontend/components/staff/PrecomputeOverview'
+
import { PrecomputationTeam, queryPerformanceLogic, SlowestQuery } from './queryPerformanceLogic'
export const scene: SceneExport = {
- component: ExperimentsStaffTools,
+ component: ExperimentsStaffToolsScene,
logic: queryPerformanceLogic,
}
@@ -145,7 +146,7 @@ function QueryStats({
)
}
-export function ExperimentsStaffTools(): JSX.Element {
+export function ExperimentsStaffToolsScene(): JSX.Element {
const { user } = useValues(userLogic)
const {
precomputationTeams,
diff --git a/frontend/src/scenes/experiments/staff/queryPerformanceLogic.ts b/products/experiments/frontend/scenes/queryPerformanceLogic.ts
similarity index 99%
rename from frontend/src/scenes/experiments/staff/queryPerformanceLogic.ts
rename to products/experiments/frontend/scenes/queryPerformanceLogic.ts
index ece1b9ba233e..dd169ce124d2 100644
--- a/frontend/src/scenes/experiments/staff/queryPerformanceLogic.ts
+++ b/products/experiments/frontend/scenes/queryPerformanceLogic.ts
@@ -366,7 +366,7 @@ export type queryPerformanceLogicType = MakeLogicType<
>
export const queryPerformanceLogic = kea<queryPerformanceLogicType>([
- path(['scenes', 'experiments', 'staff', 'queryPerformanceLogic']),
+ path(['scenes', 'experiments', 'queryPerformanceLogic']),
actions({
setSearch: (search: string) => ({ search }),
setPrecomputation: (teamId: number, enabled: boolean) => ({ teamId, enabled }),
diff --git a/products/experiments/manifest.tsx b/products/experiments/manifest.tsx
index c0b5c345ed9a..36df51dee2be 100644
--- a/products/experiments/manifest.tsx
+++ b/products/experiments/manifest.tsx
@@ -17,8 +17,16 @@ export const manifest: ProductManifest = {
iconType: 'experiment',
docsHref: 'https://posthog.com/docs/experiments',
},
+ ExperimentsStaffTools: {
+ import: () => import('./frontend/scenes/ExperimentsStaffToolsScene'),
+ instanceLevel: true,
+ name: 'Experiments staff tools',
+ },
+ },
+ routes: {
+ '/experiments': ['Experiments', 'experiments'],
+ '/experiments/staff': ['ExperimentsStaffTools', 'experimentsStaffTools'],
},
- routes: { '/experiments': ['Experiments', 'experiments'] },
urls: {
experiment: (
id: string | number,
@@ -34,6 +42,7 @@ export const manifest: ProductManifest = {
return params ? `${baseUrl}?${params}` : baseUrl
},
experiments: (): string => '/experiments',
+ experimentsStaffTools: (): string => '/experiments/staff',
experimentsSharedMetrics: (): string => '/experiments/shared-metrics',
experimentsSharedMetric: (id: string | number, action?: string): string =>
action ? `/experiments/shared-metrics/${id}/${action}` : `/experiments/shared-metrics/${id}`,