From 26c872cb77e82734efc187d83acfe8e2ef019f25 Mon Sep 17 00:00:00 2001 From: Vova Kulikov Date: Wed, 26 Jun 2024 16:50:25 -0300 Subject: [PATCH] Fix initial context for Cody Web on the repository page (#63497) Closes https://linear.app/sourcegraph/issue/SRCH-620/cody-web-has-incorrect-initial-context-on-blank-repository-page ## Test plan - Go to the repository root and open Cody Web, it should have only repository as the initial context --- .../src/cody/sidebar/new-cody-sidebar/NewCodySidebarWebChat.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/web/src/cody/sidebar/new-cody-sidebar/NewCodySidebarWebChat.tsx b/client/web/src/cody/sidebar/new-cody-sidebar/NewCodySidebarWebChat.tsx index 83ffd0b5ee7..07669565cbc 100644 --- a/client/web/src/cody/sidebar/new-cody-sidebar/NewCodySidebarWebChat.tsx +++ b/client/web/src/cody/sidebar/new-cody-sidebar/NewCodySidebarWebChat.tsx @@ -35,7 +35,7 @@ export const NewCodySidebarWebChat: FC = memo(functi const contextInfo = useMemo( () => ({ repositories: [repository], - fileURL: `/${filePath}`, + fileURL: filePath ? `/${filePath}` : undefined, }), [repository, filePath] )