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: Make focus mode multi-variant (#61918)

Jordan Mryyan0b63e699e6dc
diff --git a/frontend/src/scenes/web-analytics/webAnalyticsLogic.test.ts b/frontend/src/scenes/web-analytics/webAnalyticsLogic.test.ts
index 3307fcc6372d..aebc3de7085d 100644
--- a/frontend/src/scenes/web-analytics/webAnalyticsLogic.test.ts
+++ b/frontend/src/scenes/web-analytics/webAnalyticsLogic.test.ts
@@ -20,7 +20,7 @@ describe('webAnalyticsLogic focus mode', () => {
const enableFocusMode = (): void => {
featureFlagLogic.actions.setFeatureFlags([FEATURE_FLAGS.WEB_ANALYTICS_FOCUS_MODE], {
- [FEATURE_FLAGS.WEB_ANALYTICS_FOCUS_MODE]: true,
+ [FEATURE_FLAGS.WEB_ANALYTICS_FOCUS_MODE]: 'test',
})
}
@@ -152,6 +152,16 @@ describe('webAnalyticsLogic focus mode', () => {
})
})
+ it('hides focus mode for the control variant', async () => {
+ featureFlagLogic.actions.setFeatureFlags([FEATURE_FLAGS.WEB_ANALYTICS_FOCUS_MODE], {
+ [FEATURE_FLAGS.WEB_ANALYTICS_FOCUS_MODE]: 'control',
+ })
+ await expectLogic(logic).toMatchValues({
+ productTab: ProductTab.ANALYTICS,
+ showFocusMode: false,
+ })
+ })
+
describe('onboarding', () => {
const loadUser = (hasSeenProductIntroFor: Record<string, boolean>): void => {
userLogic.actions.loadUserSuccess({
diff --git a/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx b/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx
index f90f730d3304..a4df05b5766d 100644
--- a/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx
+++ b/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx
@@ -995,7 +995,7 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([
showFocusMode: [
(s) => [s.featureFlags, s.productTab],
(featureFlags, productTab: ProductTab): boolean =>
- !!featureFlags[FEATURE_FLAGS.WEB_ANALYTICS_FOCUS_MODE] && productTab === ProductTab.ANALYTICS,
+ featureFlags[FEATURE_FLAGS.WEB_ANALYTICS_FOCUS_MODE] === 'test' && productTab === ProductTab.ANALYTICS,
],
hasSavedFocusMode: [
(s) => [s.focusModeConcerns],