From db7ad8355e97b71862449a737effb5f80843aec2 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 22 Sep 2026 04:18:21 +0000 Subject: [PATCH 1/9] feat(web): auth-gate Ask GH code search submit Co-authored-by: Michael Sukkarieh --- packages/web/src/app/(app)/browse/layout.tsx | 13 +++++++-- .../web/src/app/(app)/browse/layoutClient.tsx | 6 ++++ .../(app)/components/searchBar/searchBar.tsx | 29 +++++++++++++++++-- .../search/components/searchLandingPage.tsx | 6 ++++ .../search/components/searchResultsPage.tsx | 6 ++++ packages/web/src/app/(app)/search/page.tsx | 14 ++++++++- 6 files changed, 68 insertions(+), 6 deletions(-) diff --git a/packages/web/src/app/(app)/browse/layout.tsx b/packages/web/src/app/(app)/browse/layout.tsx index d9b555c0a..eb4c19897 100644 --- a/packages/web/src/app/(app)/browse/layout.tsx +++ b/packages/web/src/app/(app)/browse/layout.tsx @@ -1,5 +1,7 @@ import { LayoutClient } from "./layoutClient"; import { getConfiguredLanguageModelsInfo } from "@/features/chat/utils.server"; +import { auth } from "@/auth"; +import { env } from "@sourcebot/shared"; interface LayoutProps { children: React.ReactNode; @@ -8,9 +10,16 @@ interface LayoutProps { export default async function Layout({ children, }: LayoutProps) { - const languageModels = await getConfiguredLanguageModelsInfo(); + const [languageModels, session] = await Promise.all([ + getConfiguredLanguageModelsInfo(), + auth(), + ]); return ( - 0}> + 0} + > {children} ) diff --git a/packages/web/src/app/(app)/browse/layoutClient.tsx b/packages/web/src/app/(app)/browse/layoutClient.tsx index fb0922d6e..32e9131f1 100644 --- a/packages/web/src/app/(app)/browse/layoutClient.tsx +++ b/packages/web/src/app/(app)/browse/layoutClient.tsx @@ -13,11 +13,15 @@ import { Separator } from "@/components/ui/separator"; interface LayoutProps { children: React.ReactNode; + isAuthenticated: boolean; + isLoginWallEnabled: boolean; isSearchAssistSupported: boolean; } export function LayoutClient({ children, + isAuthenticated, + isLoginWallEnabled, isSearchAssistSupported, }: LayoutProps) { const { repoName, revisionName, pathType } = useBrowseParams(); @@ -32,6 +36,8 @@ export function LayoutClient({ query: `repo:^${escapeStringRegexp(repoName)}$${revisionName ? ` rev:${revisionName}` : ''} `, }} className="w-full" + isAuthenticated={isAuthenticated} + isLoginWallEnabled={isLoginWallEnabled} isSearchAssistSupported={isSearchAssistSupported} /> diff --git a/packages/web/src/app/(app)/components/searchBar/searchBar.tsx b/packages/web/src/app/(app)/components/searchBar/searchBar.tsx index 7ce3a537c..d7ca263aa 100644 --- a/packages/web/src/app/(app)/components/searchBar/searchBar.tsx +++ b/packages/web/src/app/(app)/components/searchBar/searchBar.tsx @@ -47,6 +47,7 @@ import Link from "next/link"; import { CaseSensitiveIcon, RegexIcon, Wand2Icon } from "lucide-react"; import { SearchAssistBox } from "./searchAssistBox"; import useCaptureEvent from "@/hooks/useCaptureEvent"; +import { LoginDialog } from "@/features/chat/components/chatBox/loginDialog"; const LANGUAGE_MODEL_DOCS_URL = "https://docs.sourcebot.dev/docs/configuration/language-model-providers"; @@ -60,6 +61,8 @@ interface SearchBarProps { } autoFocus?: boolean; isSearchAssistSupported: boolean; + isAuthenticated: boolean; + isLoginWallEnabled: boolean; } const searchBarKeymap: readonly KeyBinding[] = ([ @@ -107,6 +110,8 @@ export const SearchBar = ({ query: defaultQuery = "", } = {}, isSearchAssistSupported, + isAuthenticated, + isLoginWallEnabled, }: SearchBarProps) => { const router = useRouter(); const captureEvent = useCaptureEvent(); @@ -120,6 +125,7 @@ export const SearchBar = ({ const [isHistorySearchEnabled, setIsHistorySearchEnabled] = useState(false); const [isRegexEnabled, setIsRegexEnabled] = useState(defaultIsRegexEnabled); const [isCaseSensitivityEnabled, setIsCaseSensitivityEnabled] = useState(defaultIsCaseSensitivityEnabled); + const [isLoginDialogOpen, setIsLoginDialogOpen] = useState(false); const focusEditor = useCallback(() => editorRef.current?.view?.focus(), []); const focusSuggestionsBox = useCallback(() => suggestionBoxRef.current?.focus(), []); @@ -225,16 +231,28 @@ export const SearchBar = ({ setActivePanel(undefined); setIsHistorySearchEnabled(false); + if (isLoginWallEnabled && !isAuthenticated) { + setIsLoginDialogOpen(true); + return; + } + const url = createPathWithQueryParams(`/search`, [SearchQueryParams.query, query], [SearchQueryParams.isRegexEnabled, isRegexEnabled ? "true" : null], [SearchQueryParams.isCaseSensitivityEnabled, isCaseSensitivityEnabled ? "true" : null], ); router.push(url); - }, [router, isRegexEnabled, isCaseSensitivityEnabled]); + }, [ + isAuthenticated, + isCaseSensitivityEnabled, + isLoginWallEnabled, + isRegexEnabled, + router, + ]); return ( -
+
{ if (e.key === 'Enter') { @@ -401,7 +419,12 @@ export const SearchBar = ({ cursorPosition={cursorPosition} {...suggestionData} /> -
+
+ + ) } diff --git a/packages/web/src/app/(app)/search/components/searchLandingPage.tsx b/packages/web/src/app/(app)/search/components/searchLandingPage.tsx index f83d2aed3..5ed106aa7 100644 --- a/packages/web/src/app/(app)/search/components/searchLandingPage.tsx +++ b/packages/web/src/app/(app)/search/components/searchLandingPage.tsx @@ -9,10 +9,14 @@ import { ServiceErrorException } from "@/lib/serviceError" import { isServiceError } from "@/lib/utils" export interface SearchLandingPageProps { + isAuthenticated: boolean; + isLoginWallEnabled: boolean; isSearchAssistSupported: boolean; } export const SearchLandingPage = async ({ + isAuthenticated, + isLoginWallEnabled, isSearchAssistSupported, }: SearchLandingPageProps) => { const carouselRepos = await getRepos({ @@ -38,6 +42,8 @@ export const SearchLandingPage = async ({ diff --git a/packages/web/src/app/(app)/search/components/searchResultsPage.tsx b/packages/web/src/app/(app)/search/components/searchResultsPage.tsx index dcb5f4aea..a1e359ba2 100644 --- a/packages/web/src/app/(app)/search/components/searchResultsPage.tsx +++ b/packages/web/src/app/(app)/search/components/searchResultsPage.tsx @@ -34,18 +34,22 @@ import { useFilteredMatches } from "./filterPanel/useFilterMatches"; import { SearchResultsPanel, SearchResultsPanelHandle } from "./searchResultsPanel"; interface SearchResultsPageProps { + isAuthenticated: boolean; searchQuery: string; defaultMaxMatchCount: number; isRegexEnabled: boolean; isCaseSensitivityEnabled: boolean; + isLoginWallEnabled: boolean; isSearchAssistSupported: boolean; } export const SearchResultsPage = ({ + isAuthenticated, searchQuery, defaultMaxMatchCount, isRegexEnabled, isCaseSensitivityEnabled, + isLoginWallEnabled, isSearchAssistSupported, }: SearchResultsPageProps) => { const router = useRouter(); @@ -178,6 +182,8 @@ export const SearchResultsPage = ({ query: searchQuery, }} className="w-full" + isAuthenticated={isAuthenticated} + isLoginWallEnabled={isLoginWallEnabled} isSearchAssistSupported={isSearchAssistSupported} /> diff --git a/packages/web/src/app/(app)/search/page.tsx b/packages/web/src/app/(app)/search/page.tsx index 97e552b03..ad86480a2 100644 --- a/packages/web/src/app/(app)/search/page.tsx +++ b/packages/web/src/app/(app)/search/page.tsx @@ -1,4 +1,5 @@ import { env } from "@sourcebot/shared"; +import { auth } from "@/auth"; import { SearchLandingPage } from "./components/searchLandingPage"; import { SearchResultsPage } from "./components/searchResultsPage"; import { getConfiguredLanguageModelsInfo } from "@/features/chat/utils.server"; @@ -16,20 +17,31 @@ export default async function SearchPage(props: SearchPageProps) { const query = searchParams?.query; const isRegexEnabled = searchParams?.isRegexEnabled === "true"; const isCaseSensitivityEnabled = searchParams?.isCaseSensitivityEnabled === "true"; + const session = await auth(); + const isAuthenticated = !!session?.user; + const isLoginWallEnabled = env.EXPERIMENT_ASK_GH_ENABLED === "true"; const languageModels = await getConfiguredLanguageModelsInfo(); const isSearchAssistSupported = languageModels.length > 0; if (query === undefined || query.length === 0) { - return + return ( + + ) } return ( ) From 4206633eeea511e2a8969d2ab4dad7962af0ac23 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 22 Sep 2026 04:18:59 +0000 Subject: [PATCH 2/9] docs: add changelog entry for Ask GH search gate Co-authored-by: Michael Sukkarieh --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d67263859..5e195088b 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] +### Fixed +- Fixed Ask GH code search submissions to prompt anonymous users to sign in while preserving access to existing results and repository browsing. [#1680](https://github.com/sourcebot-dev/sourcebot/pull/1680) + ## [5.1.14] - 2026-09-17 ### Added From 8a66f0743196374ac3fd05710206098fdb5d25f7 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 22 Sep 2026 17:36:23 +0000 Subject: [PATCH 3/9] fix(web): resume gated code search after login Co-authored-by: Michael Sukkarieh --- .../app/(app)/components/searchBar/searchBar.tsx | 14 +++++++++----- .../chat/components/chatBox/loginDialog.tsx | 4 +++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/web/src/app/(app)/components/searchBar/searchBar.tsx b/packages/web/src/app/(app)/components/searchBar/searchBar.tsx index d7ca263aa..3e1834d92 100644 --- a/packages/web/src/app/(app)/components/searchBar/searchBar.tsx +++ b/packages/web/src/app/(app)/components/searchBar/searchBar.tsx @@ -126,6 +126,7 @@ export const SearchBar = ({ const [isRegexEnabled, setIsRegexEnabled] = useState(defaultIsRegexEnabled); const [isCaseSensitivityEnabled, setIsCaseSensitivityEnabled] = useState(defaultIsCaseSensitivityEnabled); const [isLoginDialogOpen, setIsLoginDialogOpen] = useState(false); + const [loginCallbackUrl, setLoginCallbackUrl] = useState(); const focusEditor = useCallback(() => editorRef.current?.view?.focus(), []); const focusSuggestionsBox = useCallback(() => suggestionBoxRef.current?.focus(), []); @@ -231,16 +232,18 @@ export const SearchBar = ({ setActivePanel(undefined); setIsHistorySearchEnabled(false); - if (isLoginWallEnabled && !isAuthenticated) { - setIsLoginDialogOpen(true); - return; - } - const url = createPathWithQueryParams(`/search`, [SearchQueryParams.query, query], [SearchQueryParams.isRegexEnabled, isRegexEnabled ? "true" : null], [SearchQueryParams.isCaseSensitivityEnabled, isCaseSensitivityEnabled ? "true" : null], ); + + if (isLoginWallEnabled && !isAuthenticated) { + setLoginCallbackUrl(url); + setIsLoginDialogOpen(true); + return; + } + router.push(url); }, [ isAuthenticated, @@ -423,6 +426,7 @@ export const SearchBar = ({ ) diff --git a/packages/web/src/features/chat/components/chatBox/loginDialog.tsx b/packages/web/src/features/chat/components/chatBox/loginDialog.tsx index 9fc83d257..75f11a3fd 100644 --- a/packages/web/src/features/chat/components/chatBox/loginDialog.tsx +++ b/packages/web/src/features/chat/components/chatBox/loginDialog.tsx @@ -13,11 +13,13 @@ import { usePathname } from "next/navigation"; interface LoginDialogProps { isOpen: boolean; onOpenChange: (open: boolean) => void; + callbackUrl?: string; } export const LoginDialog = ({ isOpen, onOpenChange, + callbackUrl, }: LoginDialogProps) => { const pathname = usePathname(); @@ -33,7 +35,7 @@ export const LoginDialog = ({
From 95840f41b2e79f26378c3193c1c52f15983dcabd Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 23 Sep 2026 03:01:18 +0000 Subject: [PATCH 4/9] refactor(web): simplify search login gate state Co-authored-by: Michael Sukkarieh --- .../(app)/components/searchBar/searchBar.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/web/src/app/(app)/components/searchBar/searchBar.tsx b/packages/web/src/app/(app)/components/searchBar/searchBar.tsx index 3e1834d92..b4e24e969 100644 --- a/packages/web/src/app/(app)/components/searchBar/searchBar.tsx +++ b/packages/web/src/app/(app)/components/searchBar/searchBar.tsx @@ -125,7 +125,6 @@ export const SearchBar = ({ const [isHistorySearchEnabled, setIsHistorySearchEnabled] = useState(false); const [isRegexEnabled, setIsRegexEnabled] = useState(defaultIsRegexEnabled); const [isCaseSensitivityEnabled, setIsCaseSensitivityEnabled] = useState(defaultIsCaseSensitivityEnabled); - const [isLoginDialogOpen, setIsLoginDialogOpen] = useState(false); const [loginCallbackUrl, setLoginCallbackUrl] = useState(); const focusEditor = useCallback(() => editorRef.current?.view?.focus(), []); @@ -239,13 +238,14 @@ export const SearchBar = ({ ); if (isLoginWallEnabled && !isAuthenticated) { + captureEvent('wa_askgh_login_wall_prompted', {}); setLoginCallbackUrl(url); - setIsLoginDialogOpen(true); return; } router.push(url); }, [ + captureEvent, isAuthenticated, isCaseSensitivityEnabled, isLoginWallEnabled, @@ -254,8 +254,7 @@ export const SearchBar = ({ ]); return ( - <> -
{ if (e.key === 'Enter') { @@ -422,13 +421,16 @@ export const SearchBar = ({ cursorPosition={cursorPosition} {...suggestionData} /> -
{ + if (!open) { + setLoginCallbackUrl(undefined); + } + }} callbackUrl={loginCallbackUrl} /> - + ) } From 81846d3b1e5f696eb6dfc055c3654db5327a9cc0 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 23 Sep 2026 03:13:50 +0000 Subject: [PATCH 5/9] fix(web): ignore empty gated searches Co-authored-by: Michael Sukkarieh --- packages/web/src/app/(app)/components/searchBar/searchBar.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/web/src/app/(app)/components/searchBar/searchBar.tsx b/packages/web/src/app/(app)/components/searchBar/searchBar.tsx index b4e24e969..7aee20966 100644 --- a/packages/web/src/app/(app)/components/searchBar/searchBar.tsx +++ b/packages/web/src/app/(app)/components/searchBar/searchBar.tsx @@ -238,6 +238,9 @@ export const SearchBar = ({ ); if (isLoginWallEnabled && !isAuthenticated) { + if (query.trim().length === 0) { + return; + } captureEvent('wa_askgh_login_wall_prompted', {}); setLoginCallbackUrl(url); return; From e372c864b3e246d6580a83f18a9539a2b126f308 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 23 Sep 2026 03:35:18 +0000 Subject: [PATCH 6/9] docs: simplify Ask GitHub changelog entry Co-authored-by: Michael Sukkarieh --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b10c5113..6cf30638f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,12 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added +- Added login wall for code search for Ask GitHub. [#1680](https://github.com/sourcebot-dev/sourcebot/pull/1680) + ### Removed - Removed the Ask Sourcebot first-visit tutorial banner. [#1675](https://github.com/sourcebot-dev/sourcebot/pull/1675) ### Fixed - Removed suggested example queries from the Ask landing page. [#1674](https://github.com/sourcebot-dev/sourcebot/pull/1674) -- Fixed Ask GH code search submissions to prompt anonymous users to sign in while preserving access to existing results and repository browsing. [#1680](https://github.com/sourcebot-dev/sourcebot/pull/1680) ## [5.1.14] - 2026-09-17 From 4e6cd96223bf6c8919215555874def7ee51d2bd7 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 23 Sep 2026 04:58:39 +0000 Subject: [PATCH 7/9] feat(web): track code search login wall prompt Co-authored-by: Michael Sukkarieh --- packages/web/src/app/(app)/components/searchBar/searchBar.tsx | 2 +- packages/web/src/lib/posthogEvents.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/web/src/app/(app)/components/searchBar/searchBar.tsx b/packages/web/src/app/(app)/components/searchBar/searchBar.tsx index 7aee20966..89cf6b822 100644 --- a/packages/web/src/app/(app)/components/searchBar/searchBar.tsx +++ b/packages/web/src/app/(app)/components/searchBar/searchBar.tsx @@ -241,7 +241,7 @@ export const SearchBar = ({ if (query.trim().length === 0) { return; } - captureEvent('wa_askgh_login_wall_prompted', {}); + captureEvent('wa_publicsaas_cs_login_wall_prompted', {}); setLoginCallbackUrl(url); return; } diff --git a/packages/web/src/lib/posthogEvents.ts b/packages/web/src/lib/posthogEvents.ts index 5859bf560..ae1685383 100644 --- a/packages/web/src/lib/posthogEvents.ts +++ b/packages/web/src/lib/posthogEvents.ts @@ -537,6 +537,7 @@ export type PosthogEventMap = { }, ////////////////////////////////////////////////////////////////// wa_askgh_login_wall_prompted: {}, + wa_publicsaas_cs_login_wall_prompted: {}, ////////////////////////////////////////////////////////////////// askgh_repo_index_requested: { owner: string, From af0419cf1c4e3d99b94b6e9261a3784ad12a3232 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 23 Sep 2026 05:02:57 +0000 Subject: [PATCH 8/9] refactor(web): combine search login wall props Co-authored-by: Michael Sukkarieh --- packages/web/src/app/(app)/browse/layout.tsx | 3 +-- packages/web/src/app/(app)/browse/layoutClient.tsx | 9 +++------ .../src/app/(app)/components/searchBar/searchBar.tsx | 11 ++++------- .../app/(app)/search/components/searchLandingPage.tsx | 9 +++------ .../app/(app)/search/components/searchResultsPage.tsx | 9 +++------ packages/web/src/app/(app)/search/page.tsx | 9 +++------ 6 files changed, 17 insertions(+), 33 deletions(-) diff --git a/packages/web/src/app/(app)/browse/layout.tsx b/packages/web/src/app/(app)/browse/layout.tsx index eb4c19897..084d1e96f 100644 --- a/packages/web/src/app/(app)/browse/layout.tsx +++ b/packages/web/src/app/(app)/browse/layout.tsx @@ -16,9 +16,8 @@ export default async function Layout({ ]); return ( 0} + showLoginWall={env.EXPERIMENT_ASK_GH_ENABLED === "true" && !session?.user} > {children} diff --git a/packages/web/src/app/(app)/browse/layoutClient.tsx b/packages/web/src/app/(app)/browse/layoutClient.tsx index 32e9131f1..60e36a6ce 100644 --- a/packages/web/src/app/(app)/browse/layoutClient.tsx +++ b/packages/web/src/app/(app)/browse/layoutClient.tsx @@ -13,16 +13,14 @@ import { Separator } from "@/components/ui/separator"; interface LayoutProps { children: React.ReactNode; - isAuthenticated: boolean; - isLoginWallEnabled: boolean; isSearchAssistSupported: boolean; + showLoginWall: boolean; } export function LayoutClient({ children, - isAuthenticated, - isLoginWallEnabled, isSearchAssistSupported, + showLoginWall, }: LayoutProps) { const { repoName, revisionName, pathType } = useBrowseParams(); return ( @@ -36,9 +34,8 @@ export function LayoutClient({ query: `repo:^${escapeStringRegexp(repoName)}$${revisionName ? ` rev:${revisionName}` : ''} `, }} className="w-full" - isAuthenticated={isAuthenticated} - isLoginWallEnabled={isLoginWallEnabled} isSearchAssistSupported={isSearchAssistSupported} + showLoginWall={showLoginWall} /> diff --git a/packages/web/src/app/(app)/components/searchBar/searchBar.tsx b/packages/web/src/app/(app)/components/searchBar/searchBar.tsx index 89cf6b822..de765d3a8 100644 --- a/packages/web/src/app/(app)/components/searchBar/searchBar.tsx +++ b/packages/web/src/app/(app)/components/searchBar/searchBar.tsx @@ -61,8 +61,7 @@ interface SearchBarProps { } autoFocus?: boolean; isSearchAssistSupported: boolean; - isAuthenticated: boolean; - isLoginWallEnabled: boolean; + showLoginWall: boolean; } const searchBarKeymap: readonly KeyBinding[] = ([ @@ -110,8 +109,7 @@ export const SearchBar = ({ query: defaultQuery = "", } = {}, isSearchAssistSupported, - isAuthenticated, - isLoginWallEnabled, + showLoginWall, }: SearchBarProps) => { const router = useRouter(); const captureEvent = useCaptureEvent(); @@ -237,7 +235,7 @@ export const SearchBar = ({ [SearchQueryParams.isCaseSensitivityEnabled, isCaseSensitivityEnabled ? "true" : null], ); - if (isLoginWallEnabled && !isAuthenticated) { + if (showLoginWall) { if (query.trim().length === 0) { return; } @@ -249,11 +247,10 @@ export const SearchBar = ({ router.push(url); }, [ captureEvent, - isAuthenticated, isCaseSensitivityEnabled, - isLoginWallEnabled, isRegexEnabled, router, + showLoginWall, ]); return ( diff --git a/packages/web/src/app/(app)/search/components/searchLandingPage.tsx b/packages/web/src/app/(app)/search/components/searchLandingPage.tsx index 5ed106aa7..762e49914 100644 --- a/packages/web/src/app/(app)/search/components/searchLandingPage.tsx +++ b/packages/web/src/app/(app)/search/components/searchLandingPage.tsx @@ -9,15 +9,13 @@ import { ServiceErrorException } from "@/lib/serviceError" import { isServiceError } from "@/lib/utils" export interface SearchLandingPageProps { - isAuthenticated: boolean; - isLoginWallEnabled: boolean; isSearchAssistSupported: boolean; + showLoginWall: boolean; } export const SearchLandingPage = async ({ - isAuthenticated, - isLoginWallEnabled, isSearchAssistSupported, + showLoginWall, }: SearchLandingPageProps) => { const carouselRepos = await getRepos({ where: { @@ -42,9 +40,8 @@ export const SearchLandingPage = async ({
diff --git a/packages/web/src/app/(app)/search/components/searchResultsPage.tsx b/packages/web/src/app/(app)/search/components/searchResultsPage.tsx index a1e359ba2..8ac79ac4e 100644 --- a/packages/web/src/app/(app)/search/components/searchResultsPage.tsx +++ b/packages/web/src/app/(app)/search/components/searchResultsPage.tsx @@ -34,23 +34,21 @@ import { useFilteredMatches } from "./filterPanel/useFilterMatches"; import { SearchResultsPanel, SearchResultsPanelHandle } from "./searchResultsPanel"; interface SearchResultsPageProps { - isAuthenticated: boolean; searchQuery: string; defaultMaxMatchCount: number; isRegexEnabled: boolean; isCaseSensitivityEnabled: boolean; - isLoginWallEnabled: boolean; isSearchAssistSupported: boolean; + showLoginWall: boolean; } export const SearchResultsPage = ({ - isAuthenticated, searchQuery, defaultMaxMatchCount, isRegexEnabled, isCaseSensitivityEnabled, - isLoginWallEnabled, isSearchAssistSupported, + showLoginWall, }: SearchResultsPageProps) => { const router = useRouter(); const { setSearchHistory } = useSearchHistory(); @@ -182,9 +180,8 @@ export const SearchResultsPage = ({ query: searchQuery, }} className="w-full" - isAuthenticated={isAuthenticated} - isLoginWallEnabled={isLoginWallEnabled} isSearchAssistSupported={isSearchAssistSupported} + showLoginWall={showLoginWall} />
diff --git a/packages/web/src/app/(app)/search/page.tsx b/packages/web/src/app/(app)/search/page.tsx index ad86480a2..038646942 100644 --- a/packages/web/src/app/(app)/search/page.tsx +++ b/packages/web/src/app/(app)/search/page.tsx @@ -18,8 +18,7 @@ export default async function SearchPage(props: SearchPageProps) { const isRegexEnabled = searchParams?.isRegexEnabled === "true"; const isCaseSensitivityEnabled = searchParams?.isCaseSensitivityEnabled === "true"; const session = await auth(); - const isAuthenticated = !!session?.user; - const isLoginWallEnabled = env.EXPERIMENT_ASK_GH_ENABLED === "true"; + const showLoginWall = env.EXPERIMENT_ASK_GH_ENABLED === "true" && !session?.user; const languageModels = await getConfiguredLanguageModelsInfo(); const isSearchAssistSupported = languageModels.length > 0; @@ -27,22 +26,20 @@ export default async function SearchPage(props: SearchPageProps) { if (query === undefined || query.length === 0) { return ( ) } return ( ) } From f12f179092334ee8e034361c736f8e9e17459ecf Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 23 Sep 2026 05:45:41 +0000 Subject: [PATCH 9/9] refactor(web): move shared login dialog Co-authored-by: Michael Sukkarieh --- packages/web/src/app/(app)/components/searchBar/searchBar.tsx | 2 +- .../chat/components/chatBox => app/components}/loginDialog.tsx | 0 packages/web/src/features/chat/components/chatBox/chatBox.tsx | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename packages/web/src/{features/chat/components/chatBox => app/components}/loginDialog.tsx (100%) diff --git a/packages/web/src/app/(app)/components/searchBar/searchBar.tsx b/packages/web/src/app/(app)/components/searchBar/searchBar.tsx index de765d3a8..af75f7a98 100644 --- a/packages/web/src/app/(app)/components/searchBar/searchBar.tsx +++ b/packages/web/src/app/(app)/components/searchBar/searchBar.tsx @@ -47,7 +47,7 @@ import Link from "next/link"; import { CaseSensitiveIcon, RegexIcon, Wand2Icon } from "lucide-react"; import { SearchAssistBox } from "./searchAssistBox"; import useCaptureEvent from "@/hooks/useCaptureEvent"; -import { LoginDialog } from "@/features/chat/components/chatBox/loginDialog"; +import { LoginDialog } from "@/app/components/loginDialog"; const LANGUAGE_MODEL_DOCS_URL = "https://docs.sourcebot.dev/docs/configuration/language-model-providers"; diff --git a/packages/web/src/features/chat/components/chatBox/loginDialog.tsx b/packages/web/src/app/components/loginDialog.tsx similarity index 100% rename from packages/web/src/features/chat/components/chatBox/loginDialog.tsx rename to packages/web/src/app/components/loginDialog.tsx diff --git a/packages/web/src/features/chat/components/chatBox/chatBox.tsx b/packages/web/src/features/chat/components/chatBox/chatBox.tsx index 8ee066852..57eff7b4a 100644 --- a/packages/web/src/features/chat/components/chatBox/chatBox.tsx +++ b/packages/web/src/features/chat/components/chatBox/chatBox.tsx @@ -24,7 +24,7 @@ import { useSuggestionsData } from "./useSuggestionsData"; import { useToast } from "@/components/hooks/use-toast"; import { SearchContextQuery } from "@/lib/types"; import isEqual from "fast-deep-equal/react"; -import { LoginDialog } from "./loginDialog"; +import { LoginDialog } from "@/app/components/loginDialog"; import { usePathname } from "next/navigation"; import { ATTACHMENT_MAX_IMAGE_BYTES, ATTACHMENT_MAX_TURN_TEXT_BYTES, PENDING_CHAT_SUBMISSION_SESSION_STORAGE_KEY } from "@/features/chat/constants"; import useCaptureEvent from "@/hooks/useCaptureEvent";