Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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 139 commits
Commits
Show all changes
234 commits
Select commit Hold shift + click to select a range
2fa267a
Restoring Annotations
StanleyGoldman Aug 15, 2018
182a9a9
Moving more FromGraphQl functions
StanleyGoldman Aug 15, 2018
4383c27
Merge branch 'features/check-suites' into features/check-suite-annota…
StanleyGoldman Aug 15, 2018
1f324a7
Functionality to indicate Check Run annotation counts
StanleyGoldman Aug 15, 2018
d9b6fe5
Attempting to display an icon for PullRequestCheckViewModels that hav…
StanleyGoldman Aug 16, 2018
fafc68f
Merge branch 'features/check-suites' into features/check-suite-annota…
StanleyGoldman Aug 16, 2018
10aee41
Merge branch 'features/check-suites' into features/check-suite-annota…
StanleyGoldman Aug 16, 2018
220a3e9
Displaying an icon next to check runs with annotations
StanleyGoldman Aug 16, 2018
3409360
Tweaking min width
StanleyGoldman Aug 16, 2018
47bc9f1
Merge branch 'features/check-suites' into features/check-suite-annota…
StanleyGoldman Aug 16, 2018
68a1d12
Adding a display for PullRequest Annotations
StanleyGoldman Aug 16, 2018
317c4ae
Functionality to display annotations in a dedicated view
StanleyGoldman Aug 17, 2018
86feafd
Fixing error
StanleyGoldman Aug 17, 2018
cc4219a
Fixing formatting
StanleyGoldman Aug 17, 2018
8fb18b4
Adding different types of inline tags
StanleyGoldman Aug 17, 2018
95d0079
Merge branch 'features/check-suites' into features/check-suite-annota…
StanleyGoldman Aug 20, 2018
42be1cd
Merge branch 'features/check-suites' into features/check-suite-annota…
StanleyGoldman Aug 21, 2018
966c955
Merge branch 'features/check-suites' into features/check-suite-annota…
StanleyGoldman Aug 21, 2018
7ee9e5a
Displaying inline glyphs
StanleyGoldman Aug 22, 2018
9ae3a85
Merge branch 'master' into features/check-suite-annotations
StanleyGoldman Aug 22, 2018
662f21e
Merge remote-tracking branch 'origin/master' into features/check-suit…
StanleyGoldman Aug 31, 2018
a069d8d
Fix needed after merge
StanleyGoldman Aug 31, 2018
cbc46a7
Fixing reference
StanleyGoldman Sep 4, 2018
fb8f7c3
Fixes needed after merge
StanleyGoldman Sep 4, 2018
6caf940
Ignoring tests i broke
StanleyGoldman Sep 4, 2018
16dbc03
Merge branch 'master' into features/check-suite-annotations
StanleyGoldman Sep 4, 2018
5362e1f
Merge branch 'master' into features/check-suite-annotations
StanleyGoldman Sep 5, 2018
34ac1d2
Reverting Inline Reviews
StanleyGoldman Sep 5, 2018
66181de
Changing InlineCommentTag to InlineTag
StanleyGoldman Sep 5, 2018
db3f01a
Cleaning up more code
StanleyGoldman Sep 5, 2018
8cd11fd
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Sep 5, 2018
7ca9195
Working InlineTagger changes
StanleyGoldman Sep 5, 2018
b39c5a4
Fixing test
StanleyGoldman Sep 6, 2018
2dfcf5d
Merge branch 'master' into features/check-suite-annotations
Sep 6, 2018
5174ee3
Adding another test
StanleyGoldman Sep 6, 2018
db07173
Rename class
StanleyGoldman Sep 6, 2018
bb30e4d
Adding functionality to create a tag object for a comment thread and …
StanleyGoldman Sep 6, 2018
85b060c
Adding different glyph types
StanleyGoldman Sep 7, 2018
6b564b0
Merge branch 'master' into features/check-suite-annotations
StanleyGoldman Sep 7, 2018
a9d69db
Merge remote-tracking branch 'remotes/origin/features/check-suite-ann…
StanleyGoldman Sep 7, 2018
657292e
Renaming models and adding InlineAnnotationViewModel
StanleyGoldman Sep 7, 2018
7cf4eba
Displaing inline annotations
StanleyGoldman Sep 7, 2018
3eddd4c
More renaming
StanleyGoldman Sep 7, 2018
321d51e
Adding CheckRunName
StanleyGoldman Sep 7, 2018
ecfd974
Merge branch 'master' into features/check-suite-annotations
StanleyGoldman Sep 10, 2018
3b8945d
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Sep 10, 2018
cf37806
Fixing project file
StanleyGoldman Sep 10, 2018
28a74ce
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Sep 10, 2018
219a823
Fixing the build
StanleyGoldman Sep 10, 2018
4f0f721
Rename DatabaseId to CheckRunId
StanleyGoldman Sep 10, 2018
ea3c850
Functionality to open an annotation tag from the file list
StanleyGoldman Sep 10, 2018
214e1a5
Renaming more InlineComment things
StanleyGoldman Sep 10, 2018
18dc78d
Link to inline review from file
StanleyGoldman Sep 10, 2018
b24f8a2
Restoring names of a lot of things
StanleyGoldman Sep 10, 2018
c1c229f
Undoing a lot of renaming
StanleyGoldman Sep 10, 2018
0db9892
Backporting some fixes
StanleyGoldman Sep 10, 2018
726de83
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Sep 10, 2018
2a9e4dd
Using a desiger to better control properties
StanleyGoldman Sep 11, 2018
9c8a4d8
Code cleanup
StanleyGoldman Sep 11, 2018
c3c03dd
More code cleanup
StanleyGoldman Sep 11, 2018
2865433
More backporting and cleaning
StanleyGoldman Sep 11, 2018
af51110
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Sep 11, 2018
7f8a0f5
Final code cleanup
StanleyGoldman Sep 11, 2018
df89a29
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Sep 11, 2018
58e1797
More code cleanup
StanleyGoldman Sep 11, 2018
2e21ae9
Final code cleanup
StanleyGoldman Sep 11, 2018
5c8e649
Merge branch 'master' into features/check-suite-annotations
StanleyGoldman Sep 11, 2018
b5dc961
Merge remote-tracking branch 'remotes/origin/features/check-suite-ann…
StanleyGoldman Sep 11, 2018
35f80ec
Fixes for code analysis
StanleyGoldman Sep 11, 2018
bb87286
Functionality to add CheckSuite Name to annotations view
StanleyGoldman Sep 13, 2018
9dcae6e
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Sep 13, 2018
1e3f839
Displaying the check suite name in inline reviews
StanleyGoldman Sep 13, 2018
24882ab
Functionality to display status icons
StanleyGoldman Sep 27, 2018
0463518
Merge branch 'master' into features/check-suite-annotations
StanleyGoldman Sep 27, 2018
86ef79a
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Sep 27, 2018
8802d49
Merge branch 'features/check-suite-annotations-inline' into checks-an…
StanleyGoldman Sep 27, 2018
388f47c
Fixing code after merge
StanleyGoldman Sep 27, 2018
f82a023
Updating nuget package
StanleyGoldman Sep 27, 2018
f2354ab
Other fixes after merge
StanleyGoldman Sep 27, 2018
a57985e
Adding image to check suitesa
StanleyGoldman Sep 27, 2018
aac507c
Merge remote-tracking branch 'remotes/origin/master' into features/ch…
StanleyGoldman Oct 23, 2018
041ea59
Lots of changes needed after merge
StanleyGoldman Oct 23, 2018
e86bde3
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Oct 24, 2018
7183891
Fixing more issues after merge
StanleyGoldman Oct 24, 2018
a785da4
Additional changes
StanleyGoldman Oct 24, 2018
5596f3f
Last fix
StanleyGoldman Oct 24, 2018
84c6b3d
Merge branch 'master' into features/check-suite-annotations
StanleyGoldman Oct 24, 2018
80d5b9a
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Oct 24, 2018
d4c96b8
Merge branch 'features/check-suite-annotations-inline' into features/…
StanleyGoldman Oct 24, 2018
0af2495
Addressing some feedback
StanleyGoldman Oct 24, 2018
8a7454f
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Oct 24, 2018
2bbdbf8
Restoring session field
StanleyGoldman Oct 24, 2018
b494b6e
Fixing merge error
StanleyGoldman Oct 24, 2018
f89c55b
Merge branch 'master' into features/check-suite-annotations
StanleyGoldman Oct 29, 2018
8d2323a
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Oct 29, 2018
88fd1ee
Start basic layout for inline annotations
donokuda Oct 29, 2018
507125e
Application may be null
StanleyGoldman Oct 29, 2018
f8a02f9
Little bit of text formatting
donokuda Oct 29, 2018
d7da753
Update colors and other formatting
donokuda Oct 30, 2018
68c7b34
Fix content not wrapping / stretching correctly
donokuda Oct 30, 2018
089d6c7
Marking Apps private
StanleyGoldman Oct 30, 2018
8fcb9b5
Merge branch 'master' into features/check-suite-annotations
StanleyGoldman Oct 30, 2018
a94917d
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Oct 30, 2018
d25bf7d
Fixing loading logic
StanleyGoldman Oct 30, 2018
49703ed
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Oct 30, 2018
9921f72
Use VS images for status icons
donokuda Oct 30, 2018
a55182e
Make text work in Dark Theme
donokuda Oct 30, 2018
284b3b5
Dynamic colors
donokuda Oct 30, 2018
d6329c4
Merge branch 'features/check-suite-annotations-inline' into donokuda/…
donokuda Oct 30, 2018
05ed235
Fix build error
StanleyGoldman Oct 30, 2018
92903eb
Merge branch 'features/check-suite-annotations-inline' into donokuda/…
StanleyGoldman Oct 30, 2018
cbbb54b
Fixing compilation error
StanleyGoldman Oct 31, 2018
65bb008
Merge branch 'features/check-suite-annotations-inline' into donokuda/…
StanleyGoldman Oct 31, 2018
06ad642
Merge branch 'master' into features/check-suite-annotations
StanleyGoldman Nov 2, 2018
7d65ffe
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Nov 2, 2018
add8e9d
Switch to CheckRunId
StanleyGoldman Nov 5, 2018
72fa350
Fixing regular expression; - should be escaped
StanleyGoldman Nov 5, 2018
6877792
Merge branch 'features/check-suite-annotations-images' into features/…
StanleyGoldman Nov 5, 2018
3ae3c1b
Removing IInlineAnnotationModel
StanleyGoldman Nov 5, 2018
2b0970a
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Nov 5, 2018
e705559
Merge remote-tracking branch 'remotes/origin/master' into features/ch…
StanleyGoldman Nov 5, 2018
df93480
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Nov 5, 2018
e2e4b6c
Cleanup from removing interface
StanleyGoldman Nov 6, 2018
6c22912
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Nov 6, 2018
d7ebeca
More interface removing
StanleyGoldman Nov 6, 2018
55f4f8a
Missing comma
StanleyGoldman Nov 6, 2018
9cbc9ff
Temporarily disabling the loading of images
StanleyGoldman Nov 6, 2018
4e38c00
Move things into a border component
donokuda Nov 6, 2018
b2810aa
Begin implementing comment styles
donokuda Nov 6, 2018
a327209
Tidy up margins
donokuda Nov 6, 2018
6e9bcae
Removing status and check avatars
StanleyGoldman Nov 6, 2018
5ba4d89
Fixing tests
StanleyGoldman Nov 6, 2018
6b8b712
Some more styling tweaks
donokuda Nov 6, 2018
f45b329
Switching to a dictionary based on file path
StanleyGoldman Nov 7, 2018
fd2ed5e
Merge remote-tracking branch 'origin/master' into features/check-suit…
StanleyGoldman Nov 7, 2018
480ca1a
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Nov 7, 2018
b09aaba
Cleanup
StanleyGoldman Nov 7, 2018
a28d67c
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Nov 7, 2018
f3ca06b
Cleanup
StanleyGoldman Nov 7, 2018
597d651
Changing to an array
StanleyGoldman Nov 7, 2018
b829ea7
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Nov 7, 2018
d2b1532
Use a different theme color for comment borders
donokuda Nov 7, 2018
fda3134
Prefer VS Images over Octicons in file tree
donokuda Nov 7, 2018
e8a2a0a
Use info icon too
donokuda Nov 7, 2018
fc6ec4c
Merge remote-tracking branch 'origin/features/check-suite-annotations…
donokuda Nov 8, 2018
05ddfba
UpdatedAt -> CreatedAt
donokuda Nov 8, 2018
fb7fd99
Merge branch 'features/check-suite-annotations-inline' into donokuda/…
StanleyGoldman Nov 8, 2018
aaaf9ec
Merge remote-tracking branch 'remotes/origin/master' into features/ch…
StanleyGoldman Nov 8, 2018
07003b3
Removing unused interface
StanleyGoldman Nov 8, 2018
a674ec9
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Nov 8, 2018
33b38f2
Merge branch 'features/check-suite-annotations-inline' into donokuda/…
StanleyGoldman Nov 8, 2018
494099b
Merge pull request #2045 from github/donokuda/use-vs-icons-in-treeeeee
StanleyGoldman Nov 8, 2018
c8304fe
Merge remote-tracking branch 'remotes/origin/features/check-suite-ann…
StanleyGoldman Nov 8, 2018
7cd3139
Merge branch 'donokuda/check-suite-polish' of https://github.com/gith…
donokuda Nov 8, 2018
488ed64
Removing application slug
StanleyGoldman Nov 8, 2018
5d0b1f2
Adding notice count to files view
StanleyGoldman Nov 9, 2018
573a3bc
Prefer VS Images over Octicons in file tree
donokuda Nov 7, 2018
8604670
Use info icon too
donokuda Nov 7, 2018
ab0aafd
Align icon
StanleyGoldman Nov 9, 2018
8e7ff5c
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Nov 9, 2018
698f35b
Merge remote-tracking branch 'remotes/origin/master' into features/ch…
StanleyGoldman Nov 9, 2018
f155567
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Nov 9, 2018
4a57e92
Merge branch 'features/check-suite-annotations-inline' into donokuda/…
StanleyGoldman Nov 9, 2018
20977f1
Cleanup references
StanleyGoldman Nov 9, 2018
2b748a7
Fixing references
StanleyGoldman Nov 9, 2018
434af69
Cleanup
StanleyGoldman Nov 9, 2018
c2c4c46
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Nov 9, 2018
56dd609
Merge branch 'features/check-suite-annotations-inline' into donokuda/…
StanleyGoldman Nov 9, 2018
ca27920
Removing old packages
StanleyGoldman Nov 19, 2018
2c6303a
Rename CheckRunId to Id for the win
StanleyGoldman Nov 19, 2018
a6f8a46
Merge remote-tracking branch 'origin/master' into features/check-suit…
StanleyGoldman Nov 19, 2018
2030133
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Nov 19, 2018
c06767e
Merge branch 'features/check-suite-annotations-inline' into donokuda/…
StanleyGoldman Nov 19, 2018
0708f8d
Merge pull request #2018 from github/donokuda/check-suite-polish
StanleyGoldman Nov 19, 2018
21aa934
Group things by file
donokuda Nov 14, 2018
329bd00
Polish up the annotations list view
donokuda Nov 14, 2018
4ce6b7f
This wasn't necessary
donokuda Nov 14, 2018
829de23
Negative margins and format title
donokuda Nov 14, 2018
818a4fc
Make the line description a hyperlink
donokuda Nov 15, 2018
c0cb0c2
Identifying what files are contained in the pull request
StanleyGoldman Nov 20, 2018
59d3d06
Merge branch 'features/check-suite-annotations' into donokuda/check-l…
StanleyGoldman Nov 20, 2018
d71c94d
Adding a line description for items that are not in the pull request
StanleyGoldman Nov 20, 2018
d608dac
Cleanup
StanleyGoldman Nov 20, 2018
fe4d63b
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Nov 20, 2018
349c7c1
Fixes after merge
StanleyGoldman Nov 20, 2018
9282f78
Merge pull request #2057 from github/donokuda/check-list-polish
StanleyGoldman Nov 20, 2018
1e65e46
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Nov 20, 2018
a9c5390
Making requested changes
StanleyGoldman Nov 20, 2018
4b91bce
Moving string to resource
StanleyGoldman Nov 20, 2018
6e994c8
Removing unused property and resource
StanleyGoldman Nov 20, 2018
cb3e082
Correct comment
StanleyGoldman Nov 20, 2018
129d863
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Nov 20, 2018
0a757ab
:fire: unnecessary grid markup
donokuda Nov 20, 2018
a5180cd
:fire: Commented lines
donokuda Nov 20, 2018
a762e9a
Update icon to text
donokuda Nov 20, 2018
fc7a955
An attempt at keeping the width of each row consistent
donokuda Nov 20, 2018
de64ba8
Fixing references
StanleyGoldman Nov 20, 2018
5580c06
Back to the stack
donokuda Nov 20, 2018
766cae5
i-have-no-clue-what-im-doing.jpg
donokuda Nov 20, 2018
99203ff
Addressing feedback
StanleyGoldman Nov 21, 2018
e731cd5
Removing handler
StanleyGoldman Nov 21, 2018
b01e6ec
Removing xaml import
StanleyGoldman Nov 21, 2018
967a749
IReadOnlyList > IReadOnlyCollection
StanleyGoldman Nov 21, 2018
04e6fc7
Adding comments
StanleyGoldman Nov 21, 2018
24a501d
Merge branch 'features/check-suite-annotations-inline' into donokuda/…
StanleyGoldman Nov 21, 2018
a38c1cf
Add missing CommandParameter
StanleyGoldman Nov 21, 2018
c07100a
Don't use SharedSizeScope.
grokys Nov 21, 2018
d738496
Merge pull request #2074 from github/donokuda/update-check-icon
StanleyGoldman Nov 21, 2018
d6ae911
Simplify view
StanleyGoldman Nov 21, 2018
6d91d7a
Merge branch 'features/check-suite-annotations-inline' of https://git…
donokuda Nov 21, 2018
769125c
Moving Annotations out of CommentThreadViewModel
StanleyGoldman Nov 21, 2018
88d9af7
Adjusting view
StanleyGoldman Nov 21, 2018
cf78034
Adjust annotation list item's margin and make text color dynamic
donokuda Nov 21, 2018
adfada0
Merge branch 'features/check-suite-annotations-inline' of https://git…
donokuda Nov 21, 2018
e9080ab
It's a circle now!
donokuda Nov 21, 2018
747084c
Update color
donokuda Nov 21, 2018
a0e2fcd
It's a lil diamond now
donokuda Nov 21, 2018
0d81d7c
Adding additional Check Run fields
StanleyGoldman Nov 21, 2018
c67c5b4
Make everything a diamond
donokuda Nov 21, 2018
c110ad9
Fix bottom margin for reply textbox
donokuda Nov 21, 2018
271c2cd
Using only one view
StanleyGoldman Nov 21, 2018
4069376
Merge pull request #2077 from github/donokuda/polish-annotation-margin
StanleyGoldman Nov 21, 2018
c2d7d72
Merge remote-tracking branch 'remotes/origin/master' into features/ch…
StanleyGoldman Nov 21, 2018
fe6c09d
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Nov 21, 2018
f13d354
Attempting to control the comment ability
StanleyGoldman Nov 22, 2018
f3c4548
Correcting the xaml binding
StanleyGoldman Nov 26, 2018
ce065dc
Merge pull request #2080 from github/features/check-suite-annotations…
StanleyGoldman Nov 26, 2018
9e9978f
Merge branch 'master' into features/check-suite-annotations
StanleyGoldman Nov 26, 2018
1da4ac2
Merge branch 'features/check-suite-annotations' into features/check-s…
StanleyGoldman Nov 26, 2018
fef4a16
Merge pull request #1900 from github/features/check-suite-annotations…
grokys Nov 26, 2018
e249664
Removing margin
StanleyGoldman Nov 26, 2018
a6f67e8
no margins
donokuda Nov 26, 2018
cd33156
Merge branch 'features/check-suite-annotations' of https://github.com…
donokuda Nov 26, 2018
6bbb1ae
remove border from comments
donokuda Nov 26, 2018
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
14 changes: 13 additions & 1 deletion 14 src/GitHub.App/SampleData/CommentThreadViewModelDesigner.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using GitHub.Models;
using GitHub.ViewModels;
using ReactiveUI;

