-
Notifications
You must be signed in to change notification settings - Fork 240
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
Show notice on first autocomplete #1071
Conversation
Resurrected 1100db6 as this PR, and added generic notice dismissal tracking support using local storage. The only missing piece of updating the state when the autocomplete is accepted for the first time. Screen.Recording.2023-09-15.at.1.56.42.pm.mov |
5ad00df
to
8acb345
Compare
@toolmantim I pushed changes to trigger this from inline completion instead of the timeout. I also added a test to ensure the event is only triggered for the first one. There aren't any tests that the event actually triggers the notice though - do you have any pointers for how this could be done? |
@philipp-spiess @abeatrix any pointers? |
Hmm two ideas:
|
@@ -39,6 +41,7 @@ export interface CodyCompletionItemProviderConfig { | |||
tracer?: ProvideInlineCompletionItemsTracer | null | |||
contextFetcher?: (options: GetContextOptions) => Promise<GetContextResult> | |||
featureFlagProvider: FeatureFlagProvider | |||
sidebarChatProvider: ChatViewProvider | null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of the hard dependency on the chat view provider, what do you think about just passing a triggerNotice
callback here? Should make testing a bit simpler too since we don't need to mock the class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Thanks! I've added a new e2e test that works similar to that one. A lot of this is new to me so I don't know if I've taken the right approach - feel free to nitpick if there are things that can be improved :-) I also merged main and resolved the conflicts - one in |
@DanTup The test works great! Thank you so much for it. Do you know how to reset the local storage locally? I was trying to see the notice in my dev build but wasn't able to. I tried to remove the The thing I wanted to see is how this works when you trigger the first autocomplete request when the sidebar is hidden. |
Heh, no I don't - I was doing it by just rigging the code when running it. Seems like there should be a way, but I'm not sure where it's stored - I'll have a dig.
Good question - I hadn't thought about that. What's the desired behaviour - automatically show the sidebar, do nothing (and leave the notice there until the user switches and sees it), or don't trigger the notification at all? |
I think that's for @toolmantim to decide. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noice
For me (Windows), deleting Line 43 in 57dd0b0
However this will clear a load of stuff from your VS Code instance for all extensions. A better option will be to use the "separate instance" launch config: This gives you a clean session each time (because it uses |
Seems like the tests on the bot are stalling, but I'm not sure why:
Running |
@DanTup @philipp-spiess automatically show the sidebar for now. Given this is only once and it's onboarding, I think it's okay to drag people back in. But if we test this out and it's annoying or problematic let's look at switching to a native notification w/ a button (to bring people back into the next onboarding task) |
Thank you so much @DanTup for getting this ready, and @philipp-spiess for reviewing. I gave it a test locally and works perfectly. I added showing the chat (in a way that doesn't steal focus), and a changelog entry. This is good to go! |
This works great now! Amazing work to both of you 🙇 |
Adds a notice in the chat view when the user first accepts an autocomplete, helping to show them that an autocomplete has happened, and nudge them towards the next step of onboarding.
Test plan