From 933ba1c37315c14db0c2b5356a08f790034c6ffa Mon Sep 17 00:00:00 2001 From: DS Boyce <260543580+ds-boyce@users.noreply.github.com> Date: Wed, 22 Jul 2026 13:22:56 -0700 Subject: [PATCH] Add feature gate for starter pack search (#11234) --- src/analytics/features/types.ts | 1 + src/screens/Search/SearchResults.tsx | 34 ++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/analytics/features/types.ts b/src/analytics/features/types.ts index a781137747..c48cdb90df 100644 --- a/src/analytics/features/types.ts +++ b/src/analytics/features/types.ts @@ -19,6 +19,7 @@ export enum Features { PostThreadKnownLikersEnable = 'post_thread:known_likers:enable', PostThreadKnownLikersFetchEnable = 'post_thread:known_likers:fetch:enable', CustomLogoJapanEnable = 'custom_logo:japan:enable', + SearchStarterPacksV2Enable = 'search_starter_packs_v2:enable', AATest = 'aa-test', } diff --git a/src/screens/Search/SearchResults.tsx b/src/screens/Search/SearchResults.tsx index ed405d3265..2d6079e2fd 100644 --- a/src/screens/Search/SearchResults.tsx +++ b/src/screens/Search/SearchResults.tsx @@ -54,6 +54,7 @@ let SearchResults = ({ onPageSelected: (page: number) => void headerHeight: number }): React.ReactNode => { + const ax = useAnalytics() const {t: l} = useLingui() /* * People/Feeds visibility keys off post-only filters: a `lang` filter applies @@ -64,6 +65,10 @@ let SearchResults = ({ const activePage = hasPostFilters && activeTab > 1 ? 0 : activeTab const tabShape = hasPostFilters ? 'filtered' : 'plain' + const isStarterPacksEnabled = ax.features.enabled( + ax.features.SearchStarterPacksV2Enable, + ) + const sections = useMemo(() => { if (!query && !hasFilters) return [] /* @@ -108,20 +113,29 @@ let SearchResults = ({ ), }, - noFilters && { - title: l`Starter packs`, - component: ( - - ), - }, + noFilters && + isStarterPacksEnabled && { + title: l`Starter packs`, + component: ( + + ), + }, ].filter(Boolean) as { title: string component: React.ReactNode }[] - }, [l, query, filters, hasFilters, hasPostFilters, activePage]) + }, [ + l, + query, + filters, + hasFilters, + hasPostFilters, + activePage, + isStarterPacksEnabled, + ]) // There may be fewer tabs after changing the search options. const selectedPage = activePage > sections.length - 1 ? 0 : activePage