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

Cody: Add status bar item #53307

Merged
merged 20 commits into from
Jun 14, 2023
Merged

Cody: Add status bar item #53307

merged 20 commits into from
Jun 14, 2023

Conversation

philipp-spiess
Copy link
Contributor

@philipp-spiess philipp-spiess commented Jun 12, 2023

Closes #52597

This PR adds a new status bar item for Cody that we can use as a global loading indicator (helpful for completions) and an easy way to enable/disable features. More features coming soon!

As a follow-up we should make sure that all of these three features can be turned on/off without having to reload the editor cc @abeatrix @lrhacker

Test plan

Screen.Recording.2023-06-12.at.17.01.03.mov

@cla-bot cla-bot bot added the cla-signed label Jun 12, 2023
@github-actions github-actions bot added the team/code-exploration Issues owned by the Code Exploration team label Jun 12, 2023
@philipp-spiess philipp-spiess self-assigned this Jun 12, 2023
@philipp-spiess philipp-spiess marked this pull request as ready for review June 12, 2023 15:05
Copy link
Contributor

@umpox umpox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

client/cody/CHANGELOG.md Outdated Show resolved Hide resolved
client/cody/src/status-bar.ts Outdated Show resolved Hide resolved
client/cody/src/status-bar.ts Outdated Show resolved Hide resolved
Co-authored-by: Tom Ross <tomross8@googlemail.com>
Copy link
Contributor

@abeatrix abeatrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update:Resolved. I had cody.suggestions enabled instead of cody.completions

Is there anything I'll need to change to get the cody icon to show up in my status bar?

image

client/cody/src/status-bar.ts Outdated Show resolved Hide resolved
client/cody/src/status-bar.ts Outdated Show resolved Hide resolved
client/cody/src/main.ts Outdated Show resolved Hide resolved
client/cody/src/status-bar.ts Outdated Show resolved Hide resolved
Co-authored-by: Beatrix <68532117+abeatrix@users.noreply.github.com>
client/cody/src/status-bar.ts Outdated Show resolved Hide resolved
philipp-spiess and others added 2 commits June 13, 2023 12:51
Co-authored-by: Beatrix <68532117+abeatrix@users.noreply.github.com>
Co-authored-by: Tom Ross <tomross8@googlemail.com>
client/cody/src/status-bar.ts Outdated Show resolved Hide resolved
@toolmantim
Copy link
Contributor

Toggling completions on and off doesn't seem to work for me…

Screen.Recording.2023-06-13.at.9.58.04.pm.mov

@philipp-spiess
Copy link
Contributor Author

@toolmantim You have to reload afterwards. I have a follow-up ticket to make it automatically reload. Will add @umpox's suggestion of a reload button for now

@philipp-spiess
Copy link
Contributor Author

@toolmantim Also it's unlikely it will work as expected in your case -- You won't see any of these features from this view 😬 .

  • We only load new chat suggestions unless you send a new message
  • You don't have code open to see completions or inline assist

@toolmantim
Copy link
Contributor

toolmantim commented Jun 13, 2023

Alright, I've just pushed up some design improvements…

Screenshot 2023-06-13 at 10 36 41 pm

The labels were taken from the package.json — they need some improvement, but that can come later.

The icon looks a little thin still… but the font lives! I'll increase the line weight of the icon a bit.

@toolmantim
Copy link
Contributor

You have to reload afterwards. I have a follow-up ticket to make it automatically reload. Will add @umpox's suggestion of a reload button for now

@philipp-spiess oh, I wasn't even talking about using the feature… more just that it doesn't seem to be affecting the actual underlying setting at all:

Screen.Recording.2023-06-13.at.10.40.44.pm.mov

@philipp-spiess
Copy link
Contributor Author

@toolmantim I can not reproduce this but I also noticed I have uncommitted changes 😶‍🌫️ Maybe that's why it works for me?

Screen.Recording.2023-06-13.at.15.04.28.mov

@toolmantim
Copy link
Contributor

@philipp-spiess has the setting been renamed? Perhaps we need to smooth migrate people across to the new setting, if it causes this bug? It would be fine to have it just reset, given it was experimental… but probably not stop you from turning it on…

Here's my Cody-related user settings JSON:

