-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat: generate code suggestions via AI #90
Conversation
src/content-scripts/components/AICodeRefactor/ChangeSuggestorButton.ts
Outdated
Show resolved
Hide resolved
Apparently, adding a delay to DOM manipulation did the trick. Maybe some small details can still be changed, but this should work overall (at least for single reviews). |
I won't be able to review for another hour l. Can you a gif of this working with code. |
We can continue to develop this (in future prs). Doesn't have to be correct now, is the beauty of machine learning. In a future PR, we can add a "was this helpful link" or similar 👍or👎buttons |
This is weird, what about |
@open-sauced/triage team, want to check this out and see if it works for you? |
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.
export const ChangeSuggestorButton = (commentNode: HTMLElement) => {
const changeSuggestorButton = createHtmlElement("a", {
innerHTML: `
<span id="ai-change-gen" class="toolbar-item btn-octicon">
<img class="octicon octicon-heading" height="16px" width="16px" id="ai-description-button-logo" src=${chrome.runtime.getURL(openSaucedLogoIcon)}>
</span>
<tool-tip for="ai-change-gen" class="sr-only" role="tooltip">Get Refactor Suggestions</tool-tip>
`, being returned.ified the onclick event by removing the async/await as it doesn't seem necessary.
- Formatted the code for better readability.
Description generated using [OpenSauced](https://opensauced.ai/).
- Simpl
onclick: () => handleSubmit(commentNode),
});
return changeSuggestorButton;
};
- Added a return statement to the function to make it more clear what is
@bdougie does hard refresh work for you? I have started working on the endpoint for this feature. |
No. I wonder if it is because I have another extension installed. https://chrome.google.com/webstore/detail/gifs-for-github/dkgjnpbipbdaoaadbdhpiokaemhlphep |
Did you try disabling the GIF extension once? If we decide that's the issue, maybe I can look at the conflict (shouldn't be important in that case though). |
Not working for me even after turning off all other extensions. There is only a pull-request-.100.open-sauced_ai.mp4 |
Is there something relevant in the console? @takanome-dev |
No, there is nothing in there 🤷♀️ |
Super weird, I'm confused about how to debug this🤔 Can someone who can reproduce volunteer? I'm open for a discord call too. |
I tried the last updates, and it's not working right now, not sure how it worked before. @diivi I would love to have a call to debug it together. |
@a0m0rajab Right now, does the button appear for you? If it does, then it's fine, the suggestion won't appear for some time because the API endpoint is not live, so you'd be getting a 404 error. If even the button does not appear, we can debug anytime you're free in the next 4 hours. |
Nope, even the button is not visible right now, I changed branches and it stopped working. (I could not make it appear even if I went back with commits) |
@bdougie and @takanome-dev can you test if the button shows up now? The refactor might not work until we have the refactor endpoint in production on |
We will probably see it get released a little later today. @brandonroberts let us know when it goes live. https://beta.api.opensauced.pizza/#/Pull%20Requests%20service/generateCodeRefactor update: https://github.com/open-sauced/api.opensauced.pizza/pull/172 |
The button now shows. |
API release is merged, waiting on deployment |
@bdougie does it work for you? |
Could you update the docs.opensauced.pizza to include steps on how to leverage this feature. I think we are good to go. |
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.
Look forward to shipping this live!
🎉 This PR is included in version 1.2.0-beta.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
## [1.2.0](v1.1.0...v1.2.0) (2023-05-25) ### 🧑💻 Code Refactoring * improved-extension-navigation ([#99](#99)) ([5b2f5c1](5b2f5c1)) ### 📝 Documentation * dev docs ([#83](#83)) ([4eff6eb](4eff6eb)) ### 🐛 Bug Fixes * adds demo to readme ([c27e614](c27e614)) * bump manifest version on main only ([#124](#124)) ([e4a86e4](e4a86e4)) * duplicate-button-injections using guards ([#110](#110)) ([3978766](3978766)) ### 🍕 Features * add PR velocity to profile page ([#111](#111)) ([ba7fad6](ba7fad6)) * generate code suggestions via AI ([#90](#90)) ([14eede1](14eede1)), closes [#104](#104) * Manifest.json version bump ([#120](#120)) ([488046b](488046b)) * Resources page to link users to open-sauced feedback/discussions ([#100](#100)) ([3d607ae](3d607ae))
🎉 This PR is included in version 1.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
## [1.2.0-beta.3](open-sauced/ai@v1.2.0-beta.2...v1.2.0-beta.3) (2023-05-23) ### 🍕 Features * generate code suggestions via AI ([#90](open-sauced/ai#90)) ([14eede1](open-sauced/ai@14eede1)), closes [#104](open-sauced/ai#104)
## [1.2.0](open-sauced/ai@v1.1.0...v1.2.0) (2023-05-25) ### 🧑💻 Code Refactoring * improved-extension-navigation ([#99](open-sauced/ai#99)) ([5b2f5c1](open-sauced/ai@5b2f5c1)) ### 📝 Documentation * dev docs ([#83](open-sauced/ai#83)) ([4eff6eb](open-sauced/ai@4eff6eb)) ### 🐛 Bug Fixes * adds demo to readme ([c27e614](open-sauced/ai@c27e614)) * bump manifest version on main only ([#124](open-sauced/ai#124)) ([e4a86e4](open-sauced/ai@e4a86e4)) * duplicate-button-injections using guards ([#110](open-sauced/ai#110)) ([3978766](open-sauced/ai@3978766)) ### 🍕 Features * add PR velocity to profile page ([#111](open-sauced/ai#111)) ([ba7fad6](open-sauced/ai@ba7fad6)) * generate code suggestions via AI ([#90](open-sauced/ai#90)) ([14eede1](open-sauced/ai@14eede1)), closes [#104](open-sauced/ai#104) * Manifest.json version bump ([#120](open-sauced/ai#120)) ([488046b](open-sauced/ai@488046b)) * Resources page to link users to open-sauced feedback/discussions ([#100](open-sauced/ai#100)) ([3d607ae](open-sauced/ai@3d607ae))
In action (except the duplicate buttons):
I need to take care of some weird DOM-watching stuff; after that, this should be ready to merge.
The Generator button is disappearing randomly right now, maybe something to do with how the watcher is set up.