8000 Pull Request conversation view by grokys · Pull Request #2017 · github/VisualStudio · GitHub
[go: up one dir, main page]

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

Pull Request conversation view #2017

Merged
merged 73 commits into from
Feb 21, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Display sample data in PR conversation page.
  • Loading branch information
grokys committed Oct 30, 2018
commit 02bc4ee88509e125bbe3a2b83f4c242ead321d93
1 change: 1 addition & 0 deletions src/GitHub.App/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
[assembly: XmlnsDefinition("https://github.com/github/VisualStudio", "GitHub.ViewModels")]
[assembly: XmlnsDefinition("https://github.com/github/VisualStudio", "GitHub.ViewModels.Dialog")]
[assembly: XmlnsDefinition("https://github.com/github/VisualStudio", "GitHub.ViewModels.Dialog.Clone")]
[assembly: XmlnsDefinition("https://github.com/github/VisualStudio", "GitHub.ViewModels.Documents")]
[assembly: XmlnsDefinition("https://github.com/github/VisualStudio", "GitHub.ViewModels.GitHubPane")]
2 changes: 1 addition & 1 deletion src/GitHub.App/SampleData/CommentViewModelDesigner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public CommentViewModelDesigner()
public ReactiveCommand<Unit, Unit> BeginEdit { get; }
public ReactiveCommand<Unit, Unit> CancelEdit { get; }
public ReactiveCommand<Unit, Unit> CommitEdit { get; }
public ReactiveCommand<Unit, Unit> OpenOnGitHub { get; }
public ReactiveCommand<Unit, Unit> OpenOnGitHub { get; } = ReactiveCommand.Create(() => { });
public ReactiveCommand<Unit, Unit> Delete { get; }

public Task InitializeAsync(ICommentThreadViewModel thread, ActorModel currentUser, CommentModel comment, CommentEditState state)
Expand Down
E30A
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Reactive;
using System.Threading.Tasks;
using GitHub.Models;
Expand Down Expand Up @@ -53,10 +54,38 @@ public PullRequestPageViewModelDesigner()

Depends on #1993
Fixes #1905";
Timeline = new IViewModel[]
{
new CommitSummariesViewModel(
new CommitSummaryViewModel(new CommitModel
{
Author = new ActorModel { Login = "grokys" },
AbbreviatedOid = "c7c7d25",
MessageHeadline = "Refactor comment view models."
}),
new CommitSummaryViewModel(new CommitModel
{
Author = new ActorModel { Login = "grokys" },
AbbreviatedOid = "04e6a90",
MessageHeadline = "Refactor comment view models.",
})),
new CommentViewModelDesigner
{
Author = new ActorViewModelDesigner("meaghanlewis"),
Body = @"This is looking great! Really enjoying using this feature so far.

When leaving an inline comment, the comment posts successfully and then a new comment is drafted with the same text.",
},
new CommentViewModelDesigner
{
Author = new ActorViewModelDesigner("grokys"),
Body = @"Oops, sorry about that @meaghanlewis - I was sure I tested those things, but must have got messed up again at some point. Should be fixed now.",
},
};
}

public PullRequestState State { get; set; } = PullRequestState.Open;
public IIssueishCommentThreadViewModel Thread { get; set; }
public IReadOnlyList<IViewModel> Timeline { get; }
public string SourceBranchDisplayName { get; set; } = "feature/save-drafts";
public string TargetBranchDisplayName { get; set; } = "master";
public IActorViewModel Author { get; set; } = new ActorViewModelDesigner("grokys");
Expand Down
14 changes: 14 additions & 0 deletions src/GitHub.App/ViewModels/Documents/CommitSummariesViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Collections.Generic;

