Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 3680503

Browse files
Update Cody Web to 0.3.7 (#64296)
closes: https://linear.app/sourcegraph/issue/SRCH-821/context-is-not-being-fetched-on-vs-code-even-though-its-being-fetched ![CleanShot 2024-08-06 at 16 13 05@2x](https://github.com/user-attachments/assets/e338865c-5949-4b18-8e2c-41afcc4abc1b) This PR updates Cody Web to 0.3.7. The latest version introduces the following changes: - Removes the Cody history panel and rather uses the tabs. (As updated in latest version on Cody Web) - Removes the `experimental.noodle` flag set to true. - Fixes the issue where the query for `getCodyContext` contained mention chips text and was different from VS Code. ## Test plan - visit /cody/chat ## Changelog
1 parent 2e642bc commit 3680503

File tree

16 files changed

+36
-455
lines changed

16 files changed

+36
-455
lines changed

client/web-sveltekit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"@sentry/sveltekit": "^8.7.0",
8181
"@sourcegraph/branded": "workspace:*",
8282
"@sourcegraph/client-api": "workspace:*",
83-
"@sourcegraph/cody-web": "^0.3.4",
83+
"@sourcegraph/cody-web": "^0.3.7",
8484
"@sourcegraph/common": "workspace:*",
8585
"@sourcegraph/http-client": "workspace:*",
8686
"@sourcegraph/shared": "workspace:*",

client/web-sveltekit/src/lib/cody/CodySidebarChat.svelte

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<script context="module" lang="ts">
2-
function getTelemetrySourceClient(): string {
3-
if (window.context?.sourcegraphDotComMode) {
4-
return 'dotcom.web'
5-
}
6-
return 'server.web'
7-
}
2+
function getTelemetrySourceClient(): string {
3+
if (window.context?.sourcegraphDotComMode) {
4+
return "dotcom.web";
5+
}
6+
return "server.web";
7+
}
88
</script>
99

1010
<script lang="ts">
1111
import { createElement } from 'react'
1212
13-
import { CodyWebChat, CodyWebChatProvider } from '@sourcegraph/cody-web'
13+
import { CodyWebPanel, CodyWebPanelProvider } from '@sourcegraph/cody-web'
1414
import { createRoot, type Root } from 'react-dom/client'
1515
import { onDestroy } from 'svelte'
1616
@@ -43,11 +43,11 @@
4343
root = createRoot(container)
4444
}
4545
46-
const chat = createElement(CodyWebChat)
46+
const chat = createElement(CodyWebPanel)
4747
const hasFileRangeSelection = lineOrPosition?.line
4848
4949
const provider = createElement(
50-
CodyWebChatProvider,
50+
CodyWebPanelProvider,
5151
{
5252
accessToken: '',
5353
chatID: $chatIDs[`${repository.id}-${filePath}`] ?? null,

client/web/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,7 @@ ts_project(
205205
"src/cody/chat/CodyPageIcon.tsx",
206206
"src/cody/chat/index.tsx",
207207
"src/cody/chat/new-chat/NewCodyChatPage.tsx",
208-
"src/cody/chat/new-chat/components/chat-history-list/ChatHistoryList.tsx",
209208
"src/cody/chat/new-chat/components/chat-ui/ChatUi.tsx",
210-
"src/cody/chat/new-chat/components/skeleton/Skeleton.tsx",
211209
"src/cody/chat/old-chat/CodyChatPage.tsx",
212210
"src/cody/codyProRoutes.tsx",
213211
"src/cody/codyRoutes.tsx",

client/web/src/cody/chat/new-chat/NewCodyChatPage.tsx

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import type { FC } from 'react'
22

33
import { Navigate } from 'react-router-dom'
44

5-
import { CodyWebHistory, CodyWebChatProvider } from '@sourcegraph/cody-web'
6-
import { ButtonLink, PageHeader, ProductStatusBadge, Text } from '@sourcegraph/wildcard'
5+
import { CodyWebPanelProvider } from '@sourcegraph/cody-web'
6+
import { ButtonLink, PageHeader, ProductStatusBadge } from '@sourcegraph/wildcard'
77

88
import { Page } from '../../../components/Page'
99
import { PageTitle } from '../../../components/PageTitle'
@@ -12,9 +12,7 @@ import { getTelemetrySourceClient } from '../../../telemetry'
1212
import { CodyProRoutes } from '../../codyProRoutes'
1313
import { CodyColorIcon } from '../CodyPageIcon'
1414

15-
import { ChatHistoryList } from './components/chat-history-list/ChatHistoryList'
1615
import { ChatUi } from './components/chat-ui/ChatUi'
17-
import { Skeleton } from './components/skeleton/Skeleton'
1816

1917
import styles from './NewCodyChatPage.module.scss'
2018

@@ -32,38 +30,14 @@ export const NewCodyChatPage: FC<NewCodyChatPageProps> = props => {
3230
<CodyPageHeader isSourcegraphDotCom={isSourcegraphDotCom} className={styles.pageHeader} />
3331

3432
<div className={styles.chatContainer}>
35-
<CodyWebChatProvider
33+
<CodyWebPanelProvider
3634
accessToken=""
3735
serverEndpoint={window.location.origin}
3836
customHeaders={window.context.xhrHeaders}
3937
telemetryClientName={getTelemetrySourceClient()}
4038
>
41-
<CodyWebHistory>
42-
{history => (
43-
<div className={styles.chatHistory}>
44-
{history.loading && (
45-
<>
46-
<Skeleton />
47-
<Skeleton />
48-
<Skeleton />
49-
</>
50-
)}
51-
{history.error && <Text>Error: {history.error.message}</Text>}
52-
53-
{!history.loading && !history.error && (
54-
<ChatHistoryList
55-
chats={history.chats}
56-
isSelectedChat={history.isSelectedChat}
57-
onChatSelect={history.selectChat}
58-
onChatDelete={history.deleteChat}
59-
onChatCreate={history.createNewChat}
60-
/>
61-
)}
62-
</div>
63-
)}
64-
</CodyWebHistory>
6539
<ChatUi className={styles.chat} />
66-
</CodyWebChatProvider>
40+
</CodyWebPanelProvider>
6741
</div>
6842
</Page>
6943
)

client/web/src/cody/chat/new-chat/components/chat-history-list/ChatHistoryList.module.scss

Lines changed: 0 additions & 65 deletions
This file was deleted.

client/web/src/cody/chat/new-chat/components/chat-history-list/ChatHistoryList.tsx

Lines changed: 0 additions & 152 deletions
This file was deleted.

client/web/src/cody/chat/new-chat/components/chat-ui/ChatUi.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import type { FC } from 'react'
22

33
import classnames from 'classnames'
44

5-
import { CodyWebChat } from '@sourcegraph/cody-web'
5+
import { CodyWebPanel } from '@sourcegraph/cody-web'
66

77
import '@sourcegraph/cody-web/dist/style.css'
88

99
import styles from './ChatUI.module.scss'
1010

1111
export const ChatUi: FC<{ className?: string }> = props => (
12-
<CodyWebChat className={classnames(styles.chat, props.className)} />
12+
<CodyWebPanel className={classnames(styles.chat, props.className)} />
1313
)

client/web/src/cody/chat/new-chat/components/skeleton/Skeleton.module.scss

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)