Expand All @@ -8,6 +10,16 @@ namespace GitHub.SampleData
[SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
public class CommentThreadViewModelDesigner : ViewModelBase, ICommentThreadViewModel
{
public CommentThreadViewModelDesigner()
{
Comments = new ReactiveList<ICommentViewModel>(){new CommentViewModelDesigner()
{
Author = new ActorViewModel{ Login = "shana"},
Body = "You can use a `CompositeDisposable` type here, it's designed to handle disposables in an optimal way (you can just call `Dispose()` on it and it will handle disposing everything it holds)."
}};

}

public IReadOnlyReactiveList<ICommentViewModel> Comments { get; }
= new ReactiveList<ICommentViewModel>();

Expand Down
40 changes: 40 additions & 0 deletions 40 src/GitHub.App/SampleData/InlineAnnotationViewModelDesigner.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System.Collections.Generic;
using GitHub.Models;
using GitHub.ViewModels;

namespace GitHub.SampleData
{
public class InlineAnnotationViewModelDesigner : IInlineAnnotationViewModel
{
public InlineAnnotationViewModelDesigner()
{
var checkRunAnnotationModel = new CheckRunAnnotationModel
{
AnnotationLevel = CheckAnnotationLevel.Failure,
Path = "SomeFile.cs",
EndLine = 12,
StartLine = 12,
Message = "Some Error Message",
Title = "CS12345"
};

var checkRunModel =
new CheckRunModel
{
Annotations = new List<CheckRunAnnotationModel> {checkRunAnnotationModel},
Name = "Fake Check Run"
};

var checkSuiteModel = new CheckSuiteModel()
{
ApplicationName = "Fake Check Suite",
HeadSha = "ed6198c37b13638e902716252b0a17d54bd59e4a",
CheckRuns = new List<CheckRunModel> { checkRunModel}
};

Model= new InlineAnnotationModel(checkSuiteModel, checkRunModel, checkRunAnnotationModel);
}

public InlineAnnotationModel Model { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public sealed class PullRequestAnnotationItemViewModelDesigner : IPullRequestAnn
public CheckRunAnnotationModel Annotation { get; set; }
public bool IsExpanded { get; set; }
public string LineDescription => $"{Annotation.StartLine}:{Annotation.EndLine}";
public bool IsFileInPullRequest { get; }
public bool IsFileInPullRequest { get; set; }
public ReactiveCommand<Unit, Unit> OpenAnnotation { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public sealed class PullRequestAnnotationsViewModelDesigner : PanePageViewModelB
Title = "CS 12345"
},
IsExpanded = true,
IsFileInPullRequest = true
},
new PullRequestAnnotationItemViewModelDesigner
{
Expand All @@ -53,6 +54,7 @@ public sealed class PullRequestAnnotationsViewModelDesigner : PanePageViewModelB
Title = "CS 12345"
},
IsExpanded = true,
IsFileInPullRequest = true
},
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Reactive;
using System.Windows.Media.Imaging;
using GitHub.Models;
using GitHub.ViewModels;
using GitHub.ViewModels.GitHubPane;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public PullRequestFilesViewModelDesigner()
public ReactiveCommand<IPullRequestFileNode, Unit> DiffFileWithWorkingDirectory { get; }
public ReactiveCommand<IPullRequestFileNode, Unit> OpenFileInWorkingDirectory { get; }
public ReactiveCommand<IPullRequestFileNode, Unit> OpenFirstComment { get; }
public ReactiveCommand<IPullRequestFileNode, Unit> OpenFirstAnnotationNotice { get; }
public ReactiveCommand<IPullRequestFileNode, Unit> OpenFirstAnnotationWarning { get; }
public ReactiveCommand<IPullRequestFileNode, Unit> OpenFirstAnnotationFailure { get; }

public Task InitializeAsync(
IPullRequestSession session,
Expand Down
14 changes: 10 additions & 4 deletions 14 src/GitHub.App/Services/PullRequestEditorService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ await pullRequestService.ExtractToTempFile(
}

/// <inheritdoc/>
public async Task<IDifferenceViewer> OpenDiff(
public Task<IDifferenceViewer> OpenDiff(
IPullRequestSession session,
string relativePath,
IInlineCommentThreadModel thread)
Expand All @@ -294,11 +294,17 @@ public async Task<IDifferenceViewer> OpenDiff(
Guard.ArgumentNotEmptyString(relativePath, nameof(relativePath));
Guard.ArgumentNotNull(thread, nameof(thread));

var diffViewer = await OpenDiff(session, relativePath, thread.CommitSha, scrollToFirstDraftOrDiff: false);
return OpenDiff(session, relativePath, thread.CommitSha, thread.LineNumber - 1);
}

/// <inheritdoc/>
public async Task<IDifferenceViewer> OpenDiff(IPullRequestSession session, string relativePath, string headSha, int fromLine)
{
var diffViewer = await OpenDiff(session, relativePath, headSha, scrollToFirstDraftOrDiff: false);

var param = (object)new InlineCommentNavigationParams
var param = (object) new InlineCommentNavigationParams
{
FromLine = thread.LineNumber - 1,
FromLine = fromLine,
};

// HACK: We need to wait here for the inline comment tags to initialize so we can find the next inline comment.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System.Reactive;
using System.Reactive.Linq;
using GitHub.Models;
using GitHub.Services;
using ReactiveUI;

namespace GitHub.ViewModels.GitHubPane
Expand All @@ -14,12 +16,22 @@ public class PullRequestAnnotationItemViewModel : ViewModelBase, IPullRequestAnn
/// </summary>
/// <param name="annotation">The check run annotation model.</param>
/// <param name="isFileInPullRequest">A flag that denotes if the annotation is part of the pull request's changes.</param>
public PullRequestAnnotationItemViewModel(CheckRunAnnotationModel annotation, bool isFileInPullRequest)
/// <param name="checkSuite">The check suite model.</param>
/// <param name="session">The pull request session.</param>
/// <param name="editorService">The pull request editor service.</param>
public PullRequestAnnotationItemViewModel(
CheckRunAnnotationModel annotation,
bool isFileInPullRequest,
CheckSuiteModel checkSuite,
IPullRequestSession session,
IPullRequestEditorService editorService)
{
Annotation = annotation;
IsFileInPullRequest = isFileInPullRequest;

OpenAnnotation = ReactiveCommand.Create(() => { });
OpenAnnotation = ReactiveCommand.CreateFromTask<Unit>(
async _ => await editorService.OpenDiff(session, annotation.Path, checkSuite.HeadSha, annotation.EndLine - 1),
Observable.Return(IsFileInPullRequest));
}

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
Expand All @@ -15,7 +15,8 @@ namespace GitHub.ViewModels.GitHubPane
[PartCreationPolicy(CreationPolicy.NonShared)]
public class PullRequestAnnotationsViewModel : PanePageViewModelBase, IPullRequestAnnotationsViewModel
{
private readonly IPullRequestSessionManager sessionManager;
readonly IPullRequestSessionManager sessionManager;
readonly IPullRequestEditorService pullRequestEditorService;

IPullRequestSession session;
string title;
Expand All @@ -29,10 +30,12 @@ public class PullRequestAnnotationsViewModel : PanePageViewModelBase, IPullReque
/// Initializes a new instance of the <see cref="PullRequestAnnotationsViewModel"/> class.
/// </summary>
/// <param name="sessionManager">The pull request session manager.</param>
/// <param name="pullRequestEditorService">The pull request editor service.</param>
[ImportingConstructor]
public PullRequestAnnotationsViewModel(IPullRequestSessionManager sessionManager)
public PullRequestAnnotationsViewModel(IPullRequestSessionManager sessionManager, IPullRequestEditorService pullRequestEditorService)
{
this.sessionManager = sessionManager;
this.pullRequestEditorService = pullRequestEditorService;
NavigateToPullRequest = ReactiveCommand.Create(() => {
NavigateTo(FormattableString.Invariant(
$"{LocalRepository.Owner}/{LocalRepository.Name}/pull/{PullRequestNumber}"));
Expand Down Expand Up @@ -151,7 +154,7 @@ void Load(PullRequestDetailModel pullRequest)
.ToDictionary(
path => path,
path => annotationsLookup[path]
.Select(annotation => new PullRequestAnnotationItemViewModel(annotation, changedFiles.Contains(path)))
.Select(annotation => new PullRequestAnnotationItemViewModel(annotation, changedFiles.Contains(path), checkSuiteRun.checkSuite, session, pullRequestEditorService))
.Cast<IPullRequestAnnotationItemViewModel>()
.ToArray()
);
Expand Down
25 changes: 15 additions & 10 deletions 25 src/GitHub.App/ViewModels/GitHubPane/PullRequestCheckViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using GitHub.Extensions;
using GitHub.Factories;
using GitHub.Models;
using GitHub.Primitives;
using GitHub.Services;
using ReactiveUI;

Expand All @@ -17,6 +18,8 @@ namespace GitHub.ViewModels.GitHubPane
[PartCreationPolicy(CreationPolicy.NonShared)]
public class PullRequestCheckViewModel: ViewModelBase, IPullRequestCheckViewModel
{
const string DefaultAvatar = "pack://application:,,,/GitHub.App;component/Images/default_user_avatar.png";

private readonly IUsageTracker usageTracker;

/// <summary>
Expand Down Expand Up @@ -56,11 +59,14 @@ public static IEnumerable<IPullRequestCheckViewModel> Build(IViewViewModelFactor
return pullRequestCheckViewModel;
}) ?? Array.Empty<PullRequestCheckViewModel>();

var checks = pullRequest.CheckSuites?.SelectMany(checkSuiteModel => checkSuiteModel.CheckRuns)
.Select(checkRunModel =>
var checks =
pullRequest.CheckSuites?
.SelectMany(checkSuite => checkSuite.CheckRuns
.Select(checkRun => new { checkSuiteModel = checkSuite, checkRun}))
.Select(arg =>
{
PullRequestCheckStatus checkStatus;
switch (checkRunModel.Status)
switch (arg.checkRun.Status)
{
case CheckStatusState.Requested:
case CheckStatusState.Queued:
Expand All @@ -69,7 +75,7 @@ public static IEnumerable<IPullRequestCheckViewModel> Build(IViewViewModelFactor
break;

case CheckStatusState.Completed:
switch (checkRunModel.Conclusion)
switch (arg.checkRun.Conclusion)
{
case CheckConclusionState.Success:
checkStatus = PullRequestCheckStatus.Success;
Expand All @@ -94,13 +100,12 @@ public static IEnumerable<IPullRequestCheckViewModel> Build(IViewViewModelFactor

var pullRequestCheckViewModel = (PullRequestCheckViewModel)viewViewModelFactory.CreateViewModel<IPullRequestCheckViewModel>();
pullRequestCheckViewModel.CheckType = PullRequestCheckType.ChecksApi;
pullRequestCheckViewModel.CheckRunId = checkRunModel.Id;
pullRequestCheckViewModel.HasAnnotations = checkRunModel.Annotations?.Any() ?? false;
pullRequestCheckViewModel.Title = checkRunModel.Name;
pullRequestCheckViewModel.Description = checkRunModel.Summary;
pullRequestCheckViewModel.CheckRunId = arg.checkRun.Id;
pullRequestCheckViewModel.HasAnnotations = arg.checkRun.Annotations?.Any() ?? false;
pullRequestCheckViewModel.Title = arg.checkRun.Name;
pullRequestCheckViewModel.Description = arg.checkRun.Summary;
pullRequestCheckViewModel.Status = checkStatus;
pullRequestCheckViewModel.DetailsUrl = new Uri(checkRunModel.DetailsUrl);

pullRequestCheckViewModel.DetailsUrl = new Uri(arg.checkRun.DetailsUrl);
return pullRequestCheckViewModel;
}) ?? Array.Empty<PullRequestCheckViewModel>();

Expand Down
38 changes: 38 additions & 0 deletions 38 src/GitHub.App/ViewModels/GitHubPane/PullRequestFilesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,26 @@ public PullRequestFilesViewModel(
await editorService.OpenDiff(pullRequestSession, file.RelativePath, thread);
}
});

OpenFirstAnnotationNotice = ReactiveCommand.CreateFromTask<IPullRequestFileNode>(
async file => await OpenFirstAnnotation(editorService, file, CheckAnnotationLevel.Notice));

OpenFirstAnnotationWarning = ReactiveCommand.CreateFromTask<IPullRequestFileNode>(
async file => await OpenFirstAnnotation(editorService, file, CheckAnnotationLevel.Warning));

OpenFirstAnnotationFailure = ReactiveCommand.CreateFromTask<IPullRequestFileNode>(
async file => await OpenFirstAnnotation(editorService, file, CheckAnnotationLevel.Failure));
}

private async Task OpenFirstAnnotation(IPullRequestEditorService editorService, IPullRequestFileNode file,
CheckAnnotationLevel checkAnnotationLevel)
{
var annotationModel = await GetFirstAnnotation(file, checkAnnotationLevel);

if (annotationModel != null)
{
await editorService.OpenDiff(pullRequestSession, file.RelativePath, annotationModel.HeadSha, annotationModel.EndLine);
}
}

/// <inheritdoc/>
Expand Down Expand Up @@ -160,6 +180,15 @@ public async Task InitializeAsync(
/// <inheritdoc/>
public ReactiveCommand<IPullRequestFileNode, Unit> OpenFirstComment { get; }

/// <inheritdoc/>
public ReactiveCommand<IPullRequestFileNode, Unit> OpenFirstAnnotationNotice { get; }

/// <inheritdoc/>
public ReactiveCommand<IPullRequestFileNode, Unit> OpenFirstAnnotationWarning { get; }

/// <inheritdoc/>
public ReactiveCommand<IPullRequestFileNode, Unit> OpenFirstAnnotationFailure { get; }

static int CountComments(
IEnumerable<IInlineCommentThreadModel> thread,
Func<IInlineCommentThreadModel, bool> commentFilter)
Expand Down Expand Up @@ -212,6 +241,15 @@ async Task<IInlineCommentThreadModel> GetFirstCommentThread(IPullRequestFileNode
return threads.FirstOrDefault();
}

async Task<InlineAnnotationModel> GetFirstAnnotation(IPullRequestFileNode file,
CheckAnnotationLevel annotationLevel)
{
var sessionFile = await pullRequestSession.GetFile(file.RelativePath);
var annotations = sessionFile.InlineAnnotations;

return annotations.FirstOrDefault(model => model.AnnotationLevel == annotationLevel);
}

/// <summary>
/// Implements the <see cref="OpenFileInWorkingDirectory"/> command.
/// </summary>
Expand Down
21 changes: 21 additions & 0 deletions 21 src/GitHub.App/ViewModels/InlineAnnotationViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using GitHub.Models;
using GitHub.ViewModels;

namespace GitHub.ViewModels
{
/// <inheritdoc />
public class InlineAnnotationViewModel: IInlineAnnotationViewModel
{
/// <inheritdoc />
public InlineAnnotationModel Model { get; }

/// <summary>
/// Initializes a <see cref="InlineAnnotationViewModel"/>.
/// </summary>
/// <param name="model">The inline annotation model.</param>
public InlineAnnotationViewModel(InlineAnnotationModel model)
{
Model = model;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Globalization;
using System.Linq;
Expand Down Expand Up @@ -75,8 +76,7 @@ public bool IsNewThread
public bool NeedsPush => needsPush.Value;

/// <inheritdoc/>
public async Task InitializeAsync(
IPullRequestSession session,
public async Task InitializeAsync(IPullRequestSession session,
IPullRequestSessionFile file,
IInlineCommentThreadModel thread,
bool addPlaceholder)
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.