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.

fix(replay-vision): drop duplicate add-filter button in scanner editor (#62528)

Tue Haulundb5c02a8d50e9
diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerTriggers.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerTriggers.tsx
index 7a60b7d4e3a3..d1bf9ebc9e75 100644
--- a/products/replay_vision/frontend/replay_scanners/components/ScannerTriggers.tsx
+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerTriggers.tsx
@@ -30,10 +30,12 @@ const SCANNER_FILTER_TYPES: TaxonomicFilterGroupType[] = [
TaxonomicFilterGroupType.SessionProperties,
]
-// Recursively renders the bound universal-filter group's values + the add-filter button.
+// Recursively renders the bound universal-filter group's values. The add-filter button only renders on the
+// leaf group (the one holding actual filters); the outer wrapper group just nests, so it shows no button.
function ScannerFilterGroup(): JSX.Element {
const { filterGroup } = useValues(universalFiltersLogic)
const { replaceGroupValue, removeGroupValue } = useActions(universalFiltersLogic)
+ const hasNestedGroup = filterGroup.values.some(isUniversalGroupFilterLike)
return (
<div className="inline-flex flex-col gap-2">
@@ -52,9 +54,11 @@ function ScannerFilterGroup(): JSX.Element {
/>
)
)}
- <div>
- <UniversalFilters.AddFilterButton title="Add filter" type="secondary" size="xsmall" />
- </div>
+ {!hasNestedGroup && (
+ <div>
+ <UniversalFilters.AddFilterButton title="Add filter" type="secondary" size="xsmall" />
+ </div>
+ )}
</div>
)
}