: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(insights): sunset hide weekends toggle in favor of days-of-week filter (#77150)
Sam Penningtonbb2e7301e4a7
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex f11d7faf4ecd..8becaf5d7d2b 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -429,7 +429,6 @@ export const FEATURE_FLAGS = {POSTHOG_CONNECT: 'posthog-connect', // owner: @Gilbert09, gates the "connect another PostHog project" personal integrationPRODUCT_ANALYTICS_DASHBOARD_COLORS: 'dashboard-colors', // owner: @thmsobrmlr #team-product-analyticsPRODUCT_ANALYTICS_DASHBOARD_MODAL_SMART_DEFAULTS: 'product-analytics-dashboard-modal-smart-defaults', // owner: @sam #team-product-analytics- PRODUCT_ANALYTICS_HIDE_WEEKENDS: 'product-analytics-hide-weekends', // owner: @kliment-slice #team-irl-eventsPRODUCT_ANALYTICS_INSIGHT_HORIZONTAL_CONTROLS: 'insight-horizontal-controls', // owner: #team-product-analyticsPRODUCT_ANALYTICS_PATHS_V2: 'paths-v2', // owner: @thmsobrmlr #team-product-analyticsPRODUCT_ANALYTICS_QUARTER_YEAR_INTERVALS: 'product-analytics-quarter-year-intervals', // owner: @sampennington #team-product-analytics, gates quarter/year interval selection on insightsdiff --git a/frontend/src/queries/nodes/InsightViz/InsightResultMetadata.tsx b/frontend/src/queries/nodes/InsightViz/InsightResultMetadata.tsxindex 8394d615bb49..112615a574f7 100644--- a/frontend/src/queries/nodes/InsightViz/InsightResultMetadata.tsx+++ b/frontend/src/queries/nodes/InsightViz/InsightResultMetadata.tsx@@ -47,7 +47,7 @@ export const InsightResultMetadata = ({Excluding {excludedText}</span>) : null}- {trendsFilter?.hideWeekends && featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_HIDE_WEEKENDS] ? (+ {trendsFilter?.hideWeekends ? (<span className="text-secondary"><span className="mx-1">•</span>Weekends hiddendiff --git a/frontend/src/queries/nodes/InsightViz/insightDisplayOptions.tsx b/frontend/src/queries/nodes/InsightViz/insightDisplayOptions.tsxindex 0259ef76b8b1..1882e992dae9 100644--- a/frontend/src/queries/nodes/InsightViz/insightDisplayOptions.tsx+++ b/frontend/src/queries/nodes/InsightViz/insightDisplayOptions.tsx@@ -3,9 +3,7 @@ import { useValues } from 'kea'import { normalizeAxisLabel } from '@posthog/quill-charts'import { smoothingOptions } from 'lib/components/SmoothingFilter/smoothings'-import { FEATURE_FLAGS } from 'lib/constants'import { LemonMenuItem, LemonMenuItems } from 'lib/lemon-ui/LemonMenu'-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'import { funnelDataLogic } from 'scenes/funnels/funnelDataLogic'import { axisLabel } from 'scenes/insights/aggregationAxisFormat'import { insightLogic } from 'scenes/insights/insightLogic'@@ -61,8 +59,10 @@ export function useInsightDisplayOptions(): { items: LemonMenuItems; count: numbshowConfidenceIntervals,showMovingAverage,} = useValues(trendsDataLogic(insightProps))- const { featureFlags } = useValues(featureFlagLogic)- const hideWeekendsEnabled = !!featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_HIDE_WEEKENDS]+ // Hide weekends is superseded by the days-of-week date filter and is being sunset: the option+ // only renders on insights that already have it on, so it can be turned off but not on. Gating+ // on the value rather than the key matters — the key is persisted as false on most insights.+ const hasHideWeekends = !!trendsFilter?.hideWeekends// The slope graph shows the first vs last interval, so it drops the options that need the points// between them (smoothing, multiple axes, alert/annotation overlays, statistical analysis).@@ -162,7 +162,7 @@ export function useInsightDisplayOptions(): { items: LemonMenuItems; count: numbif (isTrendsFunnel && !hideContinuousChartOptions) {displayItems.push(DisplayOptions.HideIncompleteFunnelPeriods)}- if (isTrends && !hideContinuousChartOptions && hideWeekendsEnabled) {+ if (isTrends && !hideContinuousChartOptions && hasHideWeekends) {displayItems.push(DisplayOptions.HideWeekends)}if (showAnnotationsConfig) {@@ -262,7 +262,7 @@ export function useInsightDisplayOptions(): { items: LemonMenuItems; count: numb(showAxisLabelsConfig && normalizeAxisLabel(trendsFilter?.xAxisLabel) ? 1 : 0) +(showAxisLabelsConfig && normalizeAxisLabel(trendsFilter?.yAxisLabel) ? 1 : 0) +(showMultipleYAxes ? 1 : 0) +- (trendsFilter?.hideWeekends && hideWeekendsEnabled ? 1 : 0) ++ (hasHideWeekends ? 1 : 0) +(showAnnotationsConfig && showAnnotations === false ? 1 : 0) +(isMetric && trendsFilter?.metricShowChange === false ? 1 : 0) +(isMetric && trendsFilter?.metricColorByDirection ? 1 : 0) +