[APIView] Fix excess whitespace in Copilot-generated comments (#15421)#15528
Open
[APIView] Fix excess whitespace in Copilot-generated comments (#15421)#15528
Conversation
…ments The conversion from AVC results to APIView CommentItemModel emitted three CRLFs (two blank lines) between the comment body and the Suggestion / Guidelines sections, and an extra blank line between each guideline link. In rendered markdown that produced large gaps inside the comment card. Use a single blank line as a paragraph separator and render guideline links as a markdown bullet list so they render compactly without blank lines between items.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refines how APIView Copilot job results are converted into persisted CommentItemModel.CommentText markdown, reducing excess blank lines and rendering guideline links more compactly in the UI.
Changes:
- Removed extra paragraph separators when composing Copilot-generated comment text.
- Rendered guideline links as a Markdown bullet list to avoid blank lines between consecutive links.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
tjprescott
reviewed
May 6, 2026
Member
tjprescott
left a comment
There was a problem hiding this comment.
Please provide a screenshot of a new comment with multiple guidelines cited so we can see what it looks like.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15421
Problem
When
CopilotJobProcessorconverts AVC (APIView Copilot) job results intoCommentItemModelrows, it builds the comment markdown with three consecutiveAppendLinecalls between sections and an extraAppendLine()before each guideline URL. The persisted comment text looks like:In the rendered comment card that produces two blank lines between the body and the Guidelines heading, and a blank line between every guideline link, making the card unnecessarily tall and sparse.
Fix
In src/dotnet/APIView/APIViewWeb/HostedServices/CopilotJobProcessor.cs the comment text builder now:
AppendLine()) as the paragraph separator before theSuggestionand**Guidelines**sections.- https://…) so consecutive links are rendered compactly with no blank line between items.No behavior changes outside of the rendered comment text.
Why existing comments on staging/prod won't visibly change
The fix runs at write time — it only affects the markdown that is persisted to Cosmos when a Copilot job result is converted into a
CommentItemModel. Comments that were generated before this change (including the one shown in the issue) are already stored in the DB with the old whitespace and are rendered verbatim, so they will continue to look the same.To verify the fix you have to look at a newly generated AI comment — i.e. trigger a fresh Copilot review on a revision after this change is deployed. If we want to clean up the historical comments as well, that has to be done as a separate one-off DB rewrite (out of scope for this PR / issue).