: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
fix(taxonomic-filter): measure all-tab empty results (#118978)
Paul D'Ambrad56d28fd412b
diff --git a/.agents/skills/modifying-taxonomic-filter/references/failure-modes.md b/.agents/skills/modifying-taxonomic-filter/references/failure-modes.mdindex 2a0a47687da3..9bacb4d927a9 100644--- a/.agents/skills/modifying-taxonomic-filter/references/failure-modes.md+++ b/.agents/skills/modifying-taxonomic-filter/references/failure-modes.md@@ -11,7 +11,8 @@ A user picks a category, then searches for something that lives in another group~11% of opens with a category pick have an empty result after the pick, vs ~3% of opens without one.Selection rate drops ~23 points (~62% vs ~85%).- **Caveat:** the ~3% is too low.- Opens that stay on Suggested send no empty-result event, so their empty states are not counted.+ In this snapshot, opens that stay on Suggested sent no empty-result event, so their empty states are not counted.+ New clients record All-tab empties with `scope = 'all'`; compare periods with the same coverage.The same gap pushes the ~9x order ratio up, because an empty search on Suggested before a category pick is never counted.The selection drop does not use empty-result events, so lean on it first.- **Why:** the active category silently narrows search.diff --git a/.agents/skills/modifying-taxonomic-filter/references/feature-inventory.md b/.agents/skills/modifying-taxonomic-filter/references/feature-inventory.mdindex 5d9c25385bef..5dafdb302135 100644--- a/.agents/skills/modifying-taxonomic-filter/references/feature-inventory.md+++ b/.agents/skills/modifying-taxonomic-filter/references/feature-inventory.md@@ -22,7 +22,7 @@ Status meanings:| Email and URL promotion | Row 0 for the top terms | Protect | `PROMOTED_PROPERTIES_BY_SEARCH_TERM`. Human sign-off to change. || Event properties tab | Large | Improve | Ranking: selected items sit far down the list. || Person properties tab | Large, ~64% of closes on it pick (query 13, final tab) | Improve | Weakest big tab. |-| Empty-result state | ~5 per 100 search queries (query 13) | Fix | Should show matches in other groups. Suggested is not counted. |+| Empty-result state | ~5 per 100 search queries (query 13) | Fix | Should show matches in other groups. This snapshot excludes Suggested; new clients record All-tab empties. || Fetch error handling | ~0.2 failure events per 100 search queries (query 10) | Keep | Both surfaces show an error with retry. Keep them in parity. || Persons search latency | p90 ~4s | Fix | Slowest group. || Custom key for unseen properties | Ticket theme | Fix | Flags and cohorts especially. |diff --git a/.agents/skills/modifying-taxonomic-filter/references/product-reality.md b/.agents/skills/modifying-taxonomic-filter/references/product-reality.mdindex 29ebec1c8e34..872c114780eb 100644--- a/.agents/skills/modifying-taxonomic-filter/references/product-reality.md+++ b/.agents/skills/modifying-taxonomic-filter/references/product-reality.md@@ -94,7 +94,8 @@ Summary only.Detail in [failure-modes](failure-modes.md).- Category picked, then a search that finds nothing: ~11% of opens with a category pick have an empty result after the pick, vs ~3% of opens without one.- The ~3% is too low: Suggested sends no empty-result event.+ The ~3% is too low: Suggested sent no empty-result event in this snapshot.+ New clients record All-tab empties with `scope = 'all'`; refresh these figures using periods with the same coverage.- Opens with a category pick end in a selection ~62% of the time, vs ~85% without one.- Most empty searches are ordinary words in the wrong scope.- Recovery within 30s of an empty result fell from ~46% to ~39% (Jul to Oct 2026, health dashboard session tile) while the empty-result rate stayed flat.diff --git a/.agents/skills/modifying-taxonomic-filter/references/refreshing-product-reality.md b/.agents/skills/modifying-taxonomic-filter/references/refreshing-product-reality.mdindex e6bbdcdfb2df..5f6f1b43f7fd 100644--- a/.agents/skills/modifying-taxonomic-filter/references/refreshing-product-reality.md+++ b/.agents/skills/modifying-taxonomic-filter/references/refreshing-product-reality.md@@ -199,8 +199,10 @@ The rebuild is left out, because its close event fires on every close and its caThose switches do not narrow search, so the query drops them, and "category pick" means a real group.The query also drops any open that picked the SQL expression category: legacy commits a SQL expression without sending `taxonomic filter item selected`, so a success there would look like a failure.An existing SQL expression filter reopens straight on that tab without a category event, so the query also drops any open whose close has `groupType = 'hogql_expression'`.-Suggested sends no `taxonomic filter empty result`, so the without-category empty rate is too low.+Legacy clients that predate All-tab measurement send no `taxonomic filter empty result` from Suggested, so their without-category empty rate is too low.The same gap biases `category_then_empty_ratio` upward: an empty search on Suggested followed by a category pick never counts in its base.+New clients send `scope = 'all'` when the aggregate empty state is visible and `scope = 'category'` for remote category searches.+Compare windows with the same coverage, or filter both periods to `scope = 'category'` for a category-only comparison.`selection_after_category_pct` and `selection_without_category_pct` do not use empty-result events, so they are the most reliable output of this query.Drives failure mode 1 in [failure-modes](failure-modes.md).@@ -361,7 +363,9 @@ WHERE event IN ('taxonomic filter event match answered', 'taxonomic filter event### 12. Recovery after an empty resultShare of empty results followed by a searched selection in the same person, session and surface within 30 seconds, per surface.-The surfaces cover different empty states (legacy sends none from Suggested, the rebuild sends them from its meta-scopes), so never pool them.+The surfaces cover different empty states, so never pool them.+Legacy clients that predate All-tab measurement send none from Suggested.+New clients mark All-tab empties with `scope = 'all'`; compare periods with the same coverage or restrict both to `scope = 'category'`.Two pickers open at once in one session can still match each other; exact matching would need a picker instance ID.This counts every empty result, including repeats while typing, so it reads lower than the health dashboard's recovery tile.Compare each against its own history, not each other.diff --git a/.agents/skills/modifying-taxonomic-filter/references/telemetry-contract.md b/.agents/skills/modifying-taxonomic-filter/references/telemetry-contract.mdindex 847c86a29f02..9a27e64a379e 100644--- a/.agents/skills/modifying-taxonomic-filter/references/telemetry-contract.md+++ b/.agents/skills/modifying-taxonomic-filter/references/telemetry-contract.md@@ -50,10 +50,16 @@ All carry `surface` on both surfaces, except `include stale toggled`, which carrLegacy sends `wasUrlContainsShortcut` only on a quick filter, with `filterName`, `propertyKey`, `operator`, `filterValue`, `propertyFilterType` and `eventName`.The rebuild always sends `wasUrlContainsShortcut` and none of the others.- `taxonomic_filter_search_query`: `searchQuery`, `groupType`, `inputMode`, `pastedFraction`, `excludeStale`.-- `taxonomic filter empty result`: `groupType`, `searchQuery`.- Legacy sends it only from a remote list on the active tab.- Suggested is a local list, so its empty state sends nothing.- Add coverage there before you measure a change to the Suggested empty state.+- `taxonomic filter empty result`: `groupType`, `searchQuery`, `scope`.+ `scope` is `all` for the aggregate All view and `category` for a content category.+ The rebuild also uses `recent` and `pinned` for those scopes.+ Legacy All sends it when its visible empty state renders after contributing lists settle without a fetch failure.+ Its `groupType` remains `suggested_filters`; rebuild All keeps `groupType` unset.+ Empty or whitespace-only searches do not count.+ Repeated renders of the same trimmed query do not send another event.+ Legacy content categories send it from successful remote searches on the active tab.+ Older legacy data has no All-tab empty events, and older events have no `scope`.+ Compare periods with the same coverage.- `taxonomic filter fetch failed`: `groupType`, `searchQuery`, and on legacy `forbidden` (true when the request was refused with a 403).Each surface sends it once per group or scope and query while the request keeps failing.Legacy has also sent it on first-load failures since 2026-09-13, so legacy rates from before then are not comparable.diff --git a/docs/internal/taxonomic-filter-search.md b/docs/internal/taxonomic-filter-search.mdindex 7780335b6693..5d301105e2ed 100644--- a/docs/internal/taxonomic-filter-search.md+++ b/docs/internal/taxonomic-filter-search.md@@ -24,6 +24,20 @@ The expansion count must not delay the scoped results or keep the aggregate reveThe legacy implementation separates these requests in `infiniteListLogic.ts`; the rebuilt implementation uses independent resources in `hooks/useGroupList.ts`. Keep this behavior consistent across both implementations.+## Empty-result measurement++The classic All tab records `taxonomic filter empty result` when it shows an empty search after all contributing lists settle.+A pending or failed request does not count as an empty result.+Empty queries and repeated renders of the same trimmed query do not send another event.++Both implementations send `scope = 'all'` for All and `scope = 'category'` for content categories.+The rebuilt menu also labels its Recent and Pinned scopes.+Existing `groupType` values remain unchanged: classic All uses `suggested_filters`, and rebuilt All leaves it unset.++Older classic clients do not record All-tab empty results.+Compare periods with the same coverage.+Use `scope = 'category'` for a category-only measure after this change.+## Action definitionsEvent-only insight editors and closed breakdown pickers do not load the action list.diff --git a/frontend/src/lib/components/TaxonomicFilter/InfiniteList.tsx b/frontend/src/lib/components/TaxonomicFilter/InfiniteList.tsxindex a66a785b2775..7491e33c5464 100644--- a/frontend/src/lib/components/TaxonomicFilter/InfiniteList.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/InfiniteList.tsx@@ -943,7 +943,8 @@ export function InfiniteList({ popupAnchorElement, definitionPopoverRenderer }:trimmedSearchQuery,showSuggestedFiltersEmptyState,} = useValues(infiniteListLogic)- const { onRowsRendered, setIndex, togglePinnedRow, expand, updateRemoteItem } = useActions(infiniteListLogic)+ const { onRowsRendered, setIndex, togglePinnedRow, expand, updateRemoteItem, emptyResultShown } =+ useActions(infiniteListLogic)const [highlightedItemElement, setHighlightedItemElement] = useState<HTMLDivElement | null>(null)const listRef = useListRef(null)@@ -953,6 +954,12 @@ export function InfiniteList({ popupAnchorElement, definitionPopoverRenderer }:}}, [index, listRef])+ useEffect(() => {+ if (isSuggestedFilters && isActiveTab && showEmptyState && !showLoadingState && trimmedSearchQuery) {+ emptyResultShown()+ }+ }, [isSuggestedFilters, isActiveTab, showEmptyState, showLoadingState, trimmedSearchQuery, emptyResultShown])+const selectedItemGroup = getItemGroup(selectedItem, taxonomicGroups, group)const selectedItemIsRecent = selectedItem ? hasRecentContext(selectedItem) : falseconst selectedItemIsQuickFilter = selectedItem ? isQuickFilterItem(selectedItem) : falsediff --git a/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.test.tsx b/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.test.tsxindex 42b059c663c7..4233fedf034b 100644--- a/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.test.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.test.tsx@@ -5,6 +5,7 @@ import '@testing-library/jest-dom'import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { Provider, getContext } from 'kea'+import { expectLogic } from 'kea-test-utils'import posthog from 'posthog-js'import { FEATURE_FLAGS } from 'lib/constants'@@ -26,7 +27,7 @@ import {} from '~/test/mocks'import { PropertyFilterType, PropertyOperator } from '~/types'-import { clearApiCache } from './infiniteListLogic'+import { clearApiCache, infiniteListLogic } from './infiniteListLogic'import { recentTaxonomicFiltersLogic } from './recentTaxonomicFiltersLogic'import { TaxonomicFilter } from './TaxonomicFilter'import { taxonomicFilterCategoryLayoutLogic } from './taxonomicFilterCategoryLayoutLogic'@@ -1479,6 +1480,88 @@ describe('TaxonomicFilter', () => {})})+ it.each([+ { outcome: 'empty', status: 200, hasMatch: false, expectEmpty: true },+ { outcome: 'matching', status: 200, hasMatch: true, expectEmpty: false },+ { outcome: 'failed', status: 500, hasMatch: false, expectEmpty: false },+ ])('measures All empty results after a $outcome search settles', async ({ status, hasMatch, expectEmpty }) => {+ const captureSpy = jest.spyOn(posthog, 'capture')+ let releaseResponse!: () => void+ const responsePending = new Promise<void>((resolve) => {+ releaseResponse = resolve+ })+ let searchStarted = false+ useMocks({+ get: {+ '/api/projects/:team/event_definitions': { results: [], count: 0 },+ '/api/projects/:team/property_definitions': async ({ request }) => {+ if (new URL(request.url).searchParams.get('search')) {+ searchStarted = true+ await responsePending+ const results = hasMatch ? [{ ...mockEventPropertyDefinition, name: 'missing_choice' }] : []+ return [status, { results, count: results.length }]+ }+ return [200, { results: [], count: 0 }]+ },+ },+ })+ const logicProps = {+ taxonomicFilterLogicKey: 'allEmptyMeasurement',+ taxonomicGroupTypes: [+ TaxonomicFilterGroupType.SuggestedFilters,+ TaxonomicFilterGroupType.Events,+ TaxonomicFilterGroupType.EventProperties,+ ],+ }+ renderFilter(logicProps)+ const emptyCalls = (): unknown[] =>+ captureSpy.mock.calls.filter(([event]) => event === 'taxonomic filter empty result')+ const input = screen.getByTestId('taxonomic-filter-searchfield')+ fireEvent.change(input, { target: { value: 'missing_choice' } })+ await waitFor(() => expect(searchStarted).toBe(true))+ expect(emptyCalls()).toHaveLength(0)++ await act(async () => releaseResponse())+ const propertiesList = infiniteListLogic({+ ...logicProps,+ listGroupType: TaxonomicFilterGroupType.EventProperties,+ })+ await waitFor(() => {+ expect(propertiesList.values.isLoading).toBe(false)+ expect(+ status === 500 ? propertiesList.values.remoteFetchFailed : propertiesList.values.remoteItems.searchQuery+ ).toBe('missing_choice')+ })+ const allList = infiniteListLogic({+ ...logicProps,+ listGroupType: TaxonomicFilterGroupType.SuggestedFilters,+ })+ await act(async () => {+ await expectLogic(allList).toFinishAllListeners()+ })+ if (expectEmpty) {+ await waitFor(() =>+ expect(captureSpy).toHaveBeenCalledWith('taxonomic filter empty result', {+ surface: 'legacy-pill',+ scope: 'all',+ groupType: TaxonomicFilterGroupType.SuggestedFilters,+ searchQuery: 'missing_choice',+ })+ )+ fireEvent.change(input, { target: { value: 'missing_choice ' } })+ await waitFor(() => expect(propertiesList.values.remoteItems.searchQuery).toBe('missing_choice '))+ await act(async () => {+ await expectLogic(allList).toFinishAllListeners()+ })+ expect(emptyCalls()).toHaveLength(1)+ } else {+ if (hasMatch) {+ expect(await screen.findByTestId('prop-filter-suggested_filters-0')).toHaveTextContent('missing_choice')+ }+ expect(emptyCalls()).toHaveLength(0)+ }+ })+describe('series picker: pageview url-contains shortcut leads', () => {beforeEach(() => {useMocks({diff --git a/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.test.ts b/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.test.tsindex 3f076ceda79c..dd68ab504a67 100644--- a/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.test.ts+++ b/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.test.ts@@ -1873,6 +1873,7 @@ describe('infiniteListLogic', () => {if (expectFire) {expect(emptyCalls).toHaveLength(1)expect(emptyCalls[0][1]).toMatchObject({+ scope: 'category',groupType: listGroupType,searchQuery: 'mcp tool call',})diff --git a/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts b/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.tsindex bf84a6171a11..15603ad796cf 100644--- a/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts+++ b/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts@@ -395,6 +395,9 @@ export interface infiniteListLogicActions {applyInitialPinnedRow: (rowIndex: number) => {rowIndex: number}+ emptyResultShown: () => {+ value: true+ }expand: () => {value: true}@@ -888,6 +891,7 @@ export const infiniteListLogic = kea<infiniteListLogicType>([forbidden,}),retryRemoteItems: true,+ emptyResultShown: true,}),loaders(({ actions, values, cache, props }) => ({remoteItems: [@@ -2337,6 +2341,36 @@ export const infiniteListLogic = kea<infiniteListLogicType>([}}},+ emptyResultShown: async (_, breakpoint) => {+ // Remote success and aggregate matches update in separate actions; count only the settled view.+ await breakpoint(0)+ if (+ !values.isSuggestedFilters ||+ !values.isActiveTab ||+ !values.showEmptyState ||+ values.showLoadingState ||+ !values.trimmedSearchQuery+ ) {+ return+ }+ const parent = taxonomicFilterLogic(props)+ const hasFailedGroup = Object.entries(parent.values.infiniteListLogics).some(+ ([groupType, logic]) =>+ !parent.values.metaGroupTypes.has(groupType) &&+ logic.isMounted() &&+ logic.values.remoteFetchFailed === values.searchQuery+ )+ if (hasFailedGroup || cache.lastEmptyResultDedupeKey === values.trimmedSearchQuery) {+ return+ }+ cache.lastEmptyResultDedupeKey = values.trimmedSearchQuery+ posthog.capture('taxonomic filter empty result', {+ surface: legacyTaxonomicSurface(),+ scope: 'all',+ groupType: props.listGroupType,+ searchQuery: values.trimmedSearchQuery,+ })+ },loadRemoteItemsSuccess: ({ remoteItems }) => {actions.infiniteListResultsReceived(props.listGroupType, remoteItems)@@ -2362,6 +2396,7 @@ export const infiniteListLogic = kea<infiniteListLogicType>([cache.lastEmptyResultDedupeKey = dedupeKeyposthog.capture('taxonomic filter empty result', {surface: legacyTaxonomicSurface(),+ scope: 'category',groupType: props.listGroupType,searchQuery: trimmedQuery,})diff --git a/frontend/src/lib/components/TaxonomicFilter/menu/Combobox.test.tsx b/frontend/src/lib/components/TaxonomicFilter/menu/Combobox.test.tsxindex bc5857e97904..2d9a7ced8acf 100644--- a/frontend/src/lib/components/TaxonomicFilter/menu/Combobox.test.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/menu/Combobox.test.tsx@@ -1172,7 +1172,7 @@ describe('MenuFilterCombobox', () => {await waitFor(() =>expect(captureMock).toHaveBeenCalledWith('taxonomic filter empty result',- expect.objectContaining({ searchQuery: 'zzz_no_match' })+ expect.objectContaining({ searchQuery: 'zzz_no_match', scope: 'all' })))})diff --git a/frontend/src/lib/components/TaxonomicFilter/menu/Combobox.tsx b/frontend/src/lib/components/TaxonomicFilter/menu/Combobox.tsxindex d27bee8e3642..f7b4e30f15b2 100644--- a/frontend/src/lib/components/TaxonomicFilter/menu/Combobox.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/menu/Combobox.tsx@@ -871,17 +871,18 @@ export function MenuFilterCombobox({if (!emptyState || emptyState.body || !trimmed || anyError || anyFetching) {return}- const key = `${telemetryGroupType ?? 'all'}::${trimmed}`+ const key = `${activeScope}::${trimmed}`if (lastEmptyResultKeyRef.current === key) {return}lastEmptyResultKeyRef.current = keyposthog.capture('taxonomic filter empty result', {surface: TAXONOMIC_FILTER_SURFACE,+ scope: telemetryGroupType ? 'category' : activeScope,groupType: telemetryGroupType,searchQuery: trimmed,})- }, [emptyState, searchQuery, telemetryGroupType, anyError, anyFetching])+ }, [emptyState, searchQuery, telemetryGroupType, activeScope, anyError, anyFetching])// `taxonomic filter fetch failed` — once per scope+query while the visible list's request// keeps failing. Mirrors legacy `lastFetchFailedDedupeKey`: the key is only cleared once the