{
  "cody.experimental.chatPredictions": false,
  "cody.experimental.suggestions": true,
  "cody.experimental.inline": false,
  "cody.experimental.nonStop": true,
  "cody.debug.enable": true,
  "cody.debug.verbose": true,
  "cody.completions": false
}

@toolmantim
Copy link
Contributor

Alright! Chunkier logo is in 🏴‍☠️

Screenshot 2023-06-13 at 11 35 40 pm

@philipp-spiess
Copy link
Contributor Author

@philipp-spiess has the setting been renamed? Perhaps we need to smooth migrate people across to the new setting, if it causes this bug? It would be fine to have it just reset, given it was experimental… but probably not stop you from turning it on…

Hmm yeah that's probably it. It tried to be smart about it and enable completions when the deprecated flag value is set but I haven't considered the UI to change settings so now it will show as disabled in the UI even when it's enabled 🙃 I think we'll need to run a migration script on startup or so instead. I'll revert the change on main (Since we aren't 100% sure on the name yet + I want to push a bugfix release) and will follow up with the fixes.

Glad you found this 😬

philipp-spiess added a commit that referenced this pull request Jun 13, 2023
This reverts commit d007c1c.

Two reasons:

- We found some bugs with the migration in
#53307
- We want to make a bug fix release now and aren't settled on the name
100% yet (so I want to reduce churn)

## Test plan

- 👀 


<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
@philipp-spiess
Copy link
Contributor Author

@toolmantim Here's a final video. This looks so good now 😍

Screen.Recording.2023-06-14.at.11.45.47.mov

Comment on lines +3 to +29
export const FeedbackOptions = [
{
label: '$(feedback) Feedback',
detail: 'Have an idea, found a bug, or need help? Let us know.',
async onSelect(): Promise<void> {
await vscode.env.openExternal(
vscode.Uri.parse(
'https://github.com/sourcegraph/sourcegraph/discussions/new?category=product-feedback&labels=cody,cody/vscode'
)
)
},
},
{
label: '$(remote-explorer-documentation) Documentation',
detail: 'Search the Cody documentation.',
async onSelect(): Promise<void> {
await vscode.env.openExternal(vscode.Uri.parse('https://docs.sourcegraph.com/cody'))
},
},
{
label: '$(organization) Discord Channel',
detail: 'Join our Discord community’s #cody channel.',
async onSelect(): Promise<void> {
await vscode.env.openExternal(vscode.Uri.parse('https://discord.gg/s2qDtYGnAE'))
},
},
]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @abeatrix this is the shared stuff as that I mentioned in the Figma :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I've already added it to my PR yesterday, but if yours land first i can remove mine and merge yours 👌 #53434

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abeatrix Already landed mine 😬

@sourcegraph-bot
Copy link
Contributor

📖 Storybook live preview

@philipp-spiess philipp-spiess merged commit 16be058 into main Jun 14, 2023
23 checks passed
@philipp-spiess philipp-spiess deleted the ps/cody-statusbar-item branch June 14, 2023 10:19
ErikaRS pushed a commit that referenced this pull request Jun 22, 2023
This reverts commit d007c1c.

Two reasons:

- We found some bugs with the migration in
#53307
- We want to make a bug fix release now and aren't settled on the name
100% yet (so I want to reduce churn)

## Test plan

- 👀 


<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
ErikaRS pushed a commit that referenced this pull request Jun 22, 2023
Closes #52597

This PR adds a new status bar item for Cody that we can use as a global
loading indicator (helpful for completions) and an easy way to
enable/disable features. More features coming soon!

As a follow-up we should make sure that all of these three features can
be turned on/off without having to reload the editor cc @abeatrix
@lrhacker

## Test plan


https://github.com/sourcegraph/sourcegraph/assets/458591/ab2b5a5e-6b38-4010-92f1-1796ef0a3c10


<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

---------

Co-authored-by: Tom Ross <tomross8@googlemail.com>
Co-authored-by: Beatrix <68532117+abeatrix@users.noreply.github.com>
Co-authored-by: Tim Lucas <t@toolmantim.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed team/code-exploration Issues owned by the Code Exploration team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Completions: Implement UI to turn off/on completions
6 participants