mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 17:11:49 +00:00
RE: https://github.com/sourcegraph/sourcegraph/issues/50876 This PR addresses the issues raised by a customer and beyang ([slack thread](https://sourcegraph.slack.com/archives/C04NPH6SZMW/p1681861031576389?thread_ts=1681859730.152309&channel=C04NPH6SZMW&message_ts=1681861031.576389)) regarding cody.codebase: 1. make it visible to the user what context mechanism is being used 1. we should fall back to keyword search if embeddings don't work 1. also lack of embeddings should surface a user-visible error ### PR Summary #### Issue 1: make it visible to the user what context mechanism is being used Solution from this PR: Show the current fetching method in the lower left corner   #### Issue 2: fall back to keyword search when embedding is not available Solution from this PR: Fallback to keyword search when: - codebase is not provided - embeddings are not available for the current codebase When codebase is not provided and the cody.useContext is set to 'embedding' or 'blended', we will now fallback to use keyword search (see context fetching mode in lower left corner)  When code is provided but Cody is unable to connect to the codebase, we will now fallback to use keyword search (see context fetching mode in lower left corner)  #### Issue 4: lack of embeddings should surface a user-visible error Solution from this PR: display message on codebase change / invalid codebase in UI (see screenshots above) When the cody.codebase is change, a pop up will also show up and ask user to reload VS Code (see lower right corner):  #### other minor fix - Disable chat submission on enter key press when chat is in progress ## Test plan <!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles --> See screenshot shared above. Passed all unit test ``` PASS cody src/configuration.test.ts PASS cody src/completions/context.test.ts PASS cody src/keyword-context/local-keyword-context-fetcher.test.ts Test Suites: 3 passed, 3 total Tests: 5 passed, 5 total Snapshots: 0 total Time: 2.127 s Ran all test suites. ``` --------- Co-authored-by: Philipp Spiess <hello@philippspiess.com>
71 lines
1.9 KiB
CSS
71 lines
1.9 KiB
CSS
.inner-container {
|
|
height: 100%;
|
|
overflow: auto;
|
|
}
|
|
|
|
.transcript-item {
|
|
font-size: var(--vscode-editor-font-size);
|
|
font-family: var(--vscode-font-family);
|
|
font-weight: var(--vscode-font-weight);
|
|
color: var(--vscode-input-foreground);
|
|
border-color: var(--vscode-sideBarSectionHeader-border);
|
|
}
|
|
|
|
/* Apply a slight tint to the human transcript item. */
|
|
body[data-vscode-theme-kind='vscode-light'] .human-transcript-item,
|
|
body[data-vscode-theme-kind='vscode-high-contrast-light'] .human-transcript-item {
|
|
background-color: rgba(0, 0, 0, 0.07); /* slight dark tint */
|
|
}
|
|
body[data-vscode-theme-kind='vscode-dark'] .human-transcript-item,
|
|
body[data-vscode-theme-kind='vscode-high-contrast'] .human-transcript-item {
|
|
background-color: rgba(255, 255, 255, 0.07); /* slight light tint */
|
|
}
|
|
|
|
.transcript-item-participant {
|
|
font-size: var(--vscode-editor-font-size);
|
|
color: var(--vscode-descriptionForeground);
|
|
}
|
|
|
|
.transcript-item pre,
|
|
.transcript-item span > code,
|
|
.transcript-item p > code,
|
|
.transcript-item pre > code {
|
|
/* Our syntax highlighter emits colors intended for dark backgrounds only. */
|
|
background-color: var(--code-background);
|
|
color: var(--code-foreground);
|
|
}
|
|
|
|
.transcript-action {
|
|
background: var(--button-secondary-background);
|
|
color: var(--button-secondary-foreground);
|
|
font-size: var(--vscode-editor-font-size);
|
|
}
|
|
|
|
.code-blocks-copy-button {
|
|
color: var(--vscode-button-secondaryForeground);
|
|
background-color: var(--vscode-button-secondaryBackground);
|
|
border: none;
|
|
}
|
|
|
|
.input-row {
|
|
border-top: solid 1px var(--vscode-sideBarSectionHeader-border);
|
|
}
|
|
|
|
.chat-input-context {
|
|
color: var(--vscode-input-foreground);
|
|
}
|
|
|
|
.chat-input {
|
|
outline: none;
|
|
}
|
|
|
|
:global(.token-hallucinated) {
|
|
border-bottom: 2px solid var(--vscode-testing-iconQueued);
|
|
word-break: break-all;
|
|
}
|
|
|
|
:global(.token-not-hallucinated) {
|
|
border-bottom: 2px solid var(--vscode-testing-iconPassed);
|
|
word-break: break-all;
|
|
}
|