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

fix copilot insertion so it doesn't wipe existing query text #1803

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

analogrelay
Copy link
Contributor

@analogrelay analogrelay commented Apr 17, 2024

Preview this branch

This is a fix for an issue I noticed (and that we've had some customer feedback on) with Copilot query insertion. The current version of the copilot insertion logic will replace the active query in some circumstances. It's notable that after the first result replaces the query, we do properly add the query to the end in further copilot invocations:

Note: It's worth noting that with Undo fixed, you can undo that replacement, which you'll see me doing at the end of the video

recording-before-fix.mp4

With this fix, the query is now always inserted at the end of the document. It's possible we could insert it at the cursor position but that's a fair bit more work. This seems a little less surprising to me than replacing the entire query:

recording-after-fix.mp4

In looking into this, I noticed that we only append the copilot response to the end if and only if there is a previous generated query. That logic didn't seem correct to me. It seems like we should always insert the copilot response at the end. However, I don't have the history or context to understand why that choice was made originally, or if it was just an error. So if I'm misunderstanding something here, I'm happy to look in to other approaches! This fix seems to do the trick though, and ensure that we're always appending copilot responses to the end.

@analogrelay analogrelay marked this pull request as ready for review April 17, 2024 17:47
@analogrelay analogrelay requested a review from a team as a code owner April 17, 2024 17:47
@analogrelay
Copy link
Contributor Author

Note: We've had some specific customer reports about this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants