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(insights): delete the orphaned legacy filter guards (#124201)

Thomas Obermüllerbe6f2df81381
diff --git a/frontend/src/scenes/insights/filters/ActionFilter/legacyFilters.ts b/frontend/src/scenes/insights/filters/ActionFilter/legacyFilters.ts
index c5409e559cf8..a364f2741c74 100644
--- a/frontend/src/scenes/insights/filters/ActionFilter/legacyFilters.ts
+++ b/frontend/src/scenes/insights/filters/ActionFilter/legacyFilters.ts
@@ -138,8 +138,8 @@ export function seriesToLegacyFilters(series: SeriesNode[]): FilterType {
}
/**
- * The legacy row shape, still used by `cleanFilters` for the persons-modal URL path and by
- * replay's playlist summary. Both go in the PR that deletes the converter.
+ * The legacy row shape. Replay's playlist summary (`summarizePlaylistFilters`) still builds it
+ * with `toLocalFilters` to name its event and action filters.
*/
export type LocalFilter = ActionFilter & {
order: number
diff --git a/frontend/src/scenes/insights/sharedUtils.ts b/frontend/src/scenes/insights/sharedUtils.ts
index 9d4c25533ca9..2d1fe6e18720 100644
--- a/frontend/src/scenes/insights/sharedUtils.ts
+++ b/frontend/src/scenes/insights/sharedUtils.ts
@@ -1,14 +1,7 @@
// This is separate from utils.ts because here we don't include `funnelLogic`, `retentionLogic`, etc
import { ApiError } from 'lib/api-error'
-import {
- ChartDisplayType,
- FilterType,
- InsightLogicProps,
- InsightType,
- StickinessFilterType,
- TrendsFilterType,
-} from '~/types'
+import { FilterType, InsightLogicProps, InsightType, TrendsFilterType } from '~/types'
export function getCapacityRetryAt(tileError: unknown, queryError: unknown): number | null {
const tileRetryAt = tileError instanceof ApiError ? tileError.retryAfterTimestamp : null
@@ -52,33 +45,6 @@ export const keyForInsightLogicProps =
return props.tabId ? `${baseKey}/tab-${props.tabId}` : baseKey
}
-export function filterTrendsClientSideParams(
- filters: Partial<TrendsFilterType & StickinessFilterType>
-): Partial<TrendsFilterType & StickinessFilterType> {
- const { stickiness_days: ___discard, ...newFilters } = filters
-
- // "compare against previous" doesn't make a lot of sense for area charts.
- // since we want to preserve the `compare` setting for switching to
- // other display types, we simply overwrite it here.
- if (isAreaChartDisplay(filters)) {
- newFilters.compare = false
- }
- return newFilters
-}
-
export function isTrendsFilter(filters?: Partial<FilterType>): filters is Partial<TrendsFilterType> {
return filters?.insight === InsightType.TRENDS || (!!filters && !filters.insight)
}
-export function isStickinessFilter(filters?: Partial<FilterType>): filters is Partial<StickinessFilterType> {
- return filters?.insight === InsightType.STICKINESS
-}
-
-export function isFilterWithDisplay(
- filters: Partial<FilterType>
-): filters is Partial<TrendsFilterType> | Partial<StickinessFilterType> {
- return isTrendsFilter(filters) || isStickinessFilter(filters)
-}
-
-export function isAreaChartDisplay(filters?: Partial<FilterType>): boolean {
- return isTrendsFilter(filters) && filters.display === ChartDisplayType.ActionsAreaGraph
-}