Visitar URL original
Pull Request conversation view by grokys · Pull Request #2017 · github/VisualStudio · GitHub
Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
38cae06
Show document pane for PR conversation.
grokys Oct 26, 2018
50b04ac
Display PR details in document pane.
grokys Oct 26, 2018
cfb1dd3
Initial implementation of PR conversation view.
grokys Oct 26, 2018
02bc4ee
Display sample data in PR conversation page.
grokys Oct 30, 2018
102e337
Load PR timeline from GraphQL.
grokys Oct 30, 2018
424439d
Show commit in TE when OID clicked.
grokys Oct 31, 2018
f976412
Display PR title as pane caption.
grokys Nov 1, 2018
abeb1b8
Display an "Add comment" box at the bottom of a PR.
grokys Nov 1, 2018
b724525
Change close issue caption when comment has body.
grokys Nov 1, 2018
d296739
Implement posting PR comments.
grokys Nov 5, 2018
0b91c87
Disable comment view while submitting.
grokys Nov 5, 2018
1200c4c
Jiggled the comment thread hierachy a little.
grokys Nov 5, 2018
057c4e4
Merge branch 'master' into feature/pr-conversation
grokys Nov 5, 2018
fe66df5
Fix up comment view models after merge.
grokys Nov 5, 2018
a8d4da6
Correctly add new comments.
grokys Nov 5, 2018
d246ad2
Make PR conversation tool windows multi-instance.
grokys Nov 5, 2018
6165f30
Fix UI for closed PRs.
grokys Nov 5, 2018
996aac3
Display commit count.
grokys Nov 5, 2018
6da33e6
Implement closing/reopening a PR.
grokys Nov 8, 2018
c3f9778
Merge branch 'master' into feature/pr-conversation
grokys Nov 9, 2018
1308c0e
Implemented edit/delete of comments.
grokys Nov 14, 2018
6e88e35
Append "commented" after author name
donokuda Nov 16, 2018
8697cb7
Tweak header spacing
donokuda Nov 16, 2018
624b5be
Make it boxy
donokuda Nov 16, 2018
d7d5969
Space it out a bit
donokuda Nov 16, 2018
d12b441
More indenting and layout madness
donokuda Nov 16, 2018
a03c85f
Lighten up the commit octicon
donokuda Nov 16, 2018
aeb7c45
Indent comment body
donokuda Nov 16, 2018
b508e6a
Nudge things around
donokuda Nov 19, 2018
39d0b5f
Standardizing all the spacing
donokuda Nov 19, 2018
b317753
Adjust top margin
donokuda Nov 19, 2018
7ebcfb9
Adjust vertical margins for reply prompt box
donokuda Nov 19, 2018
815ee14
nudge left margin
donokuda Nov 19, 2018
7535c64
Make things better for dark theme
donokuda Nov 20, 2018
1d57ce8
Update separator colors
donokuda Nov 20, 2018
8340942
Merge pull request #2070 from github/donokuda/polish-conversation-view
grokys Nov 22, 2018
7b6a032
Finish off display of commit list w/caption.
grokys Nov 22, 2018
5308404
Theming
donokuda Dec 11, 2018
01676fe
Merge branch 'master' into feature/pr-conversation
grokys Jan 17, 2019
ed0b3a4
Start styling the top comment
donokuda Jan 25, 2019
448ccac
Octicon in a circle yaaaaaa
donokuda Jan 25, 2019
3ca7340
Tweak layout for commit list
donokuda Jan 25, 2019
2ae522c
Decrease the size of the avatar
donokuda Jan 25, 2019
4edf726
Adjust padding
donokuda Jan 26, 2019
6ac2d95
lol at least i tried
donokuda Jan 26, 2019
8f327c2
Octicon timeline theming
donokuda Feb 5, 2019
dc8a865
Let's not be too bold, now
donokuda Feb 5, 2019
5be7e2f
Merge branch 'master' into feature/pr-conversation
grokys Feb 5, 2019
72fb28b
Merge branch 'feature/pr-conversation' into donokuda/pr-polish
grokys Feb 5, 2019
e307b36
Fake it
donokuda Feb 5, 2019
d3caa17
Remove the description section
donokuda Feb 5, 2019
abb4661
Refactored comment views.
grokys Feb 6, 2019
a28d75a
Move around conversation button
donokuda Feb 6, 2019
b1b49a3
Record # of PR conversation views opened.
grokys Feb 7, 2019
e10d6fb
Always leave a note
donokuda Feb 7, 2019
84dd7ff
Hook up "View conversation" in PR details pane.
grokys Feb 8, 2019
08bfdc9
Merge branch 'donokuda/pr-pane' into feature/pr-conversation
grokys Feb 8, 2019
d8cf315
Limit to 100 repos per org (fix bad merge)
jcansdale Feb 12, 2019
d05a0ce
Stub out comment count and view on github links
donokuda Feb 13, 2019
8e42868
Add comment octicon and leave some notes around
donokuda Feb 13, 2019
4bdfa13
Add back in the description section
donokuda Feb 13, 2019
c8579c8
Bump spacing
donokuda Feb 13, 2019
5958982
Collapse sections
donokuda Feb 13, 2019
5702cb3
Hook up "View on GitHub" link
jcansdale Feb 19, 2019
e504484
Show number of comments on OpenConversation button
jcansdale Feb 19, 2019
ae6935a
Don't collapse Reviewers or Checks sections
jcansdale Feb 19, 2019
17f3f93
Set the pull request WebUrl and OpenOnGitHub
jcansdale Feb 19, 2019
3f43625
Allow pull request title to wrap
jcansdale Feb 19, 2019
abce76d
Merge pull request #2229 from github/donokuda/moving-some-cheese
jcansdale Feb 20, 2019
a8df4e6
Merge branch 'master' into feature/pr-conversation
jcansdale Feb 20, 2019
fd9eab5
Disabling automatic focus
StanleyGoldman Feb 20, 2019
f144895
Removing left over event handler
StanleyGoldman Feb 20, 2019
89f33ac
Shouldn't need the nuget package for octokit.graphql anymore
StanleyGoldman Feb 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/GitHub.App/ViewModels/Documents/PullRequestPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class PullRequestPageViewModel : PullRequestViewModelBase, IPullRequestPa
readonly IPullRequestService service;
readonly IPullRequestSessionManager sessionManager;
readonly ITeamExplorerServices teServices;
readonly IVisualStudioBrowser visualStudioBrowser;
readonly IUsageTracker usageTracker;
ActorModel currentUserModel;
ReactiveList<IViewModel> timeline = new ReactiveList<IViewModel>();
Expand All @@ -37,22 +38,26 @@ public PullRequestPageViewModel(
IPullRequestService service,
IPullRequestSessionManager sessionManager,
ITeamExplorerServices teServices,
IVisualStudioBrowser visualStudioBrowser,
IUsageTracker usageTracker)
{
Guard.ArgumentNotNull(factory, nameof(factory));
Guard.ArgumentNotNull(service, nameof(service));
Guard.ArgumentNotNull(sessionManager, nameof(sessionManager));
Guard.ArgumentNotNull(visualStudioBrowser, nameof(visualStudioBrowser));
Guard.ArgumentNotNull(teServices, nameof(teServices));

this.factory = factory;
this.service = service;
this.sessionManager = sessionManager;
this.teServices = teServices;
this.visualStudioBrowser = visualStudioBrowser;
this.usageTracker = usageTracker;

timeline.ItemsRemoved.Subscribe(TimelineItemRemoved);

ShowCommit = ReactiveCommand.CreateFromTask<string>(DoShowCommit);
OpenOnGitHub = ReactiveCommand.Create(DoOpenOnGitHub);
}