namespace GitHub.ViewModels.Documents
{
public class CommitSummariesViewModel : ViewModelBase
{
public CommitSummariesViewModel(params CommitSummaryViewModel[] commits)
{
Commits = commits;
}

public IReadOnlyList<CommitSummaryViewModel> Commits { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using GitHub.Models;
using GitHub.ViewModels;

namespace GitHub.App.ViewModels.Documents
namespace GitHub.ViewModels.Documents
{
public class CommitSummaryViewModel : ViewModelBase
{
Expand Down
39 changes: 32 additions & 7 deletions src/GitHub.App/ViewModels/Documents/PullRequestPageViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Threading.Tasks;
using GitHub.Extensions;
using GitHub.Factories;
using GitHub.Models;
using GitHub.SampleData;
using GitHub.Services;
using ReactiveUI;

namespace GitHub.ViewModels.Documents
{
Expand Down Expand Up @@ -35,7 +38,7 @@ public PullRequestPageViewModel(
}

/// <inheritdoc/>
public IIssueishCommentThreadViewModel Thread { get; private set; }
public IReadOnlyList<IViewModel> Timeline { get; private set; }

/// <inheritdoc/>
public async Task InitializeAsync(
Expand All @@ -44,12 +47,34 @@ public async Task InitializeAsync(
{
await base.InitializeAsync(model).ConfigureAwait(true);

var thread = factory.CreateViewModel<IIssueishCommentThreadViewModel>();
await thread.InitializeAsync(
currentUser,
model,
true).ConfigureAwait(true);
Thread = thread;
Timeline = new IViewModel[]
{
new CommitSummariesViewModel(
new CommitSummaryViewModel(new CommitModel
{
Author = new ActorModel { Login = "grokys" },
AbbreviatedOid = "c7c7d25",
MessageHeadline = "Refactor comment view models."
}),
new CommitSummaryViewModel(new CommitModel
{
Author = new ActorModel { Login = "grokys" },
AbbreviatedOid = "04e6a90",
MessageHeadline = "Refactor comment view models.",
})),
new CommentViewModelDesigner
{
Author = new ActorViewModelDesigner("meaghanlewis"),
Body = @"This is looking great! Really enjoying using this feature so far.

When leaving an inline comment, the comment posts successfully and then a new comment is drafted with the same text.",
},
new CommentViewModelDesigner
{
Author = new ActorViewModelDesigner("grokys"),
Body = @"Oops, sorry about that @meaghanlewis - I was sure I tested those things, but must have got messed up again at some point. Should be fixed now.",
},
};
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Threading.Tasks;
using GitHub.Models;

namespace GitHub.ViewModels.Documents
Expand All @@ -9,9 +10,9 @@ namespace GitHub.ViewModels.Documents
public interface IPullRequestPageViewModel : IPullRequestViewModelBase
{
/// <summary>
/// Gets the pull request's comment thread.
/// Gets the pull request's timeline.
/// </summary>
IIssueishCommentThreadViewModel Thread { get; }
IReadOnlyList<IViewModel> Timeline { get; }

/// <summary>
/// Initializes the view model with data.
Expand Down
5 changes: 5 additions & 0 deletions src/GitHub.Exports/Models/CommitModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ namespace GitHub.Models
/// </summary>
public class CommitModel
{
/// <summary>
/// Gets or sets the author of the commit.
/// </summary>
public ActorModel Author { get; set; }

/// <summary>
/// Gets the abbreviated git object ID for the commit.
/// </summary>
Expand Down
6 changes: 3 additions & 3 deletions src/GitHub.VisualStudio.UI/Views/CommentView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@

<DockPanel>
<StackPanel Orientation="Horizontal" DockPanel.Dock="Left" >
<controls:AccountAvatar Width="16"
Height="16"
Account="{Binding Author}"/>
<views:ActorAvatarView Width="16"
Height="16"
ViewModel="{Binding Author}"/>

<TextBlock Foreground="{DynamicResource GitHubVsToolWindowText}" FontWeight="Bold" Text="{Binding Author.Login}" Margin="4 0"/>
<ui:GitHubActionLink Content="{Binding UpdatedAt, Converter={ui:DurationToStringConverter}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
xmlns:markdig="clr-namespace:Markdig.Wpf;assembly=Markdig.Wpf"
xmlns:vsui="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.14.0"
xmlns:v="clr-namespace:GitHub.VisualStudio.Views"
mc:Ignorable="d" d:DesignHeight="1024" d:DesignWidth="800"
mc:Ignorable="d" d:DesignHeight="2048" d:DesignWidth="800"
MaxWidth="800">
<d:DesignData.DataContext>
<ghfvs:PullRequestPageViewModelDesigner/>
Expand Down Expand Up @@ -84,8 +84,45 @@

<markdig:MarkdownViewer Name="bodyMarkdown" Markdown="{Binding Body}"/>

<Rectangle DockPanel.Dock="Top" Style="{StaticResource Separator}" Height="2" Margin="0,16"/>
<ItemsControl ItemsSource="{Binding Timeline}">
<ItemsControl.Resources>
<DataTemplate DataType="{x:Type ghfvs:CommitSummariesViewModel}">
<ItemsControl ItemsSource="{Binding Commits}"/>
</DataTemplate>

<v:CommentThreadView DataContext="{Binding Thread}"/>
<DataTemplate DataType="{x:Type ghfvs:CommitSummaryViewModel}">
<DockPanel>
<ghfvs:OcticonImage DockPanel.Dock="Left"
Margin="0,0,2,0"
Icon="git_commit"/>
<v:ActorAvatarView DockPanel.Dock="Left"
Width="16"
Height="16"
Margin="2"
ViewModel="{Binding Author}"/>
<TextBlock DockPanel.Dock="Right">
<Hyperlink>
<Run Text="{Binding AbbreviatedOid, Mode=OneWay}"/>
</Hyperlink>
</TextBlock>
<TextBlock Text="{Binding Header}"/>
</DockPanel>
</DataTemplate>

<DataTemplate DataType="{x:Type ghfvs:CommentViewModelDesigner}">
<v:CommentView/>
</DataTemplate>
</ItemsControl.Resources>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderThickness="0,1,0,0"
BorderBrush="{DynamicResource GitHubHeaderSeparatorBrush}"
Margin="0,16,0,0"
Padding="0,16,0,0">
<ContentControl Content="{Binding}"/>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</UserControl>
0