diff --git a/CHANGELOG.md b/CHANGELOG.md index eef662602..1301323ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- Added `isBranchFilteringEnabled` flag to `search_finished` PostHog event. [#781](https://github.com/sourcebot-dev/sourcebot/pull/781) + ## [4.10.15] - 2026-01-22 ### Fixed diff --git a/packages/web/src/app/[domain]/search/components/searchResultsPage.tsx b/packages/web/src/app/[domain]/search/components/searchResultsPage.tsx index 8708dc3be..c709fadda 100644 --- a/packages/web/src/app/[domain]/search/components/searchResultsPage.tsx +++ b/packages/web/src/app/[domain]/search/components/searchResultsPage.tsx @@ -102,6 +102,13 @@ export const SearchResultsPage = ({ ]) }, [searchQuery, setSearchHistory]); + // Look for any files that are not on the default branch. + const isBranchFilteringEnabled = useMemo(() => { + return files.some((file) => { + return file.branches?.some((branch) => branch !== 'HEAD') ?? false; + }); + }, [files]); + useEffect(() => { if (isStreaming || !stats) { return; @@ -138,6 +145,7 @@ export const SearchResultsPage = ({ flushReason: stats.flushReason, fileLanguages, isSearchExhaustive: isExhaustive, + isBranchFilteringEnabled, }); }, [ captureEvent, @@ -147,6 +155,7 @@ export const SearchResultsPage = ({ stats, timeToSearchCompletionMs, timeToFirstSearchResultMs, + isBranchFilteringEnabled, ]); const onLoadMoreResults = useCallback(() => { @@ -157,13 +166,7 @@ export const SearchResultsPage = ({ router.push(url); }, [maxMatchCount, router, searchQuery, domain]); - // Look for any files that are not on the default branch. - const isBranchFilteringEnabled = useMemo(() => { - return files.some((file) => { - return file.branches?.some((branch) => branch !== 'HEAD') ?? false; - }); - }, [files]); - + return (
{/* TopBar */} diff --git a/packages/web/src/lib/posthogEvents.ts b/packages/web/src/lib/posthogEvents.ts index eee32bc05..ea64f88ee 100644 --- a/packages/web/src/lib/posthogEvents.ts +++ b/packages/web/src/lib/posthogEvents.ts @@ -27,7 +27,8 @@ export type PosthogEventMap = { regexpsConsidered: number, flushReason: string, fileLanguages: string[], - isSearchExhaustive: boolean + isSearchExhaustive: boolean, + isBranchFilteringEnabled: boolean, }, //////////////////////////////////////////////////////////////// wa_trial_nav_pressed: {},