From 3c22a308791f6b358d1607f58fc3130ef6afa711 Mon Sep 17 00:00:00 2001 From: Beatrix Date: Fri, 22 Mar 2024 17:56:58 -0700 Subject: [PATCH 1/5] Chat: fix at symbol title --- .../promptEditor/plugins/atMentions/OptionsList.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx b/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx index 7da559873186..84f42702731d 100644 --- a/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx +++ b/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx @@ -33,13 +33,9 @@ export const OptionsList: FunctionComponent< {mentionQuery.type === 'empty' ? 'Search for a file to include, or type # for symbols...' : mentionQuery.type === 'symbol' - ? options.length > 0 + ? options.length > 0 || mentionQuery.text.length < 2 ? 'Search for a symbol to include...' - : `No symbols found${ - mentionQuery.text.length <= 2 - ? ' (try installing language extensions and opening a file)' - : '' - }` + : 'No symbols found' : options.length > 0 ? 'Search for a file to include...' : 'No files found'} From a51a08e77782da6a88fde9327ebd8910809f4e55 Mon Sep 17 00:00:00 2001 From: Beatrix Date: Mon, 25 Mar 2024 08:57:07 -0700 Subject: [PATCH 2/5] update title --- vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx b/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx index 84f42702731d..8542eb0e3e23 100644 --- a/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx +++ b/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx @@ -35,7 +35,7 @@ export const OptionsList: FunctionComponent< : mentionQuery.type === 'symbol' ? options.length > 0 || mentionQuery.text.length < 2 ? 'Search for a symbol to include...' - : 'No symbols found' + : 'No symbols found (make sure workspace symbols are available)' : options.length > 0 ? 'Search for a file to include...' : 'No files found'} From a2e831d63596a2d1b4e281f6d2b93aababeabbf4 Mon Sep 17 00:00:00 2001 From: Beatrix Date: Mon, 25 Mar 2024 10:31:11 -0700 Subject: [PATCH 3/5] Update e2e test for title change --- vscode/test/e2e/chat-atFile.test.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vscode/test/e2e/chat-atFile.test.ts b/vscode/test/e2e/chat-atFile.test.ts index e6289d529707..9c5c18919a2f 100644 --- a/vscode/test/e2e/chat-atFile.test.ts +++ b/vscode/test/e2e/chat-atFile.test.ts @@ -315,9 +315,15 @@ test.extend({ // Go back to the Cody chat tab await page.getByRole('tab', { name: 'New Chat' }).click() - // Symbol empty state + // Symbol empty state shows tooltip to search for a symbol await chatInput.fill('@#') - await expect(chatPanelFrame.getByRole('heading', { name: /No symbols found/ })).toBeVisible() + await expect( + chatPanelFrame.getByRole('heading', { name: /^Search for a symbol to include/ }) + ).toBeVisible() + + // Symbol empty symbol results updates tooltip title to show no symbols found + await chatInput.fill('@#invalide') + await expect(chatPanelFrame.getByRole('heading', { name: /^No symbols found/ })).toBeVisible() // Clicking on a file in the selector should autocomplete the file in chat input with added space await chatInput.fill('@#fizzb') From bf6ae1edefa26ded55e930fb4d21e157397c6251 Mon Sep 17 00:00:00 2001 From: Beatrix Date: Mon, 25 Mar 2024 11:12:53 -0700 Subject: [PATCH 4/5] move warning to hover tooltip --- .../plugins/atMentions/OptionsList.module.css | 4 +++ .../plugins/atMentions/OptionsList.tsx | 26 ++++++++++++------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.module.css b/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.module.css index 3099906d9927..5ca9be4f70a2 100644 --- a/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.module.css +++ b/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.module.css @@ -23,6 +23,7 @@ } .item { + display: flex; min-height: calc(var(--item-height) - 2*var(--item-padding-y)); padding: var(--item-padding-y) var(--item-padding-x); } @@ -103,3 +104,6 @@ body[data-vscode-theme-kind='vscode-high-contrast'] .option-item.selected { opacity: 0.7; } +.title-help-icon { + margin-left: 0.25rem; +} diff --git a/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx b/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx index 8542eb0e3e23..c6535426f882 100644 --- a/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx +++ b/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx @@ -30,15 +30,23 @@ export const OptionsList: FunctionComponent< return (

- {mentionQuery.type === 'empty' - ? 'Search for a file to include, or type # for symbols...' - : mentionQuery.type === 'symbol' - ? options.length > 0 || mentionQuery.text.length < 2 - ? 'Search for a symbol to include...' - : 'No symbols found (make sure workspace symbols are available)' - : options.length > 0 - ? 'Search for a file to include...' - : 'No files found'} + + {mentionQuery.type === 'empty' + ? 'Search for a file to include, or type # for symbols...' + : mentionQuery.type === 'symbol' + ? options.length > 0 || !mentionQuery.text.length + ? 'Search for a symbol to include...' + : 'No symbols found ' + : options.length > 0 + ? 'Search for a file to include...' + : 'No files found'} + + {mentionQuery.type === 'symbol' && !options.length && !!mentionQuery.text.length && ( + + )}

{options.length > 0 && ( From 2b8328718e58a92adf4e1cba6129d3116442867d Mon Sep 17 00:00:00 2001 From: Beatrix Date: Mon, 25 Mar 2024 18:44:07 -0700 Subject: [PATCH 5/5] update symbol warning text --- .../promptEditor/plugins/atMentions/OptionsList.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx b/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx index c6535426f882..2b9531ed988e 100644 --- a/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx +++ b/vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx @@ -36,17 +36,14 @@ export const OptionsList: FunctionComponent< : mentionQuery.type === 'symbol' ? options.length > 0 || !mentionQuery.text.length ? 'Search for a symbol to include...' - : 'No symbols found ' + : 'No symbols found' + + (mentionQuery.text.length > 1 + ? ' (language extensions may be loading)' + : '') : options.length > 0 ? 'Search for a file to include...' : 'No files found'} - {mentionQuery.type === 'symbol' && !options.length && !!mentionQuery.text.length && ( - - )}
{options.length > 0 && (