: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(taxonomic-filter): add a pinnable category rail (#99815)
Paul D'Ambra1cc9560ef669
diff --git a/.agents/skills/modifying-taxonomic-filter/SKILL.md b/.agents/skills/modifying-taxonomic-filter/SKILL.mdindex 80d81106e5ae..cf64c5ac1c19 100644--- a/.agents/skills/modifying-taxonomic-filter/SKILL.md+++ b/.agents/skills/modifying-taxonomic-filter/SKILL.md@@ -1,6 +1,6 @@---name: modifying-taxonomic-filter-description: Guides safe changes to the TaxonomicFilter, PostHog's picker for events, actions, properties, cohorts, and more. Use when adding features, fixing bugs, improving search or loading performance, or refactoring the legacy filter, rebuild menu, or headless filter panel. Covers real selection behavior, three live variants, shared telemetry, the conditional Postgres search plan, and result reveal rules.+description: Guides safe changes to the TaxonomicFilter, PostHog's picker for events, actions, properties, cohorts, and more. Use when adding features, fixing bugs, improving search or loading performance, or refactoring the classic picker, rebuild menu, or headless filter panel. Covers real selection behavior, two live surfaces, shared telemetry, the conditional Postgres search plan, and result reveal rules.---# Modifying the TaxonomicFilter@@ -16,11 +16,11 @@ in `frontend/src/lib/components/TaxonomicFilter/`.with all tests passing. Read "Product reality" before deciding anychange is safe. Ordering, promotion, or position-0 changes needexplicit human sign-off — don't let an agent decide alone.-2. There are **three live variants** behind two feature flags, and the+2. There are **two live surfaces**, and therebuild is a parallel reimplementation of the legacy data + grouplayer — not a skin over it. A behaviour change usually has to land in**both** the legacy code and the rebuild, or the two arms of the- experiment diverge. Read "Three variants" and "Mirroring changes"+ experiment diverge. Read "Two surfaces" and "Mirroring changes"before assuming one edit is enough.3. Search is the main selection path. The definition endpoints select aPostgres plan from the project size. The picker also shows results before@@ -89,9 +89,8 @@ aggregation, and shortcut routing are how they get to the right answer.## Telemetry is a contractTreat property shapes as a public API. Every `taxonomic filter *` event now-carries a `surface` property (`legacy-control` / `legacy-pill` /-`rebuild-menu`) so the experiment arms are distinguishable by an explicit-property, not a feature-flag join. The legacy stamp comes from+carries a `surface` property (`legacy-pill` / `rebuild-menu`) so the+surfaces are distinguishable by an explicit property. The classic-picker stamp comes from`legacyTaxonomicSurface()` in `taxonomicFilterSurface.ts`; the rebuild stamps`rebuild-menu` from `menu/TaxonomicFilterMenu.tsx`.@@ -118,22 +117,20 @@ or the arms stop being comparable. Adding properties: fine. Removing deadones: fine. **Renaming or repurposing silently is the worst case** —dashboards keep working and start lying.-## Three variants+## Two surfaces-Two feature flags, three surfaces. A bug report that doesn't reproduce+One feature flag selects between two surfaces. A bug report that doesn't reproducelocally is almost always a variant mismatch — confirm which surface thereporter is on first.-| Surface | Flag | Value | What renders |-| ---------------- | ------------------------------------ | ----------- | ------------------------------------------------- |-| `legacy-control` | `TAXONOMIC_FILTER_CATEGORY_DROPDOWN` | `'control'` | original tab-pill UI |-| `legacy-pill` | `TAXONOMIC_FILTER_CATEGORY_DROPDOWN` | `'pill'` | suffix category dropdown (`CategoryDropdown.tsx`) |-| `rebuild-menu` | `TAXONOMIC_FILTER_MENU_REBUILD` | on | ground-up rewrite in `menu/` over `headless/` |+| Surface | Flag | Value | What renders |+| -------------- | ------------------------------- | ----- | --------------------------------------------- |+| `legacy-pill` | `TAXONOMIC_FILTER_MENU_REBUILD` | off | classic picker with a category dropdown |+| `rebuild-menu` | `TAXONOMIC_FILTER_MENU_REBUILD` | on | ground-up rewrite in `menu/` over `headless/` |-- **legacy-control vs legacy-pill** is the same A/B we've always had —- one codebase (`taxonomicFilterLogic.tsx` + `InfiniteList`), two render- paths. Owner `@pauldambra`, multivariate `control,pill`. The direction- of travel is to move everyone from control onto pill.+- **legacy-pill** is the classic picker (`taxonomicFilterLogic.tsx` ++ `InfiniteList`) with a suffix category dropdown. A person can pin the+ category rail from that dropdown.- **rebuild-menu** is a separate, opt-in experiment (`@adamleith`) beingtested internally. It is a **fresh implementation**: the `menu/` dropdownand combobox UI on top of `headless/` (a hooks-based filter panel). It@@ -184,9 +181,9 @@ through these via a bridge, it doesn't fork them).`taxonomicFilterLogic.tsx` and the rebuild never calls it.One intentional divergence is already documented in-`useTaxonomicFilter.ts`: the rebuild **always** leads with SuggestedFilters,-whereas legacy gates that on the pill variant. Preserve documented-divergences; don't "fix" them into parity.+`useTaxonomicFilter.ts`: both surfaces lead with SuggestedFilters when the+picker has more than one substantive group. Preserve documented divergences;+don't "fix" them into parity.## Pre-change checklist@@ -197,14 +194,13 @@ divergences; don't "fix" them into parity.[performance](references/performance.md) (search plan, reveal barrier)- [ ] Decide whether the change must mirror across legacy and rebuild(see "Mirroring changes") — if you can only do one, say so explicitly-- [ ] Test all three surfaces if you touched tabs/groups: `legacy-control`,- `legacy-pill`, `rebuild-menu`+- [ ] Test both surfaces if you touched tabs/groups: `legacy-pill`,+ `rebuild-menu`- [ ] Confirm shared telemetry payloads still match across both emitters- [ ] Ordering / promotion / position-0 -> human sign-off, not agent judgement- [ ] If you changed search or loading, verify the plan boundary and confirmthat optional requests do not delay results-- [ ] Flag the ongoing experiments to the human reviewer: the- control->pill rollout and the internal `rebuild-menu` opt-in+- [ ] Flag the internal `rebuild-menu` opt-in to the human reviewer```bashhogli test frontend/src/lib/components/TaxonomicFilter/diff --git a/docs/internal/taxonomic-filter-search.md b/docs/internal/taxonomic-filter-search.mdindex 433d011d4d25..b906e82ec7aa 100644--- a/docs/internal/taxonomic-filter-search.md+++ b/docs/internal/taxonomic-filter-search.md@@ -1,6 +1,10 @@# Taxonomic filter search loading-The legacy picker and the rebuilt menu hold aggregated search results until the contributing categories settle. This prevents late category results from moving a choice under the pointer. Only categories offered by the picker contribute to that wait; a category-specific list waits for its own results. Recent and Pinned scopes use pre-resolved entries and never enter this search loading barrier.+The classic picker and the rebuilt menu hold aggregated search results until the contributing categories settle. This prevents late category results from moving a choice under the pointer. Only categories offered by the picker contribute to that wait; a category-specific list waits for its own results. Recent and Pinned scopes use pre-resolved entries and never enter this search loading barrier.++The classic picker shows its active category in the search input. A person can dock the category rail from that menu. This preference persists for that person and project. A narrow picker hides the rail and shows the category control in the search input.++The rail starts undocked. `taxonomic filter category rail toggled` records whether it is docked. `taxonomic filter closed` records the final `categoryRailDocked` state so reports can show which people keep the rail docked.A category shows results for the current query only. It clears its earlier rows when the current query cannot fetch, such as a query below the category minimum length or a request that failed.diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 751dfa2a2515..a390f4e0234b 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -2845,85 +2845,93 @@ snapshots:filters-propertygroupfilters-data-exploration-andorfilterselect--default--light:hash: v1.k794b7964.878d5718b31de7391125577d89e8f5a2aff382328cc2ecbb92ccf7a11153a477.HrJBJwrpwOBffqHfDG_XUostPZKCiuts0wUpu35Ikjgfilters-taxonomic-filter--actions--dark:- hash: v1.k794b7964.b147cec852bb8d234f70b5c7e68bd8123b8093eaf8ea6371123c1d4479fbc421.tCzSDaXz7IYSSW3p7RKBDv1tmqpzOnP3ckwAnCHHk-E+ hash: v1.k794b7964.bd8b919e9ed47e0eb14b5fbb9b831b29f2a02d72ec3d893d3bd1872228b7f3b0.TPhTS3U_MUY4C5NAxXetCHromLbd1_GwHXHYHGfTnyofilters-taxonomic-filter--actions--light:- hash: v1.k794b7964.e9ad4f3da4d49618e27ce94d2bbb96c36b22d721ab6fbdaf9a109d1762b22947.ozbZjGXyW-4REjQPYdFepAJP9Fum0iBhYt0J6X5Arb0+ hash: v1.k794b7964.11b6a84d3cb7e57d67a632306dfb9dcb6dc406c6a94ba5afe3f04b5dad868e82.Y5RkLrqzCGuuPx4l3tYdrnbKO0jeKHaPSIP8mJkC5I0filters-taxonomic-filter--autocapture-context-promotes-elements--dark:- hash: v1.k794b7964.13312abe2665597be3e3a779494b2e51f5f74c89ce7eac95653b26f16acb86c6.KOMCM99FtN43dDsCRfwN2ZEw5tkk01KubylmO-Ov2Hg+ hash: v1.k794b7964.03e9fdf892dc64fbb785b7c3339d7c647f92983c53d76193b69900b793fa8544.nLDsHLw-Hspxmvxxk__zqdo9tfub2uRzsA4UHZFulocfilters-taxonomic-filter--autocapture-context-promotes-elements--light:- hash: v1.k794b7964.ca7b22fedb53fcb2ea5f7e3702d7e5a368711827e775c3ecd8131a2628cd9b9d.2RoB92_wh_113k57g2EcUuvn9-9SukgL_eAnoHV0hHk+ hash: v1.k794b7964.a96071d32d3b45bccdf4ebdd65217c950a909a23ad18b52a3f0dbeb7e96b705c.O8Tq4NfaGHBlItTjckh5j5yaowAVtFfFCzanlchvRr4+ filters-taxonomic-filter--category-dropdown--dark:+ hash: v1.k794b7964.c9ee9be1f465a337f874296687a8347e60ec4148a7ee2bf1c99a46fa41a8656e.3ufM6kao0BVbnuHl9phxED53C2mKGF16132evFeKox4+ filters-taxonomic-filter--category-dropdown--light:+ hash: v1.k794b7964.82cbab8a48d85c4f530ba6dc31f6a22dbdadf960595251887933ae8009c5a04a.fl7ERp1mMKg4p6UwGhH2iUSdqPEHzDyJ23MHxb1lcHQ+ filters-taxonomic-filter--category-rail-pinned--dark:+ hash: v1.k794b7964.39915d4d2e7941a192598711dc078f8412927946a2174ceb6fa9137db0bcd39d.Ij-VXWTXnTqi38Y4Fdxxvhi1l3g4tqV80rRWIrAWehM+ filters-taxonomic-filter--category-rail-pinned--light:+ hash: v1.k794b7964.dd22935d8d4ebf873b40796ee98c8e3e733752cd759ae26305c3b542d692c0f6.rlGfkU84C0KPwFL_PxWf4NYBsDwQUjkaL-ZzdtcBjZUfilters-taxonomic-filter--dashboard-property-search--dark:hash: v1.k794b7964.c824be157968e0ef1b8dc82810f4a06dfff364af71722c53823f1d95d4542f7f.D-ZfI3CwGqAa9tdEaUF_psLO6gqWhGZTQnN6Y9i8GRYfilters-taxonomic-filter--dashboard-property-search--light:hash: v1.k794b7964.d6743ee11d1ef80cc0fb6ceaf465684d2fe455ff2e1c4caa423b255dd9ca6dc3.O0RT-HV6tHeocwL0QPZGUceekoc42axbz0eD_buMRtEfilters-taxonomic-filter--empty-events-with-stale-toggle--dark:- hash: v1.k794b7964.76de2509a270a603ac3c1042f75696924394f9fb351a4e7941e2c3b5e131ffc3.swWiwyJN2wEnpQKXFgoJL7eAyKNskSLsjKxC6jorN2Y+ hash: v1.k794b7964.c9c8b86f1f196faf8bb7ff2fa3a8b662b5da749e9d740979253eefd3caef6d83.Vi2aZn3Sv-3nBjiCPo9tkuX4Dj5bZSq-4KMFkSMAKpsfilters-taxonomic-filter--empty-events-with-stale-toggle--light:- hash: v1.k794b7964.9b4ef58d5d3035111d2c92acca7177cb01478a749820f54f8912fc272e968b37._qqVGysKdxr5NnW69wiuWjM63ab9pH6wRWyWdXVyQEU+ hash: v1.k794b7964.06c743209b67d84e2d6403f78e9a8dbb412f4d552936335f6380b841ab20ea05.RJKRGsdtc3psVWSHimWW-MDLaXIyUbQj2dU33xEIYC0filters-taxonomic-filter--events-free--dark:- hash: v1.k794b7964.4728d9998e7463c1600fb8a835f53e94eb17e822ff2957d1fe1e435187839e00.6cDum7LVx0zYoaAnz_I1fEm7xxUhYu3PKUxAEObYp0Q+ hash: v1.k794b7964.86a242674dea38b8ebd31d93957a02e22bff722f3f225d4a6942376954fb50ad.Gd6p0d3jnVCj7cRgPAWZK_00Oyjv6OoeW0QTd8lnV9Yfilters-taxonomic-filter--events-free--light:- hash: v1.k794b7964.4bc7c503eb7c60a0828cea65478bc49899374adea1216c04adf775c0ffb5cfa6.Q9xVXAq5AaB4BZvLViH8eMdpPfbkhXoKuH_LnP3hCfQ+ hash: v1.k794b7964.e3c0815c8dce0b92df1352585b71779c0c966a3cae68ede6ed32735dcba3713a.BubtC_DSYet7B-kOj0yctjx-RJUxUOErpbcPPFLDLq8filters-taxonomic-filter--events-premium--dark:- hash: v1.k794b7964.4728d9998e7463c1600fb8a835f53e94eb17e822ff2957d1fe1e435187839e00.Az6vx9a8qf5ryFiBqPbsj0zwC1m4awc64ZSyWavbs3g+ hash: v1.k794b7964.86a242674dea38b8ebd31d93957a02e22bff722f3f225d4a6942376954fb50ad.y2sZ9Tl-DnrmeVGxInEcF28zI2McWrqW-9BlHrfXxMgfilters-taxonomic-filter--events-premium--light:- hash: v1.k794b7964.4bc7c503eb7c60a0828cea65478bc49899374adea1216c04adf775c0ffb5cfa6.gyk-SHcghSSVxdwCrkcP_uRmbVEtEWm5bKr2AQ-gbNw+ hash: v1.k794b7964.e3c0815c8dce0b92df1352585b71779c0c966a3cae68ede6ed32735dcba3713a.DHzA_l3P_7J_t9WSmmeIXghSd0mq92Y62rNJY6LNgaMfilters-taxonomic-filter--failed-fetch-offers-retry--dark:- hash: v1.k794b7964.7affde427862d7de5b1cab03a672aed48b87ed3006846a24470acf64ecd0624a.Q2RfgFsnhGSxMIrTad4pK0_EL1haMF7LVMNS44-ouT0+ hash: v1.k794b7964.10a15792b243817d48e633c341785bb53c61190855cdaaedbf1d998b63e2eeae.mTmd_ahFm4OUQSDwoQZQYsO3FpPuFvIv4TvR1YqBMz0filters-taxonomic-filter--failed-fetch-offers-retry--light:- hash: v1.k794b7964.36f5fbef198864bb67c573011d12deaf10c758d4559c00091e78611179b578a8.7h32K41k_GmUQ_gVHHJTLNQBlaVxEsoemhDkVbd30iQ+ hash: v1.k794b7964.bb9f77210fc46675e7920c1b21c7a158e4eb39c85a08d4b0cde7c286595f469d.y8Rs6NZrklaloeqgzT466bxafKhL6pW6tLDQxQjgd9ofilters-taxonomic-filter--mcp-tool-call-context-leads-with-mcp-properties--dark:- hash: v1.k794b7964.10cc6a0dfeff4c0fecc10418d1bd6e90cc2686fd6a167cea912e3570fe13590a._l3WLEzX0NIrgvCBNhgnN3CZNXLAGd-bQemIa1S-DAM+ hash: v1.k794b7964.ffbfda93f744b8d5bd5d258502baca3e9765014aef16724e2874e0c7a3bf928d.EbNEAjjebwNJ2q9T6Og9Vo07e0_2dbhtZJTzgtWc0oMfilters-taxonomic-filter--mcp-tool-call-context-leads-with-mcp-properties--light:- hash: v1.k794b7964.36dbfe3bdf83c5e7f5ca5dd73edce02e2332e6963a6cec1b2fc340a4fc43d3e9.upFO8FMMmioJV0MXg-D5zki4cr14Q1lq46ElK8UdwZo+ hash: v1.k794b7964.4c4d2303631a2ea32aeb1a334432b26f5dee85ede270b108b927bfd91e832474.wexhAYuTJIuhrYAEp9B1ezruaBk6ntLFjKWbpwsI2jEfilters-taxonomic-filter--numerical-properties--dark:- hash: v1.k794b7964.f1b9ceffefc1db431c69b114eb7bbf01fcf44fc9137a265bad916ed42221852c.FK72gkH7MwatSmdb2S-aFeRobalvNAyXGpSHncGRPnM+ hash: v1.k794b7964.c33da40dce8ea809b95a29a2fc884686ef54e748fa80070f06e5d5de679df015.5fytenUZztzvNeN3ghgKY7XCHbAWaDlR49GLn3IGQZMfilters-taxonomic-filter--numerical-properties--light:- hash: v1.k794b7964.ba3a2e9972895ac0a858c7195915cc32888fe3099f84f3c6be96e4b103e49abb.AqNbJAtz6T4T9JBqUTaufE3DQFsvYsBMYHMWaKryVpg+ hash: v1.k794b7964.095c98f29bf0bb1300d9377dcbea0570ee80cbd8c01fc4d4ce32f298dd3a68cb.YbMPQxozAMO7VbqWTuAdfHz4BV346ZR978NMNleZZL0filters-taxonomic-filter--promoted-groups-are-reordered--dark:- hash: v1.k794b7964.6c154df0fe8a33d64cecdcbe9c80c41f75b44955fcfe8d8cb1b7e976e63f52b1.a3rQeqa6kFtRaryK0VWQEV3kstMPDV26z95D0g9Nzk4+ hash: v1.k794b7964.9b702b159248b346096153fa9040cbe32461f9163bc61db4a62207e7b3d41a03.kSWC_rpadvSfeHEOpdZ_Kl-JU3x_7OyFJXiDXzERUrofilters-taxonomic-filter--promoted-groups-are-reordered--light:- hash: v1.k794b7964.72c3cdabb378b0bab4db9351c673157e381d52a6e94778371669773633a62a8f.viAye9V24wtTD6Q4njvN_VmFnuiDRAqv_g7jNCuHEpA+ hash: v1.k794b7964.cb1eb14839e658abad0801b14e99596eb0c0a72fa627abd132ec2e2619982c4f.fgFqhz7UOlj_6r_WoOabyd4VlmuJl6F1rYpq8lkMdzwfilters-taxonomic-filter--properties--dark:- hash: v1.k794b7964.7f10cc4d299efb2748a201883f681f8f463f0061d3886b659e89d34829116360.VeADZfhbb9MjF6HG4YSYqoHrt4bQSJN83OhaJNsU_mU+ hash: v1.k794b7964.59b62656e5f6ab4c7c6d3176c4887908ff8ae6629be1c4de6d961cba3edcb740.SfH14sAsSUB_-GlD8HK3Nas0JJlsuZ3fHXFtFu-zwDofilters-taxonomic-filter--properties--light:- hash: v1.k794b7964.a229571ad3b105ff6350ff66d6584a5bff7ab819094807911df1b9d285c1a3b9.BX0vgClKIjK4LgjSkYKXQ7ovpHxl-3E1R3FLtGSEJ5c+ hash: v1.k794b7964.d2bfa537685aa60fc07f714fd3aaa30473e9fd672b0e95754f57b310744342c7.X8SCD8UcIaycEwD0z8gq2_EWm68nI4opUEKSY0--Pj4filters-taxonomic-filter--renamed-series-selected--dark:- hash: v1.k794b7964.7503afa148b4575964fcee6837b0dbfb532f20b5377421b9cc913c7732f0b132.FyuVsOtCZUJnnsiu5PPDWGz-8PnRIIXWZvjpfVn4SBs+ hash: v1.k794b7964.7a64d4e031d99774addf09c78809b732e1de363b31f9c700218c8bf7575d3e2f.WH57yBR5J4UpTBmxZY9s8ol8xcIv-hK1X3Lc9emcbEQfilters-taxonomic-filter--renamed-series-selected--light:- hash: v1.k794b7964.265574dccf819679ece5d89bc7578776d89986efe77372678c7105c1c0b7ba76.ayar1_PHKhSooqRgpBghGwD_0i_nUQ11CSMzG5hy-VI- filters-taxonomic-filter--renamed-series-selected-pill--dark:- hash: v1.k794b7964.eaef81d99ef62f0177d1c2ced630859e192db2e35931e339050b9e016135ffdd.I-1JCC4Mjbm7HoyRWtKjTxrjCCZw7pF9sQQco-4inf8- filters-taxonomic-filter--renamed-series-selected-pill--light:- hash: v1.k794b7964.be8eb8d6bdb15d011e6e83767b2e479889d1bfddd5845c22e94b28a0536edda5.Gn81WhxJ1Nyqg-Y96fbwf3rPb5gNR8mGPOQ9ZbKsftg+ hash: v1.k794b7964.1940698d5a4fcf5314afcc4f2f582228c3adcf8d8b7cc5f8725441f8a8d040b6.jx2166ANNlMWUeUy7K3G6V1zzk4Be62rFEreWDkf2r0+ filters-taxonomic-filter--renamed-series-selected-with-all-results--dark:+ hash: v1.k794b7964.7a64d4e031d99774addf09c78809b732e1de363b31f9c700218c8bf7575d3e2f.bm9u1TaKULFXL7zhr293AHvC82-5Puiypn88v0euEJU+ filters-taxonomic-filter--renamed-series-selected-with-all-results--light:+ hash: v1.k794b7964.1940698d5a4fcf5314afcc4f2f582228c3adcf8d8b7cc5f8725441f8a8d040b6.L87TGLih84ffADwLJZCeToQdaIewW50aBiH7MdbZ1CQfilters-taxonomic-filter--six-groups-default-layout--dark:- hash: v1.k794b7964.3ff86f47ef2d3dba1fee33ff0b272957a3fb9be9c58fe15916a26d40648f8da2.nepSeMiVZl-HrJhjENRmfWJJJjl4U1tl2MJdRAZdNzM+ hash: v1.k794b7964.627294fb84ded4e91c4b583e04c2b6e9ca0bdcd34464f49d0d26234cc89d4348.M68XdlTkoApLdDr13jO67fmlGFLjATJfb8ZwdU6xP5Yfilters-taxonomic-filter--six-groups-default-layout--light:- hash: v1.k794b7964.003b83d06952bfc711fe95e8abd69639de0f985d684cfa0fc25f4d2ef2b2c04a.wFXjZUyCqKbHsU7G_fQWm2xT3hoVdRGjynqvYZzFSZI+ hash: v1.k794b7964.9cd1c6956bc4c758b448ef5c2a68856f7e5d337f9e14b710d91eab2d3dfd11b5.DC2VxqryAs1k3BXNGuXjhF9iBuf0hKyAg2yu6AT1ifwfilters-taxonomic-filter--slow-expansion-count--dark:- hash: v1.k794b7964.55ab882bfbf3409d3c1fc7b6bc1e789d0dc45df6be476d064e3e31846d0198a7.O9i884MaNqkYvB79uREi2Rokijv0XzzCq608uUQc6a4+ hash: v1.k794b7964.c3783e44baf26929ef52a628b80518b29b164b75940c8838d9d433ed0b20f7a4.xCUhop6GMvnPlG1OYdefsLgIA4lnMQAGDPQwLn9GXKkfilters-taxonomic-filter--slow-expansion-count--light:- hash: v1.k794b7964.c4dc4ba4ef70489c68bbe39604f9c2b7a151b966c7024d8d731524621b7ea841.sViaRKl9qfetOS3eSjqiGA9hBiQAvn8zNn9dOuKUL-Q+ hash: v1.k794b7964.eba313bd86effd499c583d3627f8b2a65cb094b4d8315c3605cab76ff5e3cb03.G6jhuV9FxmQDbO9uL8xlftotmScDKki6EhVSOfIih9kfilters-taxonomic-filter--suggested-filters-five-recents-with-truncation--dark:- hash: v1.k794b7964.25c5a602de850aa30dab99cdcdd94e05228979717d8642e1e167ff9094998a61.39lfsQXVq0JdwFukLKAgSxXGi1-YYpsSCA2AbYmZrb4+ hash: v1.k794b7964.909719eef6bf0509b61e9aa25510c7ebd0b41418e6d752d5ec6684583e5f116d.f_mdD2E4gjY2O2_Jzx8wesBuNW_WeWeR-U9ZFFUNB98filters-taxonomic-filter--suggested-filters-five-recents-with-truncation--light:- hash: v1.k794b7964.6991b91cb5fe413bbaa3f3c474ca93a185dac031ac9bd67fb5feb9fe52ff6076.I9lPDR1Dig43x6KwtNF2cZMPg5b1OKRnMDuK7IsnD24+ hash: v1.k794b7964.342cf0c728c39e81ab51d9aea255de0b87462545be40929323d8dad39c11672f.6qQB4HafqsVUtThF4MnYljAcGeXcR1C4uimfVXGD_3kfilters-taxonomic-filter--suggested-filters-four-recents--dark:- hash: v1.k794b7964.f41d252e1354dd4737fcc4890b36a75512c3250b75e5a2ece14ed759e995fd63.Dn9PdpJKIB1ZBQ7rE1wm3dnLfWzROZLwYhuh_kPu-jE+ hash: v1.k794b7964.8ab29811d9a361822aa041e67960d8befb8bfc0db665b92a90313a231ebc2869.YYZrU9nQuOGkrGd07fNAAEZvKYsAWPjCFff_RH54-4ofilters-taxonomic-filter--suggested-filters-four-recents--light:- hash: v1.k794b7964.034325fb40592dcc4f98ca304a7889506162063e5247855ce5125c2447c2cbc3.Y68te_XBpKoJJaYU-SC4NXlSiJfLCzMFvu5sXpPEY-s+ hash: v1.k794b7964.7a58e76862d0973aac72456ecb2f15d829140743c6febe7da38a03905c1773a7.k2ubsvZWOpP5YgzuSlbjt9hpllqINuT-pfKQQxf6Kqcfilters-taxonomic-filter--suggested-filters-no-recents--dark:- hash: v1.k794b7964.c4a4c0ecc19f72c726367085f912e7ebd8ba9b7615a8a5c61f156fb31a1f2784.W6PaoiG2KnuNbVco_uiAQyVqi45rwV2fK4WBQZ8ztjQ+ hash: v1.k794b7964.8bc3d8a3fa5b2a6ae51ff5ee794eb3aa9e6f70950dbdc4ca57480881f4674122.58CcEGGEN2R9jO2eTg79v2B73LeE7ZAxI5Li4fPNKWYfilters-taxonomic-filter--suggested-filters-no-recents--light:- hash: v1.k794b7964.a8446e83493a18ac462e5c7a1bda7db842e3b0e39f22125cfadd7b8cc61930a8.VRodVeEYNl9jrtzcmLWePm0tnIHaz8Ta9hEUehuC2hc+ hash: v1.k794b7964.f2b92329e73b790539a31cce61a2437dfdf919f31336df56cb6398c78effefdd.M3iy09A8ezvKvWQoByF2zFV58V-6Q2ejndadLyzIauEfilters-taxonomic-filter--suggested-filters-one-recent--dark:- hash: v1.k794b7964.cac8dad592810a3cac21074959a40e82a7c95aa65d720c923de234e20bbae6fc.DPlP3uLjgPiXJbaMow_ktoMovWWa4bMnRf3BlAeekCk+ hash: v1.k794b7964.fd40b1f794e4b8d6a568b6ad04f0e8a6290703d66a3b3d1e09df38feda4af993.sppJmyKzvYu7JzECp7KA3OBzAu9c-_UA6ma7gg6UidIfilters-taxonomic-filter--suggested-filters-one-recent--light:- hash: v1.k794b7964.2e2cb135cba1b584258e28105d308b2d3bfd405f39884bd80a6effa1f6d9667c.ozDvOSPG6-ovzLmvHX53EMwxiZalo5Y_sl33twu7FN0+ hash: v1.k794b7964.c6b48808b77b77d9f78e796ce64abc2c9b25f2518abf95f9c5f3a6e2c8a5f319.ZIvUaZjf4atEwGPmcwAF-wGHYdHypbXUOJN9rS6z1bYfilters-taxonomic-filter--three-groups-default-layout--dark:- hash: v1.k794b7964.33e6bc12018b8fa898795c367382f10b34f3254217c943ed6e3a4ea115b11c5b.N8veqMWb7ahuE2b0FAmFc2R8lCHuFq3VcqevUTB7Ykg+ hash: v1.k794b7964.4cfbb81c4c750a1ce92af203b15f88591898401a3627a4bcd6cb953896cfa101.AYKwPfqIFp6iTqcfHtoWTb1DLwMxhhNPcILKsS2-YoYfilters-taxonomic-filter--three-groups-default-layout--light:- hash: v1.k794b7964.b0064791a0c92e466cc4407b015fd3606a806c09d0d61b914682e2dbb687d572.QiaBRTp7nIEJai8kC0F6vl3i-wJDVuCzXw7J8sVx8KM+ hash: v1.k794b7964.52b14938c6d46ada7a2e836ffb42d822b5fdb110021929729fef734f80fa0c3c.c7Ny9VfNlpKbolYt_jxLFlxHU0SgbWywGVLn4XdpU5Mfilters-taxonomic-filter-menu-rebuild--data-warehouse-config--dark:hash: v1.k794b7964.695594eab6753acf560cbd54ecd1fa59157d0844e11c1ace7fe5e0637d60a570.84QX-AsU_pJxzLcbc1edVoTr4rn-EnEY25SbyuXe7Ysfilters-taxonomic-filter-menu-rebuild--data-warehouse-config--light:diff --git a/frontend/src/lib/components/DefinitionPopover/DefinitionPopover.stories.tsx b/frontend/src/lib/components/DefinitionPopover/DefinitionPopover.stories.tsxindex 25a5a1dccd65..c7d615eed48b 100644--- a/frontend/src/lib/components/DefinitionPopover/DefinitionPopover.stories.tsx+++ b/frontend/src/lib/components/DefinitionPopover/DefinitionPopover.stories.tsx@@ -5,7 +5,6 @@ import { BindLogic } from 'kea'import { useRef } from 'react'import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'-import { FEATURE_FLAGS } from 'lib/constants'import { mswDecorator } from '~/mocks/browser'import {@@ -311,7 +310,6 @@ const DataWarehouseColumnMappingWrapper = (): JSX.Element => {export const DataWarehouseColumnMapping: Story = {render: () => <DataWarehouseColumnMappingWrapper />,parameters: {- featureFlags: { [FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]: 'pill' },testOptions: { waitForSelector: '.definition-popover-data-warehouse-schema-form' },},// Open the first column picker so the snapshot captures the filterablediff --git a/frontend/src/lib/components/PropertyFilters/PropertyFilters.component.test.tsx b/frontend/src/lib/components/PropertyFilters/PropertyFilters.component.test.tsxindex af657cb61ab1..20ffb88974cc 100644--- a/frontend/src/lib/components/PropertyFilters/PropertyFilters.component.test.tsx+++ b/frontend/src/lib/components/PropertyFilters/PropertyFilters.component.test.tsx@@ -4,9 +4,6 @@ import { act, cleanup, render, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { Provider } from 'kea'-import { FEATURE_FLAGS } from 'lib/constants'-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'-import { useMocks } from '~/mocks/jest'import { actionsModel } from '~/models/actionsModel'import { groupsModel } from '~/models/groupsModel'@@ -16,6 +13,7 @@ import { mockActionDefinition, mockGetEventDefinitions, mockGetPropertyDefinitioimport { PropertyFilterType, PropertyOperator } from '~/types'import { recentTaxonomicFiltersLogic } from '../TaxonomicFilter/recentTaxonomicFiltersLogic'+import { taxonomicFilterCategoryLayoutLogic } from '../TaxonomicFilter/taxonomicFilterCategoryLayoutLogic'import { TaxonomicFilterGroupType } from '../TaxonomicFilter/types'import { PropertyFilters } from './PropertyFilters'@@ -27,6 +25,8 @@ jest.mock('lib/components/AutoSizer', () => ({describe('PropertyFilters recent selections', () => {beforeEach(() => {initKeaTests()+ taxonomicFilterCategoryLayoutLogic.mount()+ taxonomicFilterCategoryLayoutLogic.actions.setCategoryRailPinned(true)actionsModel.mount()groupsModel.mount()propertyDefinitionsModel.mount()@@ -473,23 +473,12 @@ describe('PropertyFilters recent selections', () => {})describe('category dropdown inside property modal', () => {- let unmountFeatureFlagLogic: (() => void) | null = null-beforeEach(() => {- unmountFeatureFlagLogic = featureFlagLogic.mount()- })-- afterEach(() => {- featureFlagLogic.actions.setFeatureFlags([], {})- unmountFeatureFlagLogic?.()- unmountFeatureFlagLogic = null+ taxonomicFilterCategoryLayoutLogic.actions.setCategoryRailPinned(false)})- it('pill variant: clicking the inline category trigger does not close the property modal', async () => {+ it('clicking the inline category trigger does not close the property modal', async () => {useSetupMocks()- featureFlagLogic.actions.setFeatureFlags([FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN], {- [FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]: 'pill',- })renderFilters({taxonomicGroupTypes: [@@ -506,11 +495,8 @@ describe('PropertyFilters recent selections', () => {expect(screen.getByTestId('taxonomic-filter-searchfield')).toBeInTheDocument()})- it('pill variant: picking a category in the inline dropdown does not close the property modal', async () => {+ it('picking a category in the inline dropdown does not close the property modal', async () => {useSetupMocks()- featureFlagLogic.actions.setFeatureFlags([FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN], {- [FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]: 'pill',- })renderFilters({taxonomicGroupTypes: [diff --git a/frontend/src/lib/components/TaxonomicFilter/CategoryDropdown.tsx b/frontend/src/lib/components/TaxonomicFilter/CategoryDropdown.tsxindex f386e0bdd68e..f2febee02a49 100644--- a/frontend/src/lib/components/TaxonomicFilter/CategoryDropdown.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/CategoryDropdown.tsx@@ -1,44 +1,41 @@+import clsx from 'clsx'import { useActions, useValues } from 'kea'import posthog from 'posthog-js'-import { useCallback } from 'react'-import { IconChevronDown } from '@posthog/icons'+import { IconChevronDown, IconSidebarClose, IconSidebarOpen } from '@posthog/icons'-import { FEATURE_FLAGS } from 'lib/constants'import { CLICK_OUTSIDE_BLOCK_CLASS } from 'lib/hooks/useOutsideClickHandler'import { LemonButton } from 'lib/lemon-ui/LemonButton'-import { LemonMenu, LemonMenuItem } from 'lib/lemon-ui/LemonMenu'+import { LemonMenu, LemonMenuItem, LemonMenuItems } from 'lib/lemon-ui/LemonMenu'import { eventUsageLogic } from 'lib/utils/eventUsageLogic'+import { taxonomicFilterCategoryLayoutLogic } from './taxonomicFilterCategoryLayoutLogic'import { taxonomicFilterLogic } from './taxonomicFilterLogic'-import { CategoryDropdownVariant, TaxonomicFilterGroupType } from './types'+import { TaxonomicFilterGroupType } from './types'export function CategoryDropdown({- variant,eventName,onAfterChange,joinedToInput = false,}: {- variant: Exclude<CategoryDropdownVariant, 'control'>eventName?: stringonAfterChange?: () => voidjoinedToInput?: boolean}): JSX.Element | null {const { activeTab, taxonomicGroups, taxonomicGroupTypes } = useValues(taxonomicFilterLogic)- const { setActiveTab } = useActions(taxonomicFilterLogic)+ const { markUserInteraction, setActiveTab } = useActions(taxonomicFilterLogic)+ const { categoryRailPinned } = useValues(taxonomicFilterCategoryLayoutLogic)+ const { setCategoryRailPinned } = useActions(taxonomicFilterCategoryLayoutLogic)const { reportTaxonomicFilterCategorySelected } = useActions(eventUsageLogic)- const onVisibilityChange = useCallback(- (visible: boolean) => {- if (visible) {- posthog.capture('taxonomic filter category dropdown opened', {- variant,- [`$feature/${FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN}`]: variant,- })- }- },- [variant]- )+ const onVisibilityChange = (visible: boolean): void => {+ if (visible) {+ markUserInteraction()+ posthog.capture('taxonomic filter category dropdown opened', {+ variant: 'pill',+ })+ }+ }if (taxonomicGroupTypes.length <= 1) {return null@@ -48,7 +45,7 @@ export function CategoryDropdown({const activeGroup = taxonomicGroups.find((g) => g.type === openTab)const activeLabel = activeGroup?.name ?? openTab- const items: LemonMenuItem[] = taxonomicGroupTypes.map((groupType) => {+ const categoryItems: LemonMenuItem[] = taxonomicGroupTypes.map((groupType) => {const group = taxonomicGroups.find((g) => g.type === groupType)return {key: groupType,@@ -63,6 +60,25 @@ export function CategoryDropdown({}})+ const items: LemonMenuItems = [+ { items: categoryItems },+ {+ items: [+ {+ key: 'toggle-category-rail',+ label: categoryRailPinned ? 'Undock categories' : 'Dock categories',+ icon: categoryRailPinned ? <IconSidebarClose /> : <IconSidebarOpen />,+ 'data-attr': 'taxonomic-category-rail-toggle',+ onClick: () => {+ markUserInteraction()+ setCategoryRailPinned(!categoryRailPinned)+ onAfterChange?.()+ },+ },+ ],+ },+ ]+const activeItemIndex = taxonomicGroupTypes.findIndex((g) => g === openTab)return (@@ -73,29 +89,26 @@ export function CategoryDropdown({placement="bottom-start"className={CLICK_OUTSIDE_BLOCK_CLASS}>- {renderTrigger(variant, activeLabel, joinedToInput)}+ {renderTrigger(activeLabel, joinedToInput, categoryRailPinned)}</LemonMenu>)}-function renderTrigger(- variant: Exclude<CategoryDropdownVariant, 'control'>,- activeLabel: string,- joinedToInput: boolean-): JSX.Element {+function renderTrigger(activeLabel: string, joinedToInput: boolean, categoryRailPinned: boolean): JSX.Element {return (<LemonButtontype={joinedToInput ? 'tertiary' : 'secondary'}size="xsmall"truncate={joinedToInput}sideIcon={<IconChevronDown />}- data-attr={`taxonomic-category-dropdown-trigger-${variant}`}+ // This shipped selector is used by external tests and autocapture.+ data-attr="taxonomic-category-dropdown-trigger-pill"aria-label={`Current category: ${activeLabel}. Click to change.`}- className={- joinedToInput- ? `${CLICK_OUTSIDE_BLOCK_CLASS} TaxonomicFilter__category-dropdown`- : CLICK_OUTSIDE_BLOCK_CLASS- }+ className={clsx(+ CLICK_OUTSIDE_BLOCK_CLASS,+ joinedToInput && 'TaxonomicFilter__category-dropdown',+ categoryRailPinned && 'hidden @max-[32rem]:inline-flex'+ )}>{activeLabel}</LemonButton>diff --git a/frontend/src/lib/components/TaxonomicFilter/InfiniteList.tsx b/frontend/src/lib/components/TaxonomicFilter/InfiniteList.tsxindex 578f7cec6356..1ca2074a1e1d 100644--- a/frontend/src/lib/components/TaxonomicFilter/InfiniteList.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/InfiniteList.tsx@@ -731,8 +731,6 @@ function InfiniteListEmptyState(): JSX.Element {taxonomicGroupTypes.includes(TaxonomicFilterGroupType.SuggestedFilters) &&allSectionHasResults- // Without the aggregated "all" tab (e.g. the control variant, which doesn't inject SuggestedFilters),- // there's no single place to jump to — so surface the specific categories that do have matches.// Keyed off result counts (not `infiniteListCounts`/`totalListCount`) so render-backed groups like// the SQL expression editor, whose affordance row makes `totalListCount` non-zero for any query,// don't produce a misleading "See results in …" jump.@@ -746,8 +744,8 @@ function InfiniteListEmptyState(): JSX.Element {): []- // Reads the Events group rather than this list's own group: in the pill variant the active tab is- // the aggregated one, which carries no exclusions of its own. `taxonomicGroups` holds every group+ // Reads the Events group rather than this list's own group because the active tab can be the+ // aggregated one, which carries no exclusions of its own. `taxonomicGroups` holds every group// whether or not this filter offers it, hence the gate.const hiddenEventSearched = taxonomicGroupTypes.includes(TaxonomicFilterGroupType.Events)? hiddenEventMatchingSearch(diff --git a/frontend/src/lib/components/TaxonomicFilter/InfiniteSelectResults.tsx b/frontend/src/lib/components/TaxonomicFilter/InfiniteSelectResults.tsxindex 565770a26053..0d0ad33613bc 100644--- a/frontend/src/lib/components/TaxonomicFilter/InfiniteSelectResults.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/InfiniteSelectResults.tsx@@ -1,12 +1,12 @@import { BindLogic, useActions, useValues } from 'kea'import { useRef } from 'react'-import { LemonTag, Tooltip } from '@posthog/lemon-ui'+import { IconSidebarClose } from '@posthog/icons'+import { LemonButton, LemonTag, Tooltip } from '@posthog/lemon-ui'import { InfiniteList } from 'lib/components/TaxonomicFilter/InfiniteList'import { infiniteListLogic } from 'lib/components/TaxonomicFilter/infiniteListLogic'import {- CategoryDropdownVariant,DefinitionPopoverRenderer,TaxonomicFilterGroupType,TaxonomicFilterLogicProps,@@ -18,6 +18,7 @@ import { userLogic } from 'scenes/userLogic'import { AvailableFeature } from '~/types'+import { taxonomicFilterCategoryLayoutLogic } from './taxonomicFilterCategoryLayoutLogic'import { TaxonomicFilterEmptyState, taxonomicFilterGroupTypesWithEmptyStates } from './TaxonomicFilterEmptyState'import { taxonomicFilterLogic } from './taxonomicFilterLogic'@@ -26,7 +27,6 @@ export interface InfiniteSelectResultsProps {taxonomicFilterLogicProps: TaxonomicFilterLogicPropspopupAnchorElement: HTMLDivElement | nulldefinitionPopoverRenderer?: DefinitionPopoverRenderer- categoryDropdownVariant?: CategoryDropdownVariant}export function getCategoryPillDisabledReason(@@ -157,7 +157,6 @@ export function InfiniteSelectResults({taxonomicFilterLogicProps,popupAnchorElement,definitionPopoverRenderer,- categoryDropdownVariant = 'control',}: InfiniteSelectResultsProps): JSX.Element {const { activeTab, taxonomicGroups, taxonomicGroupTypes, activeTaxonomicGroup, value } =useValues(taxonomicFilterLogic)@@ -167,7 +166,9 @@ export function InfiniteSelectResults({const infiniteListLogicProps = { ...taxonomicFilterLogicProps, listGroupType: openTab }const logic = infiniteListLogic(infiniteListLogicProps)- const { setActiveTab, selectItem } = useActions(taxonomicFilterLogic)+ const { markUserInteraction, setActiveTab, selectItem } = useActions(taxonomicFilterLogic)+ const { setCategoryRailPinned } = useActions(taxonomicFilterCategoryLayoutLogic)+ const { categoryRailPinned } = useValues(taxonomicFilterCategoryLayoutLogic)const { reportTaxonomicFilterCategorySelected } = useActions(eventUsageLogic)const { totalListCount, isLocalDataLoading } = useValues(logic)@@ -175,7 +176,7 @@ export function InfiniteSelectResults({const RenderComponent = activeTaxonomicGroup?.renderconst hasMultipleGroups = taxonomicGroupTypes.length > 1- const showCategoryColumn = hasMultipleGroups && categoryDropdownVariant === 'control'+ const showCategoryColumn = hasMultipleGroups && categoryRailPinnedconst listComponent = RenderComponent ? (<RenderComponent@@ -211,10 +212,23 @@ export function InfiniteSelectResults({taxonomicFilterGroupTypesWithEmptyStates.includes(openTab)return (- <div ref={wrapperRef} className="flex flex-row h-full">+ <div ref={wrapperRef} className="@container flex flex-row h-full">{showCategoryColumn && (- <div className="border-r pr-2 mr-2 flex-shrink-0 border-primary">- <div className="taxonomic-group-title">Categories</div>+ <div className="TaxonomicFilter__category-rail border-r pr-2 mr-2 flex-shrink-0 border-primary @max-[32rem]:hidden">+ <div className="taxonomic-group-title items-center justify-between gap-1">+ <span>Categories</span>+ <LemonButton+ type="tertiary"+ size="xsmall"+ icon={<IconSidebarClose />}+ tooltip="Undock categories"+ data-attr="taxonomic-category-rail-unpin"+ onClick={() => {+ markUserInteraction()+ setCategoryRailPinned(false)+ }}+ />+ </div><div className="taxonomic-pills flex flex-col gap-1">{taxonomicGroupTypes.map((groupType) => {return (diff --git a/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.scss b/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.scssindex 636c5e0f664d..7f39bc3f2754 100644--- a/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.scss+++ b/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.scss@@ -53,3 +53,9 @@min-height: 100%;}}++.TaxonomicFilter__category-rail {+ .taxonomic-group-title {+ align-items: center;+ }+}diff --git a/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.stories.tsx b/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.stories.tsxindex 308ba47f553b..5f9c698cd7a1 100644--- a/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.stories.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.stories.tsx@@ -6,11 +6,9 @@ import { delay } from 'msw'import { useEffect } from 'react'import { taxonomicFilterMocksDecorator } from 'lib/components/TaxonomicFilter/__mocks__/taxonomicFilterMocksDecorator'-import { CategoryDropdownVariant, TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'-import { FEATURE_FLAGS } from 'lib/constants'+import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'import { useDelayedOnMountEffect } from 'lib/hooks/useOnMountEffect'import { useOnMountEffect } from 'lib/hooks/useOnMountEffect'-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'import { mswDecorator } from '~/mocks/browser'import { useAvailableFeatures } from '~/mocks/features'@@ -20,6 +18,7 @@ import { type AnyPropertyFilter, AvailableFeature, EntityTypes, PropertyFilterTyimport { infiniteListLogic } from './infiniteListLogic'import { recentTaxonomicFiltersLogic } from './recentTaxonomicFiltersLogic'import { TaxonomicFilter } from './TaxonomicFilter'+import { taxonomicFilterCategoryLayoutLogic } from './taxonomicFilterCategoryLayoutLogic'import { taxonomicFilterLogic } from './taxonomicFilterLogic'import { TaxonomicFilterProps } from './types'@@ -61,14 +60,14 @@ export const DashboardPropertySearch: Story = {enableKeywordShortcuts: true,collapseUrlsToContainsRow: true,},- parameters: {- featureFlags: { [FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]: 'pill' },- testOptions: { waitForSelector: '.taxonomic-infinite-list' },- },+ parameters: { testOptions: { waitForSelector: '.taxonomic-infinite-list' } },}function EventsStoryRender(args: TaxonomicFilterProps): JSX.Element {useMountedLogic(actionsModel)+ const { setActiveTab } = useActions(+ taxonomicFilterLogic({ ...args, taxonomicFilterLogicKey: args.taxonomicFilterLogicKey as string })+ )const { setIndex } = useActions(infiniteListLogic({@@ -80,7 +79,10 @@ function EventsStoryRender(args: TaxonomicFilterProps): JSX.Element {// Highlight the second item, as the first one is "All events", which doesn't have a definition to show// - we do want to show the definition popover here too- useDelayedOnMountEffect(() => setIndex(1))+ useDelayedOnMountEffect(() => {+ setActiveTab(TaxonomicFilterGroupType.Events)+ setIndex(1)+ })return (<div className="w-fit border rounded p-2 bg-surface-primary">@@ -108,6 +110,9 @@ export const EventsPremium: Story = {render: (args) => {useMountedLogic(actionsModel)useAvailableFeatures([AvailableFeature.INGESTION_TAXONOMY])+ const { setActiveTab } = useActions(+ taxonomicFilterLogic({ ...args, taxonomicFilterLogicKey: args.taxonomicFilterLogicKey as string })+ )const { setIndex } = useActions(infiniteListLogic({@@ -117,7 +122,10 @@ export const EventsPremium: Story = {}))- useDelayedOnMountEffect(() => setIndex(1))+ useDelayedOnMountEffect(() => {+ setActiveTab(TaxonomicFilterGroupType.Events)+ setIndex(1)+ })return (<div className="w-fit border rounded p-2 bg-surface-primary">@@ -532,18 +540,8 @@ export const MCPToolCallContextLeadsWithMCPProperties: Story = {},}-function CategoryDropdownStoryRender({- variant,- ...args-}: TaxonomicFilterProps & { variant: CategoryDropdownVariant }): JSX.Element {+function CategoryDropdownStoryRender(args: TaxonomicFilterProps): JSX.Element {useMountedLogic(actionsModel)- useMountedLogic(featureFlagLogic)-- useEffect(() => {- featureFlagLogic.actions.setFeatureFlags([FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN], {- [FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]: variant,- })- }, [variant])return (<div className="w-fit border rounded p-2 bg-surface-primary">@@ -565,34 +563,50 @@ const CATEGORY_DROPDOWN_PARAMETERS = {testOptions: { waitForSelector: '.taxonomic-infinite-list' },}-export const CategoryDropdownControl: Story = {- render: (args) => <CategoryDropdownStoryRender {...args} variant="control" />,+export const CategoryDropdown: Story = {+ render: CategoryDropdownStoryRender,args: CATEGORY_DROPDOWN_ARGS,- tags: ['test-skip'], // featureFlagLogic setup via useEffect races with the visual-regression runner — verified manually in storybookparameters: {...CATEGORY_DROPDOWN_PARAMETERS,docs: {description: {- story: 'A/B test control: left-hand Categories column is visible and Tab/Shift+Tab cycles between categories.',+ story: 'The active category appears as a pill in the search input. Open it to browse categories or dock the category rail.',},},},}-export const CategoryDropdownPill: Story = {- render: (args) => <CategoryDropdownStoryRender {...args} variant="pill" />,+export const CategoryRailPinned: Story = {+ render: CategoryRailStoryRender,args: CATEGORY_DROPDOWN_ARGS,- tags: ['test-skip'], // featureFlagLogic setup via useEffect races with the visual-regression runner — verified manually in storybookparameters: {- ...CATEGORY_DROPDOWN_PARAMETERS,+ testOptions: { waitForSelector: '[data-attr="taxonomic-category-rail-unpin"]' },docs: {description: {- story: 'Test variant "pill": left-hand Categories column is hidden; the current category is shown as a pill in the right-hand suffix of the search input.',+ story: 'Pinned categories remain visible beside the results on wide layouts.',},},},}+function CategoryRailStoryRender(args: TaxonomicFilterProps): JSX.Element {+ useMountedLogic(actionsModel)+ const { setCategoryRailPinned } = useActions(taxonomicFilterCategoryLayoutLogic)++ useEffect(() => {+ setCategoryRailPinned(true)+ return () => {+ setCategoryRailPinned(false)+ }+ }, [setCategoryRailPinned])++ return (+ <div className="w-fit border rounded p-2 bg-surface-primary">+ <TaxonomicFilter {...args} />+ </div>+ )+}+// The committed selection of a renamed series ('signed up', renamed "Completed sign-up")// is promoted to the top of the list, labelled with the rename and revealing the// underlying event as secondary text (tooltip on hover).@@ -639,7 +653,7 @@ export const RenamedSeriesSelected: Story = {},}-export const RenamedSeriesSelectedPill: Story = {+export const RenamedSeriesSelectedWithAllResults: Story = {render: (args) => {useMountedLogic(actionsModel)return (@@ -650,14 +664,13 @@ export const RenamedSeriesSelectedPill: Story = {},args: {...RENAMED_SERIES_ARGS,- taxonomicFilterLogicKey: 'renamed-series-selected-pill',+ taxonomicFilterLogicKey: 'renamed-series-selected-all',},parameters: {...RENAMED_SERIES_PARAMETERS,- featureFlags: { [FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]: 'pill' },docs: {description: {- story: "Same renamed-series selection in the pill category-dropdown variant: the Categories column is folded into the search input's pill, and the promoted committed row still shows the rename with the underlying event.",+ story: 'Same renamed-series selection with All results. The promoted committed row still shows the rename with the underlying event.',},},},diff --git a/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.test.tsx b/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.test.tsxindex 5e5513a08c5b..1a20ed7cea5a 100644--- a/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.test.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.test.tsx@@ -25,6 +25,7 @@ import { PropertyFilterType, PropertyOperator } from '~/types'import { clearApiCache } from './infiniteListLogic'import { recentTaxonomicFiltersLogic } from './recentTaxonomicFiltersLogic'import { TaxonomicFilter } from './TaxonomicFilter'+import { taxonomicFilterCategoryLayoutLogic } from './taxonomicFilterCategoryLayoutLogic'import { TaxonomicFilterGroupType } from './types'jest.mock('~/queries/query', () => ({@@ -77,6 +78,8 @@ describe('TaxonomicFilter', () => {// one's fixture. Same reset infiniteListLogic.test.ts does.clearApiCache()initKeaTests()+ taxonomicFilterCategoryLayoutLogic.mount()+ taxonomicFilterCategoryLayoutLogic.actions.setCategoryRailPinned(true)actionsModel.mount()groupsModel.mount()})@@ -125,10 +128,6 @@ describe('TaxonomicFilter', () => {},},})- featureFlagLogic.mount()- featureFlagLogic.actions.setFeatureFlags([FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN], {- [FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]: 'pill',- })const { container } = renderFilter({taxonomicGroupTypes: [TaxonomicFilterGroupType.EventProperties,@@ -466,34 +465,6 @@ describe('TaxonomicFilter', () => {expect(screen.queryByTestId('taxonomic-switch-to-all')).not.toBeInTheDocument()})- it('offers a per-category jump when matches live on another tab and there is no all section', async () => {- // No SuggestedFilters group (control variant), so the aggregated "all" jump is unavailable —- // the empty state must instead point at the specific tab that matched.- renderFilter({- taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.PersonProperties],- })-- await activateGroupWithResults('taxonomic-tab-events')- // `purchase_value` exists only as a property, so the active Events tab comes up empty- await withoutDebounceDelay((user) =>- user.type(screen.getByTestId('taxonomic-filter-searchfield'), 'purchase_value')- )-- let switchButton: HTMLElement | undefined- await waitFor(() => {- switchButton = inVisibleTab(screen.getAllByTestId('taxonomic-switch-to-person_properties'))- expect(switchButton).toBeTruthy()- })- expect(switchButton).toHaveTextContent(/See results in Person properties/i)- expect(screen.queryByTestId('taxonomic-switch-to-all')).not.toBeInTheDocument()-- await userEvent.click(switchButton!)-- await waitFor(() => {- expectActiveTab('taxonomic-tab-person_properties')- })- })-it('does not offer a jump to a render-backed group with no real matches', async () => {// SQL expression is render-backed: its affordance row makes totalListCount non-zero for// any query, but it has no actual search results. It must not produce a bogus jump button.@@ -610,6 +581,8 @@ describe('TaxonomicFilter', () => {taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],})+ await userEvent.click(await screen.findByTestId('taxonomic-tab-events'))+await waitFor(() => {expect(screen.getByTestId('prop-filter-events-0')).toBeInTheDocument()})@@ -643,6 +616,8 @@ describe('TaxonomicFilter', () => {taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],})+ await userEvent.click(await screen.findByTestId('taxonomic-tab-events'))+await waitFor(() => {expect(screen.getByTestId('prop-filter-events-0')).toBeInTheDocument()})@@ -675,6 +650,8 @@ describe('TaxonomicFilter', () => {taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],})+ await userEvent.click(await screen.findByTestId('taxonomic-tab-events'))+await waitFor(() => {expect(screen.getByTestId('prop-filter-events-0')).toBeInTheDocument()})@@ -795,14 +772,39 @@ describe('TaxonomicFilter', () => {interact: async () => {await userEvent.type(screen.getByTestId('taxonomic-filter-searchfield'), 'event')},- expected: { hadSelection: false },+ expected: { hadSelection: false, categoryRailDocked: true },},{name: 'fires when the user selected an item before closing',interact: async () => {await userEvent.click(screen.getByTestId('prop-filter-events-0'))},- expected: { hadSelection: true },+ expected: { hadSelection: true, categoryRailDocked: true },+ },+ {+ name: 'fires with an undocked category rail',+ interact: async () => {+ taxonomicFilterCategoryLayoutLogic.actions.setCategoryRailPinned(false)+ await userEvent.type(screen.getByTestId('taxonomic-filter-searchfield'), 'event')+ },+ expected: { hadSelection: false, categoryRailDocked: false },+ },+ {+ name: 'fires after the user docks the category rail',+ interact: async () => {+ taxonomicFilterCategoryLayoutLogic.actions.setCategoryRailPinned(false)+ await userEvent.click(screen.getByTestId('taxonomic-category-dropdown-trigger-pill'))+ await userEvent.click(screen.getByText('Dock categories'))+ },+ expected: { hadSelection: false, categoryRailDocked: true },+ },+ {+ name: 'fires after the user opens the category menu',+ interact: async () => {+ taxonomicFilterCategoryLayoutLogic.actions.setCategoryRailPinned(false)+ await userEvent.click(screen.getByTestId('taxonomic-category-dropdown-trigger-pill'))+ },+ expected: { hadSelection: false, categoryRailDocked: false },},])('$name', async ({ interact, expected }) => {const captureSpy = jest.spyOn(posthog, 'capture')@@ -891,53 +893,6 @@ describe('TaxonomicFilter', () => {})expect(onChangeMock.mock.calls[0][1]).toBe('event1')})-- it('tab key switches to the next category tab', async () => {- renderFilter({- taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],- })-- await waitFor(() => {- expect(screen.getByTestId('prop-filter-events-0')).toBeInTheDocument()- })-- const searchInput = screen.getByTestId('taxonomic-filter-searchfield')- await userEvent.click(searchInput)-- await userEvent.keyboard('{Tab}')-- await waitFor(() => {- expectActiveTab('taxonomic-tab-actions', 'taxonomic-tab-events')- expect(screen.getByTestId('prop-filter-actions-0')).toBeInTheDocument()- })- })-- it('shift+tab switches to the previous category tab', async () => {- renderFilter({- taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],- })-- await waitFor(() => {- expect(screen.getByTestId('prop-filter-events-0')).toBeInTheDocument()- })-- const searchInput = screen.getByTestId('taxonomic-filter-searchfield')- await userEvent.click(searchInput)-- // Tab to actions, then shift+tab back to events- await userEvent.keyboard('{Tab}')-- await waitFor(() => {- expectActiveTab('taxonomic-tab-actions')- })-- await userEvent.keyboard('{Shift>}{Tab}{/Shift}')-- await waitFor(() => {- expectActiveTab('taxonomic-tab-events', 'taxonomic-tab-actions')- expect(screen.getByTestId('prop-filter-events-0')).toBeInTheDocument()- })- })})describe('multiple group types', () => {@@ -946,6 +901,8 @@ describe('TaxonomicFilter', () => {taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.PersonProperties],})+ await userEvent.click(await screen.findByTestId('taxonomic-tab-events'))+await waitFor(() => {expect(screen.getByTestId('prop-filter-events-0')).toBeInTheDocument()})@@ -996,6 +953,8 @@ describe('TaxonomicFilter', () => {taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],})+ await userEvent.click(await screen.findByTestId('taxonomic-tab-events'))+await waitFor(() => {expect(screen.getByTestId('prop-filter-events-0')).toBeInTheDocument()})@@ -1085,17 +1044,6 @@ describe('TaxonomicFilter', () => {}).not.toThrow()})- it('renders with a pre-selected groupType', async () => {- renderFilter({- taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],- groupType: TaxonomicFilterGroupType.Actions,- })-- await waitFor(() => {- expect(screen.getByTestId('prop-filter-actions-0')).toBeInTheDocument()- })- })-it('renders correctly when search matches no items', async () => {renderFilter()@@ -1456,32 +1404,8 @@ describe('TaxonomicFilter', () => {})})- it('reopens on the selected category when no Suggested-filters surface is present (control)', async () => {- // Guards the activeTab fallback: hosts without a Suggested filters ("All") surface- // (control variant, or any picker that doesn't inject it) must still reopen on the- // selected item's own category rather than an absent All tab.- renderFilter({- groupType: TaxonomicFilterGroupType.Events,- value: '$pageview',- taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],- })-- await waitFor(() => expect(screen.getByTestId('taxonomic-tab-events')).toBeInTheDocument())- expectActiveTab('taxonomic-tab-events', 'taxonomic-tab-actions')- })-- // Spec for the insight series picker in the pill variant: searching a term that matches- // pageview URLs should make ONE "url contains <query>" shortcut the first row of the- // aggregated Suggested filters ("All") tab — ahead of raw URL/event rows. Fails today- // because the series (PageviewEvents) group isn't collapsed and the shortcut never leads.- describe('series picker: pageview url-contains shortcut leads (pill variant)', () => {- let unmountFeatureFlagLogic: (() => void) | null = null-+ describe('series picker: pageview url-contains shortcut leads', () => {beforeEach(() => {- unmountFeatureFlagLogic = featureFlagLogic.mount()- featureFlagLogic.actions.setFeatureFlags([FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN], {- [FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]: 'pill',- })useMocks({get: {'/api/projects/:team/event_definitions': mockGetEventDefinitions,@@ -1494,12 +1418,6 @@ describe('TaxonomicFilter', () => {})})- afterEach(() => {- featureFlagLogic.actions.setFeatureFlags([], {})- unmountFeatureFlagLogic?.()- unmountFeatureFlagLogic = null- })-it('reopens on the Data warehouse tab (its own picker), not All, for a data-warehouse selection', async () => {renderFilter({groupType: TaxonomicFilterGroupType.DataWarehouse,@@ -1530,8 +1448,6 @@ describe('TaxonomicFilter', () => {],})- // In the pill variant the active category shows in the dropdown trigger; reopening- // on an existing event selection should read "All", not "Events".const trigger = await screen.findByTestId('taxonomic-category-dropdown-trigger-pill')// Wait for the dropdown trigger to paint its active-category label before asserting.await waitFor(() => expect(trigger.textContent || '').toMatch(/All|Events|Suggestions/))@@ -1560,130 +1476,62 @@ describe('TaxonomicFilter', () => {})})- describe('category dropdown A/B test', () => {- let unmountFeatureFlagLogic: (() => void) | null = null-+ describe('category navigation', () => {beforeEach(() => {- unmountFeatureFlagLogic = featureFlagLogic.mount()- })-- afterEach(() => {- featureFlagLogic.actions.setFeatureFlags([], {})- unmountFeatureFlagLogic?.()- unmountFeatureFlagLogic = null+ taxonomicFilterCategoryLayoutLogic.actions.setCategoryRailPinned(false)})- function setVariant(variant: string): void {- featureFlagLogic.actions.setFeatureFlags([FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN], {- [FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]: variant,- })- }-- it('control variant: renders the categories column and no in-input affordance', async () => {- setVariant('control')+ it('shows the All category in the dropdown', async () => {renderFilter({- taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],+ taxonomicGroupTypes: [+ TaxonomicFilterGroupType.SuggestedFilters,+ TaxonomicFilterGroupType.Events,+ TaxonomicFilterGroupType.Actions,+ ],})- await waitFor(() => {- expect(screen.getByText('Categories')).toBeInTheDocument()- })+ await userEvent.click(await screen.findByTestId('taxonomic-category-dropdown-trigger-pill'))- expect(screen.queryByTestId(/taxonomic-category-dropdown-trigger-/)).not.toBeInTheDocument()+ expect(await screen.findByTestId('taxonomic-category-dropdown-item-suggested_filters')).toHaveTextContent(+ 'All'+ )})- it('pill variant with hideSearchInput: does not render the categories column or an in-filter dropdown; the host is expected to render CategoryDropdown inside its own input', async () => {- setVariant('pill')+ it('keeps category controls out of an embedded filter without a search input', async () => {renderFilter({taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],hideSearchInput: true,})await screen.findAllByText('All')- expect(screen.queryByTestId('prop-filter-events-0')).not.toBeInTheDocument()-expect(screen.queryByText('Categories')).not.toBeInTheDocument()- expect(screen.queryByTestId(/taxonomic-category-dropdown-trigger-/)).not.toBeInTheDocument()+ expect(screen.queryByTestId('taxonomic-category-dropdown-trigger-pill')).not.toBeInTheDocument()})- it('control variant: default suggested-filters label is "Suggestions"', async () => {- setVariant('control')+ it('pins categories in a rail and restores the pill when unpinned', async () => {renderFilter({- // Two substantive groups so "All" survives (a single substantive group drops it)- taxonomicGroupTypes: [- TaxonomicFilterGroupType.SuggestedFilters,- TaxonomicFilterGroupType.Events,- TaxonomicFilterGroupType.Actions,- ],- })-- await waitFor(() => {- expect(screen.getByTestId('taxonomic-tab-suggested_filters')).toHaveTextContent('Suggestions')- })- })-- it('pill variant: default suggested-filters label is "All" (seen in the dropdown items)', async () => {- setVariant('pill')- renderFilter({- // Two substantive groups so "All" survives (a single substantive group drops it)- taxonomicGroupTypes: [- TaxonomicFilterGroupType.SuggestedFilters,- TaxonomicFilterGroupType.Events,- TaxonomicFilterGroupType.Actions,- ],- })-- await waitFor(() => {- expect(screen.getByTestId('taxonomic-category-dropdown-trigger-pill')).toBeInTheDocument()+ taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],})- await userEvent.click(screen.getByTestId('taxonomic-category-dropdown-trigger-pill'))+ await userEvent.click(await screen.findByTestId('taxonomic-category-dropdown-trigger-pill'))+ await userEvent.click(await screen.findByTestId('taxonomic-category-rail-toggle'))- const item = await screen.findByTestId('taxonomic-category-dropdown-item-suggested_filters')- expect(item).toHaveTextContent('All')- })+ expect(await screen.findByText('Categories')).toBeInTheDocument()+ expect(screen.getByTestId('taxonomic-category-dropdown-trigger-pill')).toHaveClass('hidden')- it('pill variant: hides the categories column and renders the in-input affordance', async () => {- setVariant('pill')- renderFilter({- taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],- })+ await userEvent.click(screen.getByTestId('taxonomic-category-rail-unpin'))await waitFor(() => {- expect(screen.getByTestId('taxonomic-category-dropdown-trigger-pill')).toBeInTheDocument()+ expect(screen.getByTestId('taxonomic-category-dropdown-trigger-pill')).not.toHaveClass('hidden')})-- expect(screen.queryByText('Categories')).not.toBeInTheDocument()- expect(screen.getByTestId('taxonomic-filter-searchfield').closest('.LemonInput')).toHaveClass(- 'TaxonomicFilter__search-input--with-category'- )- expect(screen.getByTestId('taxonomic-category-dropdown-trigger-pill')).toHaveClass(- 'TaxonomicFilter__category-dropdown',- 'LemonButton--tertiary',- 'LemonButton--truncate'- )-- await userEvent.type(screen.getByTestId('taxonomic-filter-searchfield'), 'x')- const inputButtons = screen- .getByTestId('taxonomic-filter-searchfield')- .closest('.LemonInput')- ?.querySelectorAll('button')- expect(inputButtons?.item(inputButtons.length - 1)).toBe(- screen.getByTestId('taxonomic-category-dropdown-trigger-pill')- )})- it('pill variant: opening the dropdown and picking a category switches the visible results', async () => {- setVariant('pill')+ it('switches the visible results when a category is selected', async () => {renderFilter({taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],})- await screen.findByTestId('taxonomic-category-dropdown-trigger-pill')- expect(screen.queryByTestId('prop-filter-events-0')).not.toBeInTheDocument()-- await userEvent.click(screen.getByTestId('taxonomic-category-dropdown-trigger-pill'))-+ await userEvent.click(await screen.findByTestId('taxonomic-category-dropdown-trigger-pill'))await userEvent.click(await screen.findByTestId('taxonomic-category-dropdown-item-actions'))await waitFor(() => {@@ -1691,17 +1539,12 @@ describe('TaxonomicFilter', () => {})})- it('pill variant: pressing Tab in the search input does not switch category', async () => {- setVariant('pill')+ it('does not switch categories when Tab moves focus from the search input', async () => {renderFilter({taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],})- await screen.findByTestId('taxonomic-category-dropdown-trigger-pill')-- // Pill auto-injects the "All" (SuggestedFilters) tab as the default for a- // multi-group picker, so that's the category showing before and after Tab.- const trigger = screen.getByTestId('taxonomic-category-dropdown-trigger-pill')+ const trigger = await screen.findByTestId('taxonomic-category-dropdown-trigger-pill')expect(trigger).toHaveAttribute('aria-label', expect.stringContaining('All'))const input = screen.getByTestId('taxonomic-filter-searchfield') as HTMLInputElementdiff --git a/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.tsx b/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.tsxindex b9412c98d199..d7fb26fe6b91 100644--- a/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilter.tsx@@ -7,17 +7,13 @@ import { forwardRef, useEffect, useId, useRef, useState } from 'react'import { Link } from '@posthog/lemon-ui'import {- CategoryDropdownVariant,- resolveCategoryDropdownVariant,TaxonomicFilterGroupType,TaxonomicFilterLogicProps,TaxonomicFilterProps,} from 'lib/components/TaxonomicFilter/types'-import { FEATURE_FLAGS } from 'lib/constants'import { Icon123 } from 'lib/lemon-ui/icons'import { LemonInput, LemonInputPropsText } from 'lib/lemon-ui/LemonInput/LemonInput'import { Tooltip } from 'lib/lemon-ui/Tooltip'-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'import { urls } from 'scenes/urls'import { CategoryDropdown } from './CategoryDropdown'@@ -68,12 +64,7 @@ export function TaxonomicFilter({const searchInputRef = useRef<HTMLInputElement | null>(null)const focusInput = (): void => searchInputRef.current?.focus()- const { featureFlags } = useValues(featureFlagLogic)- const categoryDropdownVariant = resolveCategoryDropdownVariant(- featureFlags[FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]- )- const resolvedSuggestedFiltersLabel =- suggestedFiltersLabel ?? (categoryDropdownVariant === 'control' ? 'Suggestions' : 'All')+ const resolvedSuggestedFiltersLabel = suggestedFiltersLabel ?? 'All'const taxonomicFilterLogicProps: TaxonomicFilterLogicProps = {taxonomicFilterLogicKey,@@ -144,6 +135,7 @@ export function TaxonomicFilter({ref={taxonomicFilterRef}className={clsx('taxonomic-filter',+ '@container',taxonomicGroupTypes.length === 1 && 'one-taxonomic-tab',!width && 'force-minimum-width')}@@ -157,7 +149,6 @@ export function TaxonomicFilter({<TaxonomicFilterSearchInputsearchInputRef={searchInputRef}onClose={onClose}- categoryDropdownVariant={categoryDropdownVariant}eventName={eventNames?.[0]}focusInput={focusInput}/>@@ -169,7 +160,6 @@ export function TaxonomicFilter({taxonomicFilterLogicProps={taxonomicFilterLogicProps}popupAnchorElement={taxonomicFilterRef.current}definitionPopoverRenderer={definitionPopoverRenderer}- categoryDropdownVariant={categoryDropdownVariant}/>)}</div>@@ -182,7 +172,6 @@ export const TaxonomicFilterSearchInput = forwardRef<{searchInputRef: React.Ref<HTMLInputElement> | nullonClose: TaxonomicFilterProps['onClose']- categoryDropdownVariant?: CategoryDropdownVarianteventName?: stringfocusInput?: () => void} & Pick<@@ -190,18 +179,7 @@ export const TaxonomicFilterSearchInput = forwardRef<'onClick' | 'size' | 'prefix' | 'fullWidth' | 'onChange' | 'autoFocus' | 'placeholder'>>(function UniversalSearchInput(- {- searchInputRef,- onClose,- onChange,- autoFocus = true,- placeholder,- categoryDropdownVariant = 'control',- eventName,- focusInput,- prefix,- ...props- },+ { searchInputRef, onClose, onChange, autoFocus = true, placeholder, eventName, focusInput, prefix, ...props },ref): JSX.Element {const { searchQuery, searchPlaceholder, showNumericalPropsOnly } = useValues(taxonomicFilterLogic)@@ -211,8 +189,6 @@ export const TaxonomicFilterSearchInput = forwardRef<recordPaste,moveUp,moveDown,- tabLeft,- tabRight,selectSelected,} = useActions(taxonomicFilterLogic)@@ -226,26 +202,16 @@ export const TaxonomicFilterSearchInput = forwardRef<onChange?.(query)}- const categoriesAreInDropdown = categoryDropdownVariant !== 'control'- const categoryDropdown = categoriesAreInDropdown ? (- <CategoryDropdown- variant={categoryDropdownVariant}- eventName={eventName}- onAfterChange={focusInput}- joinedToInput- />- ) : null+ const categoryDropdown = <CategoryDropdown eventName={eventName} onAfterChange={focusInput} joinedToInput />return (<LemonInput{...props}ref={ref}- className={clsx({- 'TaxonomicFilter__search-input--with-category': categoriesAreInDropdown,- })}+ className="TaxonomicFilter__search-input--with-category @container"data-attr="taxonomic-filter-searchfield"type="search"- suffixAfterClear={categoriesAreInDropdown}+ suffixAfterClearfullWidthplaceholder={placeholder ?? `Search ${searchPlaceholder}`}value={searchQuery}@@ -290,11 +256,7 @@ export const TaxonomicFilterSearchInput = forwardRef<moveDown()breakcase 'Tab':- if (categoriesAreInDropdown) {- shouldPreventDefault = false- break- }- e.shiftKey ? tabLeft() : tabRight()+ shouldPreventDefault = falsebreakcase 'Enter':selectSelected()diff --git a/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilterGallery.stories.tsx b/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilterGallery.stories.tsxindex 8e54c3c47f1b..84c81d1ed858 100644--- a/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilterGallery.stories.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilterGallery.stories.tsx@@ -362,14 +362,13 @@ function variantKey(usage: Usage): string {const STORY_TITLE: Record<string, string> = {'rebuild-menu': 'rebuild menu on (only the wrapper entry points change)',- 'legacy-pill': 'legacy · category dropdown = pill',- 'legacy-control': 'legacy · category dropdown = control',+ 'classic-picker': 'classic picker with category dropdown',}/*** The surface a given variant actually renders on a given story. The rebuild* flag only swaps the two wrapper entry points, so a raw `TaxonomicFilter`- * stays on the legacy UI even on the rebuild story — this label makes that+ * stays on the classic picker even on the rebuild story. This label makes that* explicit per cell instead of letting the story title imply otherwise.*/function surfaceFor(key: string, story: string): string {@@ -379,7 +378,7 @@ function surfaceFor(key: string, story: string): string {if (getsRebuild && story === 'rebuild-menu') {return 'rebuild menu'}- return story === 'legacy-pill' ? 'legacy · pill' : 'legacy · control'+ return 'classic picker'}function UsagePreview({ usage, storyKey }: { usage: Usage; storyKey: string }): JSX.Element {@@ -501,13 +500,12 @@ function Gallery({ variant }: { variant: string }): JSX.Element {<div className="p-4"><h1 className="text-xl font-bold mb-2">Taxonomic filter gallery — {STORY_TITLE[variant] ?? variant}</h1><p className="text-sm text-secondary mb-4 max-w-3xl">- The taxonomic-filter family collapses to a handful of unique presentations; most call sites just pass a+ The taxonomic-filter family collapses to a handful of unique presentations. Most call sites just pass adifferent <code>taxonomicGroupTypes</code> to the same one. Each cell renders one variant and lists the- call sites that use it (with the props that differ), so the duplication — and where it could be- simplified — is visible. The badge on each cell is the surface it actually renders: the rebuild flag- only swaps the two wrapper entry points, so raw <code>TaxonomicFilter</code> stays on the legacy UI even- on the rebuild story. Raw <code>TaxonomicFilter</code> has no resting state, so it reveals on "Show- picker".+ call sites that use it with the props that differ. The badge on each cell is the surface it actually+ renders. The rebuild flag only swaps the two wrapper entry points, so raw <code>TaxonomicFilter</code>{' '}+ stays on the classic picker even on the rebuild story. Raw <code>TaxonomicFilter</code> has no resting+ state, so it reveals on "Show picker".</p><div className="grid grid-cols-1 xl:grid-cols-2 border-l border-t">{VARIANTS.map((v) => {@@ -579,12 +577,6 @@ export const RebuildMenu: Story = {parameters: { featureFlags: { [FEATURE_FLAGS.TAXONOMIC_FILTER_MENU_REBUILD]: true } },}-export const LegacyPill: Story = {- render: () => <Gallery variant="legacy-pill" />,- parameters: { featureFlags: { [FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]: 'pill' } },-}--export const LegacyControl: Story = {- render: () => <Gallery variant="legacy-control" />,- parameters: { featureFlags: { [FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]: 'control' } },+export const ClassicPicker: Story = {+ render: () => <Gallery variant="classic-picker" />,}diff --git a/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilterKeyOnly.test.tsx b/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilterKeyOnly.test.tsxindex c16e990b06fc..6ee5dba9e5fc 100644--- a/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilterKeyOnly.test.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilterKeyOnly.test.tsx@@ -79,6 +79,11 @@ describe('TaxonomicFilter selectingKeyOnly mode', () => {})}+ async function selectRecentCategory(): Promise<void> {+ await userEvent.click(await screen.findByTestId('taxonomic-category-dropdown-trigger-pill'))+ await userEvent.click(await screen.findByTestId('taxonomic-category-dropdown-item-recent_filters'))+ }+describe('recording on selection', () => {it('records an EventProperty selection to recents when selectingKeyOnly is set', async () => {renderFilter({ selectingKeyOnly: true })@@ -117,8 +122,7 @@ describe('TaxonomicFilter selectingKeyOnly mode', () => {renderFilter({ selectingKeyOnly: true, onChange })- await waitForTestId('taxonomic-tab-recent_filters')- await userEvent.click(screen.getByTestId('taxonomic-tab-recent_filters'))+ await selectRecentCategory()await waitFor(() => {expect(screen.getByTestId('prop-filter-recent_filters-0')).toBeInTheDocument()@@ -158,9 +162,7 @@ describe('TaxonomicFilter selectingKeyOnly mode', () => {renderFilter({ selectingKeyOnly: true })- await waitForTestId('taxonomic-tab-recent_filters')-- await userEvent.click(screen.getByTestId('taxonomic-tab-recent_filters'))+ await selectRecentCategory()await waitFor(() => {expect(screen.getByTestId('prop-filter-recent_filters-0')).toBeInTheDocument()@@ -175,8 +177,7 @@ describe('TaxonomicFilter selectingKeyOnly mode', () => {renderFilter({ selectingKeyOnly: true })- await waitForTestId('taxonomic-tab-recent_filters')- await userEvent.click(screen.getByTestId('taxonomic-tab-recent_filters'))+ await selectRecentCategory()await waitFor(() => {expect(screen.getByTestId('prop-filter-recent_filters-0')).toBeInTheDocument()@@ -192,8 +193,7 @@ describe('TaxonomicFilter selectingKeyOnly mode', () => {renderFilter()- await waitForTestId('taxonomic-tab-recent_filters')- await userEvent.click(screen.getByTestId('taxonomic-tab-recent_filters'))+ await selectRecentCategory()await waitFor(() => {expect(screen.getByTestId('prop-filter-recent_filters-0')).toBeInTheDocument()@@ -210,8 +210,7 @@ describe('TaxonomicFilter selectingKeyOnly mode', () => {renderFilter({ onChange })- await waitForTestId('taxonomic-tab-recent_filters')- await userEvent.click(screen.getByTestId('taxonomic-tab-recent_filters'))+ await selectRecentCategory()await waitFor(() => {expect(screen.getByTestId('prop-filter-recent_filters-1')).toBeInTheDocument()@@ -232,8 +231,7 @@ describe('TaxonomicFilter selectingKeyOnly mode', () => {renderFilter({ selectingKeyOnly: true })- await waitForTestId('taxonomic-tab-recent_filters')- await userEvent.click(screen.getByTestId('taxonomic-tab-recent_filters'))+ await selectRecentCategory()await waitFor(() => {expect(screen.getByTestId('prop-filter-recent_filters-0')).toBeInTheDocument()diff --git a/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilterPinning.test.tsx b/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilterPinning.test.tsxindex ba772759a21d..42671550dbfc 100644--- a/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilterPinning.test.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/TaxonomicFilterPinning.test.tsx@@ -62,6 +62,11 @@ describe('TaxonomicFilter pinning', () => {)}+ async function selectCategory(groupType: TaxonomicFilterGroupType): Promise<void> {+ await userEvent.click(await screen.findByTestId('taxonomic-category-dropdown-trigger-pill'))+ await userEvent.click(await screen.findByTestId(`taxonomic-category-dropdown-item-${groupType}`))+ }+it('shows a Pinned tab when there are pinned items', async () => {const logic = taxonomicFilterPinnedPropertiesLogic.build()logic.mount()@@ -71,9 +76,7 @@ describe('TaxonomicFilter pinning', () => {renderFilter()- await waitFor(() => {- expect(screen.getByTestId('taxonomic-tab-pinned_filters')).toBeInTheDocument()- })+ await selectCategory(TaxonomicFilterGroupType.PinnedFilters)logic.unmount()})@@ -87,11 +90,7 @@ describe('TaxonomicFilter pinning', () => {renderFilter()- await waitFor(() => {- expect(screen.getByTestId('taxonomic-tab-pinned_filters')).toBeInTheDocument()- })-- await userEvent.click(screen.getByTestId('taxonomic-tab-pinned_filters'))+ await selectCategory(TaxonomicFilterGroupType.PinnedFilters)await waitFor(() => {expect(screen.getByTestId('prop-filter-pinned_filters-0')).toBeInTheDocument()@@ -100,16 +99,12 @@ describe('TaxonomicFilter pinning', () => {logic.unmount()})- it('shows Pinned tab with zero count when no items are pinned', async () => {+ it('shows the Pinned category when no items are pinned', async () => {renderFilter()- await waitFor(() => {- expect(screen.getByTestId('taxonomic-tab-event_properties')).toBeInTheDocument()- })+ await selectCategory(TaxonomicFilterGroupType.PinnedFilters)- const pinnedTab = screen.getByTestId('taxonomic-tab-pinned_filters')- expect(pinnedTab).toBeInTheDocument()- expect(pinnedTab.textContent).toContain('0')+ expect(screen.getByTestId('taxonomic-category-dropdown-trigger-pill')).toHaveTextContent('Pinned')})it('shows pin button in definition popover on hover', async () => {@@ -161,11 +156,7 @@ describe('TaxonomicFilter pinning', () => {popoverEnabled: true,})- await waitFor(() => {- expect(screen.getByTestId('taxonomic-tab-pinned_filters')).toBeInTheDocument()- })-- await userEvent.click(screen.getByTestId('taxonomic-tab-pinned_filters'))+ await selectCategory(TaxonomicFilterGroupType.PinnedFilters)const pinnedRow = await screen.findByTestId('prop-filter-pinned_filters-0')diff --git a/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts b/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.tsindex 4e0494366b65..dbb2f3ea42fa 100644--- a/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts+++ b/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts@@ -64,7 +64,6 @@ import {filterPinnedForContext,filterRecentsForContext,} from 'lib/components/TaxonomicFilter/utils/suggestedContextFilters'-import { FEATURE_FLAGS } from 'lib/constants'import { featureFlagLogic } from 'lib/logic/featureFlagLogic'import { createFuse } from 'lib/utils/fuseSearch'import { mapGroupQueryResponse } from 'lib/utils/groups'@@ -2286,9 +2285,7 @@ export const infiniteListLogic = kea<infiniteListLogicType>([if (cache.lastEmptyResultDedupeKey !== dedupeKey) {cache.lastEmptyResultDedupeKey = dedupeKeyposthog.capture('taxonomic filter empty result', {- surface: legacyTaxonomicSurface(- posthog.getFeatureFlag(FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN)- ),+ surface: legacyTaxonomicSurface(),groupType: props.listGroupType,searchQuery: trimmedQuery,})@@ -2313,9 +2310,7 @@ export const infiniteListLogic = kea<infiniteListLogicType>([if (cache.lastFetchFailedDedupeKey !== dedupeKey) {cache.lastFetchFailedDedupeKey = dedupeKeyposthog.capture('taxonomic filter fetch failed', {- surface: legacyTaxonomicSurface(- posthog.getFeatureFlag(FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN)- ),+ surface: legacyTaxonomicSurface(),groupType: props.listGroupType,searchQuery: trimmedQuery,})diff --git a/frontend/src/lib/components/TaxonomicFilter/menu/Combobox.tsx b/frontend/src/lib/components/TaxonomicFilter/menu/Combobox.tsxindex 2a2231fbf04c..a96c3560c0c6 100644--- a/frontend/src/lib/components/TaxonomicFilter/menu/Combobox.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/menu/Combobox.tsx@@ -770,8 +770,7 @@ export function MenuFilterCombobox({// --- Telemetry parity ---------------------------------------------------// Emit the legacy `taxonomic filter *` contract so the rebuild is- // comparable to the control/pill variants by feature-flag value (PostHog- // auto-attaches the active flag to every event). The meta scopes+ // comparable to the classic picker. The meta scopes// (all/recent/pinned) have no single source group, so groupType is// undefined there — matching how legacy reports the active content tab.const telemetryGroupType = useMemo<TaxonomicFilterGroupType | undefined>(() => {diff --git a/frontend/src/lib/components/TaxonomicFilter/menu/TaxonomicFilterMenu.tsx b/frontend/src/lib/components/TaxonomicFilter/menu/TaxonomicFilterMenu.tsxindex f8dba66b75ee..c057b5fc0f83 100644--- a/frontend/src/lib/components/TaxonomicFilter/menu/TaxonomicFilterMenu.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/menu/TaxonomicFilterMenu.tsx@@ -306,14 +306,12 @@ export function TaxonomicFilterMenu({hadCommit: hadCommitRef.current,lastState: previous,})- // Legacy `taxonomic filter *` contract — emitted alongside the- // menu-specific events so the rebuild is comparable to the- // control/pill variants by feature-flag value.// Legacy's `groupType: activeTab` is omitted because the menu has no single active tab at close time.posthog.capture('taxonomic filter closed', {surface: TAXONOMIC_FILTER_SURFACE,dwellMs,hadSelection: hadCommitRef.current,+ categoryRailDocked: false,})lastMenuClosedAtMs = closedAtopenedAtRef.current = nulldiff --git a/frontend/src/lib/components/TaxonomicFilter/menu/types.ts b/frontend/src/lib/components/TaxonomicFilter/menu/types.tsindex 6b5c6d46bab3..caf776f5c1fc 100644--- a/frontend/src/lib/components/TaxonomicFilter/menu/types.ts+++ b/frontend/src/lib/components/TaxonomicFilter/menu/types.ts@@ -12,9 +12,6 @@ import {TaxonomicFilterValue,} from '../types'-/** Stamped on the legacy `taxonomic filter *` telemetry events so the A/B arms- * are distinguishable by an explicit property rather than a feature-flag join.- * Legacy emits `legacy-control` / `legacy-pill`. */export const TAXONOMIC_FILTER_SURFACE = 'rebuild-menu'/** A single selectable entry — what the picker commits when chosen. */diff --git a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterCategoryLayoutLogic.test.ts b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterCategoryLayoutLogic.test.tsnew file mode 100644index 000000000000..5a46eed16c3c--- /dev/null+++ b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterCategoryLayoutLogic.test.ts@@ -0,0 +1,33 @@+import { expectLogic } from 'kea-test-utils'+import posthog from 'posthog-js'++import { initKeaTests } from '~/test/init'++import { taxonomicFilterCategoryLayoutLogic } from './taxonomicFilterCategoryLayoutLogic'++jest.mock('posthog-js', () => ({+ __esModule: true,+ default: { capture: jest.fn() },+}))++describe('taxonomicFilterCategoryLayoutLogic', () => {+ beforeEach(() => {+ localStorage.clear()+ initKeaTests()+ })++ it('sets the category rail preference and captures its new value', () => {+ const logic = taxonomicFilterCategoryLayoutLogic.build()+ logic.mount()++ expectLogic(logic, () => {+ logic.actions.setCategoryRailPinned(true)+ })+ .toDispatchActions(['setCategoryRailPinned'])+ .toMatchValues({ categoryRailPinned: true })++ expect(posthog.capture).toHaveBeenCalledWith('taxonomic filter category rail toggled', { docked: true })++ logic.unmount()+ })+})diff --git a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterCategoryLayoutLogic.ts b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterCategoryLayoutLogic.tsnew file mode 100644index 000000000000..7a776cfe8e10--- /dev/null+++ b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterCategoryLayoutLogic.ts@@ -0,0 +1,48 @@+import { MakeLogicType, actions, kea, listeners, path, reducers } from 'kea'+import posthog from 'posthog-js'++import { getCurrentTeamIdOrNone, getCurrentUserIdOrNone } from 'lib/utils/getAppContext'++const DEFAULT_CATEGORY_RAIL_DOCKED = false as boolean+const categoryRailPersistenceConfig = {+ persist: true,+ prefix: `${getCurrentUserIdOrNone() ?? 'anonymous'}__${getCurrentTeamIdOrNone() ?? 'unknown'}__`,+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface taxonomicFilterCategoryLayoutLogicValues {+ categoryRailPinned: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface taxonomicFilterCategoryLayoutLogicActions {+ setCategoryRailPinned: (categoryRailPinned: boolean) => {+ categoryRailPinned: boolean+ }+}++export type taxonomicFilterCategoryLayoutLogicType = MakeLogicType<+ taxonomicFilterCategoryLayoutLogicValues,+ taxonomicFilterCategoryLayoutLogicActions+>++export const taxonomicFilterCategoryLayoutLogic = kea<taxonomicFilterCategoryLayoutLogicType>([+ path(['lib', 'components', 'TaxonomicFilter', 'taxonomicFilterCategoryLayoutLogic']),+ actions({+ setCategoryRailPinned: (categoryRailPinned: boolean) => ({ categoryRailPinned }),+ }),+ reducers({+ categoryRailPinned: [+ DEFAULT_CATEGORY_RAIL_DOCKED,+ categoryRailPersistenceConfig,+ {+ setCategoryRailPinned: (_, { categoryRailPinned }) => categoryRailPinned,+ },+ ],+ }),+ listeners(() => ({+ setCategoryRailPinned: ({ categoryRailPinned }) => {+ posthog.capture('taxonomic filter category rail toggled', { docked: categoryRailPinned })+ },+ })),+])diff --git a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.test.ts b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.test.tsindex 582aff2345b5..2c1c945b37f1 100644--- a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.test.ts+++ b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.test.ts@@ -170,6 +170,7 @@ describe('taxonomicFilterLogic', () => {// load the initial resultsawait waitForRemoteResults()+ logic.actions.setActiveTab(TaxonomicFilterGroupType.Events)await waitForRemoteResults(() => logic.actions.setSearchQuery('event'))await expectLogic(logic).toMatchValues({@@ -226,6 +227,7 @@ describe('taxonomicFilterLogic', () => {...logic.props,listGroupType: TaxonomicFilterGroupType.Events,})+ logic.actions.setActiveTab(TaxonomicFilterGroupType.Events)await expectLogic(eventsListLogic, () => logic.actions.setSearchQuery('event')).toDispatchActions(['loadRemoteItemsSuccess',@@ -270,6 +272,7 @@ describe('taxonomicFilterLogic', () => {it('tabs skip groups with no results', async () => {await expectLogic(logic).toDispatchActions(['infiniteListResultsReceived']).delay(1).clearHistory()+ logic.actions.setActiveTab(TaxonomicFilterGroupType.Events)// move right from Events, skipping Actions (0 results)await expectLogic(logic, () => logic.actions.tabRight()).toMatchValues({@@ -995,17 +998,10 @@ describe('taxonomicFilterLogic', () => {})})- describe('SuggestedFilters presence by variant', () => {- afterEach(() => {- featureFlagLogic.actions.setFeatureFlags([], {- [FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]: 'control',- })- })-+ describe('SuggestedFilters presence', () => {it.each([{- description: 'control: includes SuggestedFilters when explicitly listed in a multi-group picker',- variant: 'control',+ description: 'keeps SuggestedFilters when explicitly listed in a multi-group picker',groupTypes: [TaxonomicFilterGroupType.SuggestedFilters,TaxonomicFilterGroupType.Events,@@ -1015,47 +1011,26 @@ describe('taxonomicFilterLogic', () => {expectDefault: true,},{- description: 'control: does not auto-inject SuggestedFilters for a multi-group picker',- variant: 'control',- groupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],- expectPresent: false,- expectDefault: false,- },- {- description: 'pill: auto-injects SuggestedFilters as the default for a multi-group picker',- variant: 'pill',+ description: 'adds SuggestedFilters as the default for a multi-group picker',groupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],expectPresent: true,expectDefault: true,},{- description: 'pill: does not auto-inject SuggestedFilters for a single substantive group',- variant: 'pill',+ description: 'does not add SuggestedFilters for a single substantive group',groupTypes: [TaxonomicFilterGroupType.Events],expectPresent: false,expectDefault: false,},{- description: 'control: strips explicitly-listed SuggestedFilters for a single substantive group',- variant: 'control',- groupTypes: [TaxonomicFilterGroupType.SuggestedFilters, TaxonomicFilterGroupType.Events],- expectPresent: false,- expectDefault: false,- },- {- description: 'pill: strips explicitly-listed SuggestedFilters for a single substantive group',- variant: 'pill',+ description: 'strips explicitly listed SuggestedFilters for a single substantive group',groupTypes: [TaxonomicFilterGroupType.SuggestedFilters, TaxonomicFilterGroupType.Events],expectPresent: false,expectDefault: false,},- ])('$description', ({ variant, groupTypes, expectPresent, expectDefault }) => {- featureFlagLogic.actions.setFeatureFlags([], {- [FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]: variant,- })-+ ])('$description', ({ groupTypes, expectPresent, expectDefault }) => {const testLogicProps: TaxonomicFilterLogicProps = {- taxonomicFilterLogicKey: `testVariant-${variant}-${groupTypes.join('-')}`,+ taxonomicFilterLogicKey: `testSuggested-${groupTypes.join('-')}`,taxonomicGroupTypes: groupTypes,}const testLogic = taxonomicFilterLogic(testLogicProps)@@ -1072,42 +1047,6 @@ describe('taxonomicFilterLogic', () => {testLogic.unmount()})-- it('pill flag resolving after mount still makes SuggestedFilters the default tab', () => {- const testLogic = taxonomicFilterLogic({- taxonomicFilterLogicKey: 'testLateFlagDefault',- taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],- })- testLogic.mount()-- expect(testLogic.values.activeTab).toBe(TaxonomicFilterGroupType.Events)-- featureFlagLogic.actions.setFeatureFlags([], {- [FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]: 'pill',- })-- expect(testLogic.values.taxonomicGroupTypes).toContain(TaxonomicFilterGroupType.SuggestedFilters)- expect(testLogic.values.activeTab).toBe(TaxonomicFilterGroupType.SuggestedFilters)-- testLogic.unmount()- })-- it('an explicit tab choice made before the pill flag resolves is kept', () => {- const testLogic = taxonomicFilterLogic({- taxonomicFilterLogicKey: 'testLateFlagExplicit',- taxonomicGroupTypes: [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions],- })- testLogic.mount()-- testLogic.actions.setActiveTab(TaxonomicFilterGroupType.Actions)- featureFlagLogic.actions.setFeatureFlags([], {- [FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]: 'pill',- })-- expect(testLogic.values.activeTab).toBe(TaxonomicFilterGroupType.Actions)-- testLogic.unmount()- })})describe('promoted groups are reordered', () => {@@ -1138,7 +1077,7 @@ describe('taxonomicFilterLogic', () => {],},{- description: 'promotes shortcut groups after auto-injected meta groups when no SuggestedFilters',+ description: 'promotes shortcut groups after the all and auto-injected meta groups',groupTypes: [TaxonomicFilterGroupType.Events,TaxonomicFilterGroupType.Actions,@@ -1147,6 +1086,7 @@ describe('taxonomicFilterLogic', () => {TaxonomicFilterGroupType.EmailAddresses,],expected: [+ TaxonomicFilterGroupType.SuggestedFilters,TaxonomicFilterGroupType.RecentFilters,TaxonomicFilterGroupType.PinnedFilters,TaxonomicFilterGroupType.PageviewUrls,@@ -1157,13 +1097,14 @@ describe('taxonomicFilterLogic', () => {],},{- description: 'auto-injects meta groups when no shortcut groups are present',+ description: 'adds all and auto-injected meta groups when no shortcut groups are present',groupTypes: [TaxonomicFilterGroupType.Events,TaxonomicFilterGroupType.Actions,TaxonomicFilterGroupType.EventProperties,],expected: [+ TaxonomicFilterGroupType.SuggestedFilters,TaxonomicFilterGroupType.RecentFilters,TaxonomicFilterGroupType.PinnedFilters,TaxonomicFilterGroupType.Events,diff --git a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.tsx b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.tsxindex 552cbfea58f6..121417beda97 100644--- a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.tsx@@ -31,6 +31,7 @@ import {recentTaxonomicFiltersLogic,stripRecentContext,} from 'lib/components/TaxonomicFilter/recentTaxonomicFiltersLogic'+import { taxonomicFilterCategoryLayoutLogic } from 'lib/components/TaxonomicFilter/taxonomicFilterCategoryLayoutLogic'import { hasPinnedContext } from 'lib/components/TaxonomicFilter/taxonomicFilterPinnedPropertiesLogic'import { legacyTaxonomicSurface } from 'lib/components/TaxonomicFilter/taxonomicFilterSurface'import {@@ -188,20 +189,10 @@ export function resolveAvailableGroupTypes(return groupTypes.filter((groupType) => !excluded.has(groupType) && availableGroupTypes.has(groupType))}-/** In the pill variant the SuggestedFilters ("All") tab is the default cross-group landing spot- * whenever there's more than one substantive group to aggregate. It stays opt-in for the control- * variant, so the control arm only shows it where a call site explicitly requests it. The rebuild- * path (useTaxonomicFilter.ts) injects unconditionally because it has no per-variant arm to protect.- *- * With one real group there's nothing for "All" to aggregate, so drop it (a call site may have- * prepended SuggestedFilters — see TaxonomicPropertyFilter). Recent/Pinned then follow the group- * instead of leading, and the group's own list floats recent/pinned items to the top (see- * infiniteListLogic `items`). */function resolveSuggestedFiltersGroup(groupTypes: TaxonomicFilterGroupType[],availableGroupTypes: Set<TaxonomicFilterGroupType>,- substantiveGroupCount: number,- isPillVariant: boolean+ substantiveGroupCount: number): TaxonomicFilterGroupType[] {if (substantiveGroupCount === 1) {const suggestedIdx = groupTypes.indexOf(TaxonomicFilterGroupType.SuggestedFilters)@@ -212,7 +203,6 @@ function resolveSuggestedFiltersGroup(}const shouldLeadWithSuggested =- isPillVariant &&substantiveGroupCount >= 2 &&availableGroupTypes.has(TaxonomicFilterGroupType.SuggestedFilters) &&!groupTypes.includes(TaxonomicFilterGroupType.SuggestedFilters)@@ -517,6 +507,7 @@ export interface taxonomicFilterLogicValues {currentProjectId: number | null // projectLogiceventMetadataPropertyDefinitions: PropertyDefinition[] // propertyDefinitionsModelpersonMetadataPropertyDefinitions: PropertyDefinition[] // propertyDefinitionsModel+ categoryRailPinned: boolean // taxonomicFilterCategoryLayoutLogiccurrentTeam: TeamPublicType | TeamType | null // teamLogiccurrentTeamId: number | null // teamLogicactiveTab: TaxonomicFilterGroupType@@ -748,8 +739,7 @@ export interface taxonomicFilterLogicMeta {taxonomicGroupTypes: (taxonomicGroupTypes: TaxonomicFilterGroupType[],taxonomicGroups: TaxonomicFilterGroup[],- eventNames: any,- featureFlags: FeatureFlagsSet+ eventNames: any) => TaxonomicFilterGroupType[]groupAnalyticsTaxonomicGroupNames: (groupTypes: Map<GroupTypeIndex, GroupType>,@@ -838,6 +828,8 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([['eventMetadataPropertyDefinitions', 'personMetadataPropertyDefinitions'],featureFlagLogic,['featureFlags'],+ taxonomicFilterCategoryLayoutLogic,+ ['categoryRailPinned'],primaryEventPropertiesModel,['primaryProperties'],],@@ -2173,12 +2165,11 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([new Set(taxonomicGroups.filter((g) => g.isMetaGroup).map((g) => g.type)),],taxonomicGroupTypes: [- (s, p) => [p.taxonomicGroupTypes, s.taxonomicGroups, s.eventNames, s.featureFlags],+ (s, p) => [p.taxonomicGroupTypes, s.taxonomicGroups, s.eventNames],(groupTypes: TaxonomicFilterGroupType[],taxonomicGroups: TaxonomicFilterGroup[],- eventNames,- featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet+ eventNames): TaxonomicFilterGroupType[] => {const availableGroupTypes = new Set(taxonomicGroups.map((group) => group.type))const resolvedGroupTypes: TaxonomicFilterGroupType[] =@@ -2186,16 +2177,10 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([const filtered = resolveAvailableGroupTypes(resolvedGroupTypes, availableGroupTypes)- const pillVariant = featureFlags[FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN] === 'pill'const substantiveGroupCount = filtered.filter((t) => !META_GROUP_TYPES.has(t)).lengthconst singleSubstantiveGroup = substantiveGroupCount === 1- const withSuggested = resolveSuggestedFiltersGroup(- filtered,- availableGroupTypes,- substantiveGroupCount,- pillVariant- )+ const withSuggested = resolveSuggestedFiltersGroup(filtered, availableGroupTypes, substantiveGroupCount)const withMetaGroups = injectAutoMetaGroups(withSuggested, availableGroupTypes, singleSubstantiveGroup)// With a single substantive group there's nothing to reorder above it, and promoting@@ -2522,10 +2507,11 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([// and inflates the abandonment metric (top sessions hit 100+ closes pre-gate).if (values.hadInteraction) {posthog.capture('taxonomic filter closed', {- surface: legacyTaxonomicSurface(values.featureFlags[FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]),+ surface: legacyTaxonomicSurface(),dwellMs: Date.now() - (cache.openedAt ?? Date.now()),hadSelection: !!cache.hadSelection,groupType: values.activeTab,+ categoryRailDocked: values.categoryRailPinned,})}}),@@ -2554,9 +2540,7 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([: undefinedposthog.capture('taxonomic filter item selected', {- surface: legacyTaxonomicSurface(- values.featureFlags[FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]- ),+ surface: legacyTaxonomicSurface(),groupType: values.activeTab,sourceGroupType,wasFromPinnedList,@@ -2713,9 +2697,7 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([const inputMode: 'pasted' | 'mixed' | 'typed' =pastedChars >= totalLength && pastedChars > 0 ? 'pasted' : pastedChars > 0 ? 'mixed' : 'typed'posthog.capture('taxonomic_filter_search_query', {- surface: legacyTaxonomicSurface(- values.featureFlags[FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]- ),+ surface: legacyTaxonomicSurface(),searchQuery,groupType: activeTaxonomicGroup?.type,inputMode,@@ -2746,9 +2728,7 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([results.searchQuery === values.searchQuery) {posthog.capture('taxonomic filter search latency', {- surface: legacyTaxonomicSurface(- values.featureFlags[FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]- ),+ surface: legacyTaxonomicSurface(),groupType,searchQuery: values.searchQuery,time_to_see_data_ms: results.loadDurationMs,diff --git a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterSurface.test.ts b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterSurface.test.tsindex c45f5f79faf1..60c501b2c842 100644--- a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterSurface.test.ts+++ b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterSurface.test.ts@@ -1,15 +1,7 @@import { legacyTaxonomicSurface } from './taxonomicFilterSurface'describe('legacyTaxonomicSurface', () => {- it.each([- ['pill', 'legacy-pill'],- ['control', 'legacy-control'],- [undefined, 'legacy-control'],- [true, 'legacy-control'],- // `posthog.getFeatureFlag` returns `false` (not undefined) for a loaded flag with no variant.- [false, 'legacy-control'],- ['', 'legacy-control'],- ])('maps category-dropdown variant %p to %p', (variant, expected) => {- expect(legacyTaxonomicSurface(variant as string | boolean | undefined)).toBe(expected)+ it('reports the pill surface', () => {+ expect(legacyTaxonomicSurface()).toBe('legacy-pill')})})diff --git a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterSurface.ts b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterSurface.tsindex 67e9a9d39db9..eb4683a02f0d 100644--- a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterSurface.ts+++ b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterSurface.ts@@ -1,9 +1,3 @@-/** The legacy TaxonomicFilter surface, derived from the category-dropdown A/B- * variant, stamped on the `taxonomic filter *` telemetry events so the arms are- * distinguishable by an explicit property rather than a feature-flag join. The- * rebuild menu emits `rebuild-menu` for the same purpose. */-export function legacyTaxonomicSurface(- categoryDropdownVariant: string | boolean | undefined-): 'legacy-control' | 'legacy-pill' {- return categoryDropdownVariant === 'pill' ? 'legacy-pill' : 'legacy-control'+export function legacyTaxonomicSurface(): 'legacy-pill' {+ return 'legacy-pill'}diff --git a/frontend/src/lib/components/TaxonomicFilter/types.ts b/frontend/src/lib/components/TaxonomicFilter/types.tsindex 454aa107dbec..aa1263cfb231 100644--- a/frontend/src/lib/components/TaxonomicFilter/types.ts+++ b/frontend/src/lib/components/TaxonomicFilter/types.ts@@ -436,15 +436,3 @@ export type TaxonomicDefinitionTypes =| DataWarehouseTableForInsight| MaxContextTaxonomicFilterOption| QuickFilterItem--export const CATEGORY_DROPDOWN_VARIANTS = ['control', 'pill'] as const--export type CategoryDropdownVariant = (typeof CATEGORY_DROPDOWN_VARIANTS)[number]--export function isCategoryDropdownVariant(value: unknown): value is CategoryDropdownVariant {- return typeof value === 'string' && (CATEGORY_DROPDOWN_VARIANTS as readonly string[]).includes(value)-}--export function resolveCategoryDropdownVariant(flagValue: string | boolean | undefined): CategoryDropdownVariant {- return isCategoryDropdownVariant(flagValue) ? flagValue : 'control'-}diff --git a/frontend/src/lib/components/UniversalFilters/UniversalFilters.component.test.tsx b/frontend/src/lib/components/UniversalFilters/UniversalFilters.component.test.tsxindex a5c63a6722db..1e0623bcbb64 100644--- a/frontend/src/lib/components/UniversalFilters/UniversalFilters.component.test.tsx+++ b/frontend/src/lib/components/UniversalFilters/UniversalFilters.component.test.tsx@@ -84,17 +84,22 @@ describe('UniversalFilters recent selections', () => {})}- async function switchToTab(tabTestId: string): Promise<void> {- await userEvent.click(screen.getByTestId(tabTestId))+ async function switchToCategory(groupType: TaxonomicFilterGroupType): Promise<void> {+ await userEvent.click(screen.getByTestId('taxonomic-category-dropdown-trigger-pill'))+ await userEvent.click(screen.getByTestId(`taxonomic-category-dropdown-item-${groupType}`))}async function searchFor(query: string): Promise<void> {await userEvent.type(screen.getByTestId('taxonomic-filter-searchfield'), query)}- async function pickShortcutItem(tabTestId: string, searchQuery: string, itemTestId: string): Promise<void> {+ async function pickShortcutItem(+ groupType: TaxonomicFilterGroupType,+ searchQuery: string,+ itemTestId: string+ ): Promise<void> {await openAddFilter()- await switchToTab(tabTestId)+ await switchToCategory(groupType)await searchFor(searchQuery)await waitFor(() => {expect(screen.getByTestId(itemTestId)).toBeInTheDocument()@@ -113,7 +118,7 @@ describe('UniversalFilters recent selections', () => {mockOverrides: {'/api/environments/:team/events/values': [{ name: 'https://example.com/pricing' }],},- tabTestId: 'taxonomic-tab-pageview_urls',+ groupType: TaxonomicFilterGroupType.PageviewUrls,searchQuery: 'example',itemTestId: 'prop-filter-pageview_urls-0',expectedKey: '$current_url',@@ -124,7 +129,7 @@ describe('UniversalFilters recent selections', () => {mockOverrides: {'/api/environments/:team/events/values': [{ name: 'HomeScreen' }],},- tabTestId: 'taxonomic-tab-screens',+ groupType: TaxonomicFilterGroupType.Screens,searchQuery: 'Home',itemTestId: 'prop-filter-screens-0',expectedKey: '$screen_name',@@ -135,18 +140,18 @@ describe('UniversalFilters recent selections', () => {mockOverrides: {'/api/environments/:team/persons/values': [{ name: '[email protected]' }],},- tabTestId: 'taxonomic-tab-email_addresses',+ groupType: TaxonomicFilterGroupType.EmailAddresses,searchQuery: 'alice',itemTestId: 'prop-filter-email_addresses-0',expectedKey: 'email',},])('selecting a $description records a complete property filter to recents',- async ({ taxonomicGroupTypes, mockOverrides, tabTestId, searchQuery, itemTestId, expectedKey }) => {+ async ({ taxonomicGroupTypes, mockOverrides, groupType, searchQuery, itemTestId, expectedKey }) => {useSetupMocks(mockOverrides)renderUniversalFilters(taxonomicGroupTypes)- await pickShortcutItem(tabTestId, searchQuery, itemTestId)+ await pickShortcutItem(groupType, searchQuery, itemTestId)await waitFor(() => {expectRecentCount(1)diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex f66b29198d3c..f3c6f66fcc71 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -519,7 +519,6 @@ export const FEATURE_FLAGS = {TASK_TOOL: 'phai-task-tool', // owner: @kappa90 #team-posthog-aiTASKS: 'tasks', // owner: #team-ai-observabilityTASKS_STREAM_VIA_PROXY: 'tasks-stream-via-proxy', // owner: #team-ai-observability- TAXONOMIC_FILTER_CATEGORY_DROPDOWN: 'taxonomic-filter-category-dropdown', // owner: @pauldambra #team-product-analytics multivariate=control,pillTAXONOMIC_FILTER_MENU_REBUILD: 'taxonomic-filter-menu-rebuild', // owner: @adamleith, opt-in to the rebuilt TaxonomicFilter — headless filter panel + new popover menu (column / preview-pane)TEXT_CARD_WORD_ART: 'text-card-word-art', // owner: @jonmcwest, gates the word art insert button in dashboard text cardsTRACING: 'tracing', // owner: #team-apm (@jonmcwest, @frankh)diff --git a/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFilterAddFilterPopover.test.tsx b/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFilterAddFilterPopover.test.tsxindex 7eb4460c51a2..0d9044ca61d2 100644--- a/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFilterAddFilterPopover.test.tsx+++ b/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFilterAddFilterPopover.test.tsx@@ -1,8 +1,9 @@import '@testing-library/jest-dom'-import { cleanup, fireEvent, render, screen } from '@testing-library/react'+import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { Provider } from 'kea'+import posthog from 'posthog-js'import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'import UniversalFilters from 'lib/components/UniversalFilters/UniversalFilters'@@ -27,8 +28,9 @@ jest.mock('lib/components/AutoSizer', () => ({renderProp({ height: 400, width: 400 }),}))-describe('RecordingsUniversalFilterAddFilterPopover (pill category dropdown)', () => {+describe('RecordingsUniversalFilterAddFilterPopover', () => {beforeEach(() => {+ localStorage.clear()useMocks({get: {'/api/projects/:team/event_definitions': mockGetEventDefinitions,@@ -65,10 +67,7 @@ describe('RecordingsUniversalFilterAddFilterPopover (pill category dropdown)', (onChange={jest.fn()}taxonomicGroupTypes={taxonomicGroupTypes}>- <RecordingsUniversalFilterAddFilterPopover- categoryDropdownVariant="pill"- taxonomicGroupTypes={taxonomicGroupTypes}- />+ <RecordingsUniversalFilterAddFilterPopover taxonomicGroupTypes={taxonomicGroupTypes} /></UniversalFilters></Provider>)@@ -82,8 +81,7 @@ describe('RecordingsUniversalFilterAddFilterPopover (pill category dropdown)', (await userEvent.click(input)const pillTrigger = await screen.findByTestId('taxonomic-category-dropdown-trigger-pill')- // Defaults to the first group.- expect(pillTrigger).toHaveTextContent('Events')+ expect(pillTrigger).toHaveTextContent('All')expect(pillTrigger).toHaveClass('LemonButton--secondary')expect(pillTrigger).not.toHaveClass('TaxonomicFilter__category-dropdown', 'LemonButton--truncate')@@ -108,4 +106,55 @@ describe('RecordingsUniversalFilterAddFilterPopover (pill category dropdown)', (expect(screen.getByTestId('replay-filters-add-filter-input')).toBeInTheDocument()expect(screen.getByTestId('replay-filters-add-filter-input')).toHaveValue('email')})++ it.each([+ {+ name: 'a filter is selected',+ close: async () => {+ await waitFor(() => {+ expect(screen.getByTestId('prop-filter-events-0')).toBeInTheDocument()+ })+ await userEvent.click(screen.getByTestId('prop-filter-events-0'))+ },+ hadSelection: true,+ categoryRailDocked: false,+ },+ {+ name: 'the person clicks outside',+ close: async () => {+ await userEvent.click(screen.getByTestId('taxonomic-category-dropdown-trigger-pill'))+ await userEvent.click(screen.getByText('Dock categories'))+ await userEvent.click(document.body)+ },+ hadSelection: false,+ categoryRailDocked: true,+ },+ {+ name: 'the person presses Escape',+ close: async () => {+ await userEvent.click(screen.getByTestId('taxonomic-category-dropdown-trigger-pill'))+ await userEvent.click(screen.getByText('Dock categories'))+ fireEvent.keyDown(screen.getByTestId('replay-filters-add-filter-input'), { key: 'Escape' })+ },+ hadSelection: false,+ categoryRailDocked: true,+ },+ ])('captures final category rail state when $name', async ({ close, hadSelection, categoryRailDocked }) => {+ const captureSpy = jest.spyOn(posthog, 'capture')+ renderPopover()++ const input = screen.getByTestId('replay-filters-add-filter-input')+ await userEvent.click(input)+ await close()++ await waitFor(() => {+ const closedCalls = captureSpy.mock.calls.filter((call) => call[0] === 'taxonomic filter closed')+ expect(closedCalls).toHaveLength(1)+ expect(closedCalls[0]?.[1]).toMatchObject({+ hadSelection,+ categoryRailDocked,+ dwellMs: expect.any(Number),+ })+ })+ })})diff --git a/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFiltersEmbed.tsx b/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFiltersEmbed.tsxindex 259951b4d78c..1b2af2491de2 100644--- a/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFiltersEmbed.tsx+++ b/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFiltersEmbed.tsx@@ -39,12 +39,7 @@ import { SettingsMenu } from 'lib/components/PanelSettings/PanelSettings'import { PropertyFilterButton } from 'lib/components/PropertyFilters/components/PropertyFilterButton'import { CategoryDropdown } from 'lib/components/TaxonomicFilter/CategoryDropdown'import { taxonomicFilterLogic } from 'lib/components/TaxonomicFilter/taxonomicFilterLogic'-import {- CategoryDropdownVariant,- resolveCategoryDropdownVariant,- TaxonomicFilterGroupType,- TaxonomicFilterLogicProps,-} from 'lib/components/TaxonomicFilter/types'+import { TaxonomicFilterGroupType, TaxonomicFilterLogicProps } from 'lib/components/TaxonomicFilter/types'import UniversalFilters from 'lib/components/UniversalFilters/UniversalFilters'import { universalFiltersLogic } from 'lib/components/UniversalFilters/universalFiltersLogic'import { isCommentTextFilter, isUniversalGroupFilterLike } from 'lib/components/UniversalFilters/utils'@@ -596,10 +591,8 @@ function SavedFilterNameEditor({}export function RecordingsUniversalFilterAddFilterPopover({- categoryDropdownVariant,taxonomicGroupTypes,}: {- categoryDropdownVariant: CategoryDropdownVarianttaxonomicGroupTypes: TaxonomicFilterGroupType[]}): JSX.Element {const [isPopoverVisible, setIsPopoverVisible] = useState(false)@@ -608,7 +601,7 @@ export function RecordingsUniversalFilterAddFilterPopover({const inputRef = useRef<HTMLInputElement | null>(null)const focusInput = (): void => inputRef.current?.focus()- const taxonomicFilterLogicKey = `session-recordings-add-filter-${useId()}`+ const taxonomicFilterLogicKey = `session-recordings-add-filter-${useId()}-${isPopoverVisible ? 'open' : 'closed'}`const taxonomicFilterLogicProps: TaxonomicFilterLogicProps = {taxonomicFilterLogicKey,@@ -619,33 +612,29 @@ export function RecordingsUniversalFilterAddFilterPopover({// clicking the pill from a closed state opens its menu AND focuses the input (which// opens the surrounding popover); the popover portal mounts last and ends up// visually on top of the menu.- const suffix =- categoryDropdownVariant === 'control' || !isPopoverVisible ? undefined : (- <CategoryDropdown variant={categoryDropdownVariant} onAfterChange={focusInput} />- )+ const suffix = !isPopoverVisible ? undefined : <CategoryDropdown onAfterChange={focusInput} />++ const closePopover = (): void => {+ setIsPopoverVisible(false)+ setAddFilterSearchQuery('')+ }const popover = (<Popoveroverlay={<UniversalFilters.PureTaxonomicFilter- fullWidth={false}- onChange={() => {- setIsPopoverVisible(false)- setAddFilterSearchQuery('')- }}+ onChange={closePopover}searchQuery={addFilterSearchQuery}hideSearchInputtaxonomicFilterLogicKey={taxonomicFilterLogicKey}/>}placement="bottom-start"+ matchWidthvisible={isPopoverVisible}- onClickOutside={() => {- setIsPopoverVisible(false)- setAddFilterSearchQuery('')- }}+ onClickOutside={closePopover}>- <div className="w-full max-w-[600px] shrink grow-0">+ <div className="w-full max-w-[600px] shrink grow-0 @container"><LemonInputtype="search"size="small"@@ -664,8 +653,7 @@ export function RecordingsUniversalFilterAddFilterPopover({onFocus={() => setIsPopoverVisible(true)}onKeyDown={(e) => {if (e.key === 'Escape') {- setIsPopoverVisible(false)- setAddFilterSearchQuery('')+ closePopover()e.preventDefault()}}}@@ -675,14 +663,10 @@ export function RecordingsUniversalFilterAddFilterPopover({</Popover>)- // Bind the logic whenever the pill variant is in play so the suffix can mount/unmount- // alongside popover visibility without remounting the popover itself.- return categoryDropdownVariant !== 'control' ? (+ return (<BindLogic logic={taxonomicFilterLogic} props={taxonomicFilterLogicProps}>{popover}</BindLogic>- ) : (- popover)}@@ -741,10 +725,6 @@ export const ReplayFiltersTab = ({}: ReplayUniversalFiltersEmbedProps): JSX.Element => {const [isSaveFiltersModalOpen, setIsSaveFiltersModalOpen] = useState(false)- const { featureFlags } = useValues(featureFlagLogic)- const categoryDropdownVariant = resolveCategoryDropdownVariant(- featureFlags[FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]- )const showFeedbackButton = useFeatureFlag('SHOW_REPLAY_FILTERS_FEEDBACK_BUTTON')const scannerCrossSellEnabled = useFeatureFlag('VISION_ENTRYPOINT_REPLAY_FILTERS')// A scanner keeps less of the filter set than this panel does, so what it would actually watch@@ -963,10 +943,7 @@ export const ReplayFiltersTab = ({setFilters({ filter_group: newFilterGroup })}}>- <RecordingsUniversalFilterAddFilterPopover- categoryDropdownVariant={categoryDropdownVariant}- taxonomicGroupTypes={taxonomicGroupTypes}- />+ <RecordingsUniversalFilterAddFilterPopover taxonomicGroupTypes={taxonomicGroupTypes} /></UniversalFilters>)}</div>diff --git a/playwright/e2e/workflows-property-filter-category-dropdown.spec.ts b/playwright/e2e/workflows-property-filter-category-dropdown.spec.tsindex 1338e7481c1c..4ee43f38ac03 100644--- a/playwright/e2e/workflows-property-filter-category-dropdown.spec.ts+++ b/playwright/e2e/workflows-property-filter-category-dropdown.spec.ts@@ -1,4 +1,3 @@-import { mockFeatureFlags } from '../utils/mockApi'import { PlaywrightWorkspaceSetupResult, expect, test } from '../utils/workspace-test-base'const TRIGGER_NODE_ID = 'trigger_node'@@ -75,15 +74,10 @@ test.describe('Workflows conditional branch property filter category dropdown',})test.beforeEach(async ({ page, playwrightSetup }) => {- // Log in (sets the session + CSRF cookie the test needs to create a hog_flow) without- // navigating into the app, so the feature flag mock is installed before the editor loads.await playwrightSetup.login(page, workspace!)- await mockFeatureFlags(page, {- 'taxonomic-filter-category-dropdown': 'pill',- })})- test('reopening a saved filter and clicking the category dropdown trigger pill keeps the filter popover open', async ({+ test('reopening a saved filter and clicking the category dropdown keeps the filter popover open', async ({page,}) => {test.setTimeout(90 * 1000)@@ -124,11 +118,8 @@ test.describe('Workflows conditional branch property filter category dropdown',await expect(page.getByTestId('taxonomic-category-dropdown-trigger-pill')).toBeVisible()})- await test.step('clicking the category dropdown trigger pill opens the menu and keeps the popover open', async () => {+ await test.step('clicking the category dropdown opens the menu and keeps the popover open', async () => {await page.getByTestId('taxonomic-category-dropdown-trigger-pill').click()- // Give the popover transitions time to settle so the assertions reflect the steady state- // after the click rather than the brief moment between mouseup and click-outside.- await page.waitForTimeout(250)await expect(page.getByTestId('property-filter-0')).toBeVisible()await expect(page.getByTestId('property-select-toggle-0')).toBeVisible()await expect(page.getByTestId('taxonomic-filter-searchfield')).toBeVisible()diff --git a/playwright/page-models/cohortPage.ts b/playwright/page-models/cohortPage.tsindex 38586996f5c4..7f6463cf143a 100644--- a/playwright/page-models/cohortPage.ts+++ b/playwright/page-models/cohortPage.ts@@ -13,7 +13,17 @@ export class CohortPage {await this.page.click('[data-attr="cohort-personPropertyBehavioral-have_property-type"]')await this.page.click('[data-attr="cohort-taxonomic-field-key"]')- await this.page.locator('[data-attr=prop-filter-person_properties-0]').click()+ const categoryDropdown = this.page.getByTestId('taxonomic-category-dropdown-trigger-pill')+ await expect(categoryDropdown).toBeVisible()+ await categoryDropdown.click()++ const personPropertiesCategory = this.page.getByTestId('taxonomic-category-dropdown-item-person_properties')+ await expect(personPropertiesCategory).toBeVisible()+ await personPropertiesCategory.click()++ const personProperty = this.page.getByTestId('prop-filter-person_properties-0')+ await expect(personProperty).toBeVisible()+ await personProperty.click()await this.page.locator('[data-attr=prop-val]').pressSequentially('true')await this.page.click('[data-attr="scene-title-textarea"]')diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerTriggers.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerTriggers.tsxindex 9dad89096594..8f0dbb3f30dc 100644--- a/products/replay_vision/frontend/replay_scanners/components/ScannerTriggers.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerTriggers.tsx@@ -2,12 +2,11 @@ import { useActions, useValues } from 'kea'import { LemonBanner, LemonCard, LemonSelect, LemonTag } from '@posthog/lemon-ui'-import { resolveCategoryDropdownVariant, TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'+import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'import { TestAccountFilterSwitch } from 'lib/components/TestAccountFiltersSwitch'import UniversalFilters from 'lib/components/UniversalFilters/UniversalFilters'import { universalFiltersLogic } from 'lib/components/UniversalFilters/universalFiltersLogic'import { isUniversalGroupFilterLike } from 'lib/components/UniversalFilters/utils'-import { FEATURE_FLAGS } from 'lib/constants'import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'import { LemonButton } from 'lib/lemon-ui/LemonButton'import { LemonDialog, LemonDialogProps } from 'lib/lemon-ui/LemonDialog'@@ -15,7 +14,6 @@ import { LemonField } from 'lib/lemon-ui/LemonField'import { LemonLabel } from 'lib/lemon-ui/LemonLabel'import { Link } from 'lib/lemon-ui/Link'import { Tooltip } from 'lib/lemon-ui/Tooltip'-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'import { getExperimentVariants } from 'scenes/experiments/utils'import { DurationFilter } from 'scenes/session-recordings/filters/DurationFilter'import {@@ -174,11 +172,7 @@ function ExperimentTargeting({ scannerId }: { scannerId: string }): JSX.Elementexport function ScannerTriggers({ scannerId }: { scannerId: string }): JSX.Element {const { scanner, scannerEstimate, scannerEstimateLoading } = useValues(replayScannerLogic({ id: scannerId }))- const { featureFlags } = useValues(featureFlagLogic)const { groupsTaxonomicTypes } = useValues(groupsModel)- const categoryDropdownVariant = resolveCategoryDropdownVariant(- featureFlags[FEATURE_FLAGS.TAXONOMIC_FILTER_CATEGORY_DROPDOWN]- )const scannerFilterTypes = [...SCANNER_BASE_FILTER_TYPES, ...groupsTaxonomicTypes]// Waits for the in-flight estimate so an edit can't report on the previous filters.const noMatchWindowDays =@@ -308,7 +302,6 @@ export function ScannerTriggers({ scannerId }: { scannerId: string }): JSX.Eleme}><RecordingsUniversalFilterAddFilterPopover- categoryDropdownVariant={categoryDropdownVariant}taxonomicGroupTypes={scannerFilterTypes}/></UniversalFilters>diff --git a/products/surveys/frontend/e2e/quickcreate.spec.ts b/products/surveys/frontend/e2e/quickcreate.spec.tsindex c2eeaf0586ab..2a706591934a 100644--- a/products/surveys/frontend/e2e/quickcreate.spec.ts+++ b/products/surveys/frontend/e2e/quickcreate.spec.ts@@ -172,8 +172,16 @@ test.describe('Quick create survey from feature flag', () => {await clickCreateSurvey(page, name)// add event — the beforeEach seeds a recent $autocapture event, so its definition shows- // as "Autocapture" in the picker's Events list (no search needed).+ // as "Autocapture" in the picker's Events list after choosing that category.await page.locator('.LemonButton').getByText('Add event').click()+ const categoryDropdown = page.getByTestId('taxonomic-category-dropdown-trigger-pill')+ await expect(categoryDropdown).toBeVisible()+ await categoryDropdown.click()++ const eventsCategory = page.getByTestId('taxonomic-category-dropdown-item-events')+ await expect(eventsCategory).toBeVisible()+ await eventsCategory.click()+const autocaptureOption = page.locator('span[aria-label="Autocapture"]').getByText('Autocapture')await expect(autocaptureOption).toBeVisible()await autocaptureOption.click()diff --git a/products/workflows/frontend/Workflows/hogflows/filters/HogFlowPropertyFiltersSearch.test.tsx b/products/workflows/frontend/Workflows/hogflows/filters/HogFlowPropertyFiltersSearch.test.tsxindex a07d44546e49..ffb40dc0bec8 100644--- a/products/workflows/frontend/Workflows/hogflows/filters/HogFlowPropertyFiltersSearch.test.tsx+++ b/products/workflows/frontend/Workflows/hogflows/filters/HogFlowPropertyFiltersSearch.test.tsx@@ -90,12 +90,17 @@ describe('HogFlowPropertyFilters search', () => {fireEvent.change(screen.getByTestId('taxonomic-filter-searchfield'), { target: { value: query } })}+ async function selectWorkflowVariablesCategory(): Promise<void> {+ fireEvent.click(await screen.findByTestId('taxonomic-category-dropdown-trigger-pill'))+ fireEvent.click(await screen.findByTestId('taxonomic-category-dropdown-item-workflow_variables'))+ }+it('shows workflow variables in the dedicated tab', async () => {setWorkflowVariables([ORDER_ID_VARIABLE, CART_TOTAL_VARIABLE])renderFilters()await openTaxonomicFilter()- fireEvent.click(screen.getByTestId('taxonomic-tab-workflow_variables'))+ await selectWorkflowVariablesCategory()await waitFor(() => {expect(screen.getAllByText('order_id').length).toBeGreaterThan(0)@@ -108,7 +113,7 @@ describe('HogFlowPropertyFilters search', () => {renderFilters()await openTaxonomicFilter()- fireEvent.click(screen.getByTestId('taxonomic-tab-workflow_variables'))+ await selectWorkflowVariablesCategory()search('cart')await waitFor(() => {@@ -136,7 +141,7 @@ describe('HogFlowPropertyFilters search', () => {renderFilters()await openTaxonomicFilter()- fireEvent.click(screen.getByTestId('taxonomic-tab-workflow_variables'))+ await selectWorkflowVariablesCategory()search('zzznonexistent')await waitFor(() => {