diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json index 14c8ccf5dad61..d5dda70c77287 100644 --- a/frontend/src/queries/schema.json +++ b/frontend/src/queries/schema.json @@ -8124,6 +8124,9 @@ "additionalProperties": false, "description": "`RetentionFilterType` minus everything inherited from `FilterType`", "properties": { + "cumulative": { + "type": "boolean" + }, "period": { "$ref": "#/definitions/RetentionPeriod" }, diff --git a/frontend/src/scenes/insights/filters/RetentionCumulativeCheckbox.tsx b/frontend/src/scenes/insights/filters/RetentionCumulativeCheckbox.tsx index 91c29866172b2..d6df7f41d7abe 100644 --- a/frontend/src/scenes/insights/filters/RetentionCumulativeCheckbox.tsx +++ b/frontend/src/scenes/insights/filters/RetentionCumulativeCheckbox.tsx @@ -1,4 +1,4 @@ -import { LemonCheckbox } from '@posthog/lemon-ui' +import { LemonSwitch } from '@posthog/lemon-ui' import { useActions, useValues } from 'kea' import { insightLogic } from 'scenes/insights/insightLogic' import { insightVizDataLogic } from 'scenes/insights/insightVizDataLogic' @@ -16,12 +16,12 @@ export function RetentionCumulativeCheckbox(): JSX.Element | null { } return ( - { updateInsightFilter({ cumulative }) }} checked={cumulativeRetention} - label={Cumulative retention} + label={Rolling retention} bordered size="small" /> diff --git a/frontend/src/scenes/insights/filters/RetentionMeanCheckbox.tsx b/frontend/src/scenes/insights/filters/RetentionMeanCheckbox.tsx index d16e7f4d5a157..dbedb799f55f6 100644 --- a/frontend/src/scenes/insights/filters/RetentionMeanCheckbox.tsx +++ b/frontend/src/scenes/insights/filters/RetentionMeanCheckbox.tsx @@ -1,4 +1,4 @@ -import { LemonCheckbox } from '@posthog/lemon-ui' +import { LemonSwitch } from '@posthog/lemon-ui' import { useActions, useValues } from 'kea' import { insightLogic } from 'scenes/insights/insightLogic' import { insightVizDataLogic } from 'scenes/insights/insightVizDataLogic' @@ -16,7 +16,7 @@ export function RetentionMeanCheckbox(): JSX.Element | null { } return ( - { updateInsightFilter({ showMean }) }} diff --git a/frontend/src/scenes/insights/utils/cleanFilters.ts b/frontend/src/scenes/insights/utils/cleanFilters.ts index 1fc283cf996b2..2e3c2022ff814 100644 --- a/frontend/src/scenes/insights/utils/cleanFilters.ts +++ b/frontend/src/scenes/insights/utils/cleanFilters.ts @@ -306,6 +306,7 @@ export function cleanFilters( breakdown_type: filters.breakdown_type, retention_reference: filters.retention_reference, show_mean: filters.show_mean, + cumulative: filters.cumulative, total_intervals: Math.min(Math.max(filters.total_intervals ?? 11, 0), 100), ...(filters.aggregation_group_type_index != undefined ? { aggregation_group_type_index: filters.aggregation_group_type_index } diff --git a/posthog/schema.py b/posthog/schema.py index a2fcdf90a3427..218621e3b0eba 100644 --- a/posthog/schema.py +++ b/posthog/schema.py @@ -3097,6 +3097,7 @@ class RetentionFilterLegacy(BaseModel): model_config = ConfigDict( extra="forbid", ) + cumulative: Optional[bool] = None period: Optional[RetentionPeriod] = None retention_reference: Optional[RetentionReference] = None retention_type: Optional[RetentionType] = None