-
Notifications
You must be signed in to change notification settings - Fork 221
[API View] Feedback mechanism for AI Generated comments #12786
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR implements a feedback collection mechanism for AI-generated comments in the API review system. When users downvote or delete AI-generated comments, they are prompted to provide feedback about why the comment was unhelpful.
Key changes:
- Added a new feedback dialog component for collecting user feedback on AI comments
- Integrated feedback collection into the downvote and delete workflows for AI-generated comments
- Created backend API endpoint and data models to store feedback
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ai-comment-feedback-dialog.component.ts | New component implementing the feedback dialog UI and logic |
| ai-comment-feedback-dialog.component.html | Template for the feedback dialog with checkboxes and text input |
| ai-comment-feedback-dialog.component.scss | Styling for the feedback dialog |
| ai-comment-feedback-dialog.component.spec.ts | Unit tests for the feedback dialog component |
| comment-thread.component.ts | Modified to intercept AI comment downvotes/deletes and show feedback dialog |
| comment-thread.component.html | Added feedback dialog to the comment thread template |
| comments.service.ts | Added service method to submit feedback to backend API |
| review-page-layout.module.ts | Registered the new feedback dialog component |
| commentThreadUpdateDto.ts | Added AICommentFeedback interface |
| CommentsController.cs | Added API endpoint for submitting comment feedback |
| CommentsManager.cs | Added manager method to process and store feedback |
| CommentItemModel.cs | Added CommentFeedback model to store feedback data |
| CommentFeedbackRequest.cs | New request model for feedback API |
| ICommentsManager.cs | Added interface method for feedback submission |
...tnet/APIView/ClientSPA/src/app/_components/shared/comment-thread/comment-thread.component.ts
Outdated
Show resolved
Hide resolved
…t-thread/comment-thread.component.ts Co-authored-by: Copilot <[email protected]>
…lMendez/azure-sdk-tools into downvote--delete-feedback
|
/azp run |
|
You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list. |
|
/azp run APIView-CI |
|
No pipelines are associated with this pull request. |
|
/azp run APIView - CI |
|
Azure Pipelines successfully started running 1 pipeline(s). |
@AlitzelMendez this is no longer true, right?
|
tjprescott
left a comment
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.
I think we should store the "reasons" as enums. The dialog should also appear when using bulk resolution (currently on UX Test it doesn't).
| public string Comment { get; set; } = string.Empty; | ||
| public bool IsDelete { get; set; } | ||
| public string SubmittedBy { get; set; } | ||
| public DateTime? SubmittedOn { get; set; } |
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.
Why is this optional?
| public List<string> MemoryIds { get; set; } = []; | ||
| public float ConfidenceScore { get; set; } | ||
|
|
||
| public List<CommentFeedback> Feedback { get; set; } = []; |
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.
This should probably be nullable. Since it only even applies to AI-generated comments, there's no point storing even empty list for non-AI comments.
| { | ||
| public class CommentFeedbackRequest | ||
| { | ||
| public List<string> Reasons { get; set; } = new(); |
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.
My gut tells me we should store these as enums, as that will allow copilot to take deterministic action instead of having to parser intent.
| readonly feedbackReasons = [ | ||
| 'This comment is factually incorrect', | ||
| 'This is an APIView rendering bug', | ||
| 'This is an accepted APIView rendering choice', | ||
| 'This is an accepted SDK design pattern', | ||
| 'The guideline cited here is out-of-date' | ||
| ]; |
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.
I think we should map these to enum values and store them as such.
like when clicking thumbs down inside the bulk resolution dialog, trigger this feedback pop up? @ccbarragan could you provide your feedback in here? what would be a good way to integrate this on the bulk resolution? |
Yes. Bulk resolution is supposed to be the same as repeating the process for each item, so if downvoting an individual item triggers the dialogue, then so should downvoting a batch. |
Oh yes! I just want to think about ways to implement this… Should we create another pop-up? Expand a window inside the same pop-up? Add a small window to the right? Remove the option to provide more comments (since they already have the comment window) and instead show a small, clean window with options stating that it’s required to select at least one option—but they don’t need to click Submit? well but they can select more than one! I will try to mock this ideas tomorrow morning |
|
@ccbarragan here are some suggestions/questions Inline Feedback SectionIn this one we have the control of, if you selected downvote you have to provide a reason, the button gets disable after clicking downvote. It makes the experience harder, but we guarantee feedback if thumb down is provided bulk_resolve_feedback_option1.mp4Feedback After ResolveThis one is a more common pattern, but I think everyone is going to close it, not providing feedback and we will be on a weird place of, should we not downvote then? which is not going to be clear/easily visible bulk_resolve_feedback_option2.mp4Layered DialogNow that I see implemented it looks good! :) but still I have the question if this is a good/acceptable user experience. The workflow would be similar at the current one, if not reason provided.... the thumbs downs don't persist bulk_resolve_feedback_option3.mp4 |
|
@AlitzelMendez thanks for these! I think we should consider whether we want bulk operations to be like one big transaction or discrete. The answer I think helps inform which approach is the "right" one. |
|
@AlitzelMendez awesome explorations! shared some thoughts at our UX sync today. My preference on the three would be the first option inline feedback section, but displaying the feedback checkbox list after message / thumbs down / input field (instead of above). |


closes: #12464
Implements optional feedback collection when users downvote or delete AI-generated comments to help improve AI comment quality.
When users interact negatively with AI-generated comments (downvote 👎 or delete 🗑️), a feedback dialog appears asking why. Users must select at least one reason from 4 predefined options and can optionally provide additional details.
Feedback Options:
Key Behavior
Changes
Frontend:
Backend:
POST /comments/{reviewId}/{commentId}/feedbackCommentItemModel.FeedbackpropertyDemo
feedback_demo.mp4