From 55525a0f2697ce8a8b0614e53c3170ca0e30f4f9 Mon Sep 17 00:00:00 2001 From: helen229 Date: Wed, 6 May 2026 12:27:22 -0700 Subject: [PATCH 1/2] Fix #15421: Reduce excess whitespace in Copilot-generated APIView comments 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. --- .../APIViewWeb/HostedServices/CopilotJobProcessor.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/dotnet/APIView/APIViewWeb/HostedServices/CopilotJobProcessor.cs b/src/dotnet/APIView/APIViewWeb/HostedServices/CopilotJobProcessor.cs index ebd43ce979f..eec3f6cd67c 100644 --- a/src/dotnet/APIView/APIViewWeb/HostedServices/CopilotJobProcessor.cs +++ b/src/dotnet/APIView/APIViewWeb/HostedServices/CopilotJobProcessor.cs @@ -128,22 +128,19 @@ public async Task ProcessJobAsync(AIReviewJobInfoModel jobInfo, CancellationToke var commentText = new StringBuilder(); commentText.AppendLine(comment.Comment); - commentText.AppendLine(); - commentText.AppendLine(); if (!String.IsNullOrEmpty(comment.Suggestion)) { - commentText.AppendLine($"Suggestion : `{comment.Suggestion}`"); - commentText.AppendLine(); commentText.AppendLine(); + commentText.AppendLine($"Suggestion : `{comment.Suggestion}`"); } if (comment.GuidelineIds.Count > 0) { + commentText.AppendLine(); commentText.AppendLine("**Guidelines**"); foreach (string guidelineId in comment.GuidelineIds) { - commentText.AppendLine(); - commentText.AppendLine($"https://azure.github.io/azure-sdk/{guidelineId}"); + commentText.AppendLine($"- https://azure.github.io/azure-sdk/{guidelineId}"); } } From 66e7fa7983fbe1741b24136b3ae2b9326960924c Mon Sep 17 00:00:00 2001 From: Helen Gao Date: Wed, 6 May 2026 12:46:24 -0700 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../APIView/APIViewWeb/HostedServices/CopilotJobProcessor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dotnet/APIView/APIViewWeb/HostedServices/CopilotJobProcessor.cs b/src/dotnet/APIView/APIViewWeb/HostedServices/CopilotJobProcessor.cs index eec3f6cd67c..dd6201f785a 100644 --- a/src/dotnet/APIView/APIViewWeb/HostedServices/CopilotJobProcessor.cs +++ b/src/dotnet/APIView/APIViewWeb/HostedServices/CopilotJobProcessor.cs @@ -134,11 +134,11 @@ public async Task ProcessJobAsync(AIReviewJobInfoModel jobInfo, CancellationToke commentText.AppendLine($"Suggestion : `{comment.Suggestion}`"); } - if (comment.GuidelineIds.Count > 0) + if (commentModel.GuidelineIds.Count > 0) { commentText.AppendLine(); commentText.AppendLine("**Guidelines**"); - foreach (string guidelineId in comment.GuidelineIds) + foreach (string guidelineId in commentModel.GuidelineIds) { commentText.AppendLine($"- https://azure.github.io/azure-sdk/{guidelineId}"); }