Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit e504484

Browse files
committed
Show number of comments on OpenConversation button
1 parent 5702cb3 commit e504484

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/GitHub.Exports/Models/IssueishDetailModel.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,15 @@ public class IssueishDetailModel
3737
/// Gets or sets the date/time at which the issue or pull request was last updated.
3838
/// </summary>
3939
public DateTimeOffset UpdatedAt { get; set; }
40-
40+
4141
/// <summary>
4242
/// Gets or sets the comments on the issue or pull request.
4343
/// </summary>
4444
public IReadOnlyList<CommentModel> Comments { get; set; }
45+
46+
/// <summary>
47+
/// Gets or sets the number of comments on the issue or pull request.
48+
/// </summary>
49+
public int CommentCount { get; set; }
4550
}
4651
}

src/GitHub.InlineReviews/Services/PullRequestSessionService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ public virtual async Task<PullRequestDetailModel> ReadPullRequestDetail(HostAddr
313313
HeadRepositoryOwner = pr.HeadRepositoryOwner != null ? pr.HeadRepositoryOwner.Login : null,
314314
State = pr.State.FromGraphQl(),
315315
UpdatedAt = pr.UpdatedAt,
316+
CommentCount = pr.Comments(0, null, null, null).TotalCount,
316317
Comments = pr.Comments(null, null, null, null).AllPages().Select(comment => new CommentModel
317318
{
318319
Id = comment.Id.Value,

src/GitHub.VisualStudio.UI/Views/GitHubPane/PullRequestDetailView.xaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,7 @@
107107

108108
<StackPanel Orientation="Horizontal">
109109
<ghfvs:OcticonImage Margin="0 2 4 0" Foreground="{DynamicResource VsBrush.GrayText}" Width="12" Height="12" Icon="comment"/>
110-
<ghfvs:GitHubActionLink Margin="0 6" Command="{Binding OpenConversation}">
111-
<!-- TODO: Needs hook up -->
112-
42
113-
</ghfvs:GitHubActionLink>
110+
<ghfvs:GitHubActionLink Margin="0 6" Command="{Binding OpenConversation}" Content="{Binding Model.CommentCount}" />
114111
</StackPanel>
115112

116113
<Rectangle Margin="5 0" Width="1" Height="12" VerticalAlignment="Center" Style="{DynamicResource Separator}" />

0 commit comments

Comments
 (0)