Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat: fix at symbol title #3531

Merged
merged 5 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions vscode/test/e2e/chat-atFile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,15 @@ test.extend<ExpectedEvents>({
// 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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
}
27 changes: 14 additions & 13 deletions vscode/webviews/promptEditor/plugins/atMentions/OptionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,20 @@ export const OptionsList: FunctionComponent<
return (
<div className={styles.container}>
<h3 className={classNames(styles.item, styles.helpItem)}>
{mentionQuery.type === 'empty'
? 'Search for a file to include, or type # for symbols...'
: mentionQuery.type === 'symbol'
? options.length > 0
? 'Search for a symbol to include...'
: `No symbols found${
mentionQuery.text.length <= 2
? ' (try installing language extensions and opening a file)'
: ''
}`
: options.length > 0
? 'Search for a file to include...'
: 'No files found'}
<span>
{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' +
(mentionQuery.text.length > 1
? ' (language extensions may be loading)'
: '')
: options.length > 0
? 'Search for a file to include...'
: 'No files found'}
</span>
<br />
</h3>
{options.length > 0 && (
Expand Down
Loading