/// <inheritdoc/>
Expand Down Expand Up @@ -198,6 +203,11 @@ async Task DoShowCommit(string oid)
teServices.ShowCommitDetails(oid);
}

void DoOpenOnGitHub()
{
visualStudioBrowser.OpenUrl(WebUrl);
}

void TimelineItemRemoved(IViewModel item)
{
(item as IDisposable)?.Dispose();
Expand Down
4 changes: 2 additions & 2 deletions src/GitHub.App/ViewModels/IssueishViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ public string Title
public Uri WebUrl
{
get { return webUrl; }
private set { this.RaiseAndSetIfChanged(ref webUrl, value); }
protected set { this.RaiseAndSetIfChanged(ref webUrl, value); }
}

/// <inheritdoc/>
public ReactiveCommand<Unit, Unit> OpenOnGitHub { get; }
public ReactiveCommand<Unit, Unit> OpenOnGitHub { get; protected set; }

protected Task InitializeAsync(
RemoteRepositoryModel repository,
Expand Down
2 changes: 2 additions & 0 deletions src/GitHub.App/ViewModels/PullRequestViewModelBase.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.ComponentModel.Composition;
using System.Threading.Tasks;
using GitHub.Extensions;
using GitHub.Logging;
using GitHub.Models;
using ReactiveUI;
Expand Down Expand Up @@ -59,6 +60,7 @@ protected virtual async Task InitializeAsync(
State = model.State;
SourceBranchDisplayName = GetBranchDisplayName(fork, model.HeadRepositoryOwner, model.HeadRefName);
TargetBranchDisplayName = GetBranchDisplayName(fork, model.BaseRepositoryOwner, model.BaseRefName);
WebUrl = localRepository.CloneUrl.ToRepositoryUrl().Append("pull/" + Number);
}

static string GetBranchDisplayName(bool isFromFork, string owner, string label)
Expand Down
7 changes: 6 additions & 1 deletion src/GitHub.Exports/Models/IssueishDetailModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ public class IssueishDetailModel
/// Gets or sets the date/time at which the issue or pull request was last updated.
/// </summary>
public DateTimeOffset UpdatedAt { get; set; }

/// <summary>
/// Gets or sets the comments on the issue or pull request.
/// </summary>
public IReadOnlyList<CommentModel> Comments { get; set; }

/// <summary>
/// Gets or sets the number of comments on the issue or pull request.
/// </summary>
public int CommentCount { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ public virtual async Task<PullRequestDetailModel> ReadPullRequestDetail(HostAddr
HeadRepositoryOwner = pr.HeadRepositoryOwner != null ? pr.HeadRepositoryOwner.Login : null,
State = pr.State.FromGraphQl(),
UpdatedAt = pr.UpdatedAt,
CommentCount = pr.Comments(0, null, null, null).TotalCount,
Comments = pr.Comments(null, null, null, null).AllPages().Select(comment => new CommentModel
{
Id = comment.Id.Value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<d:DesignData.DataContext>
<ghfvs:PullRequestPageViewModelDesigner/>
</d:DesignData.DataContext>

<Control.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
Expand Down Expand Up @@ -42,6 +42,7 @@

<TextBlock Margin="0 8"
Foreground="{DynamicResource VsBrush.WindowText}"
TextWrapping="Wrap"
Style="{DynamicResource {x:Static vsui:VsResourceKeys.TextBlockEnvironment200PercentFontSizeStyleKey}}">
<Run Text="{Binding Title, Mode=OneWay}"/>
<Hyperlink Command="{Binding OpenOnGitHub}">
Expand Down Expand Up @@ -113,7 +114,7 @@
CornerRadius="3"
Padding="2 1"
Visibility="{Binding IsPending, Converter={ui:BooleanToVisibilityConverter}, FallbackValue=Collapsed}">
<TextBlock FontSize="10" Text="{x:Static ghfvs:Resources.Pending}" />
<TextBlock FontSize="10" Text="{x:Static ghfvs:Resources.Pending}" />
</Border>
</StackPanel>
</Border>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<StackPanel DockPanel.Dock="Top"
Orientation="Vertical"
Margin="8 0 0 0">

<!-- Title -->
<TextBlock Style="{DynamicResource {x:Static vsui:VsResourceKeys.TextBlockEnvironment122PercentFontSizeStyleKey}}"
TextWrapping="Wrap"
Expand Down Expand Up @@ -99,12 +99,19 @@
<StackPanel Orientation="Horizontal"
Margin="0 0 0 -4"
ghfvs:ScrollingVerticalStackPanel.IsFixed="true">
<ghfvs:GitHubActionLink Margin="0 6" Command="{Binding OpenConversation}">
View Conversation
<ghfvs:GitHubActionLink Margin="0 6" Command="{Binding OpenOnGitHub}">
View on GitHub
</ghfvs:GitHubActionLink>

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

<StackPanel Orientation="Horizontal">
<ghfvs:OcticonImage Margin="0 2 4 0" Foreground="{DynamicResource VsBrush.GrayText}" Width="12" Height="12" Icon="comment"/>
<ghfvs:GitHubActionLink Margin="0 6" Command="{Binding OpenConversation}" Content="{Binding Model.CommentCount}" />
</StackPanel>

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

<!-- Checkout pull request button -->
<ghfvs:GitHubActionLink Command="{Binding Checkout}"
Content="{Binding CheckoutState.Caption}"
Expand Down Expand Up @@ -186,6 +193,31 @@
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto">
<ghfvs:ScrollingVerticalStackPanel>
<!-- Author and open time -->
<ghfvs:SectionControl Name="descriptionSection"
HeaderText="{x:Static ghfvs:Resources.Description}"
Margin="0 4 0 0"
IsExpanded="False"
ghfvs:ScrollingVerticalStackPanel.IsFixed="true">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal" Margin="0 4 0 0">
<v:ActorAvatarView ViewModel="{Binding Author}"
VerticalAlignment="Bottom"
Width="16"
Height="16"
Margin="0,0,0,1"/>

<TextBlock VerticalAlignment="Center" Margin="4 0" TextWrapping="Wrap">
<Run FontWeight="SemiBold" Text="{Binding Model.Author.Login, Mode=OneWay}" />
<Run Text="{x:Static ghfvs:Resources.Wrote}" />
</TextBlock>
</StackPanel>
<!-- PR Body -->
<markdig:MarkdownViewer Name="bodyMarkdown"
Margin="2 4 10 6"
Markdown="{Binding Body}"/>
</StackPanel>
</ghfvs:SectionControl>

<ghfvs:SectionControl Name="reviewsSection"
HeaderText="{x:Static ghfvs:Resources.Reviewers}"
Expand Down Expand Up @@ -223,7 +255,7 @@
HeaderText="{Binding Files.ChangedFilesCount, StringFormat={x:Static ghfvs:Resources.ChangesCountFormat}}"
Margin="0 8 10 0"
ghfvs:ScrollingVerticalStackPanel.IsFixed="true"/>

<!-- Put the changes tree outside its expander, so it can scroll horizontally
while the header remains fixed -->
<local:PullRequestFilesView DataContext="{Binding Files}"
Expand Down