-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Conversation
- Renamed `InlineCommentThreadViewModel` -> `PullRequestReviewCommentThreadViewModel` - Moved `PullRequestReviewCommentThreadViewModel` to GitHub.App - Make comment view models MEF creatable - Add `InitializeAsync` methods to initialize them with data.
So that it can be used everywhere. Had to refactor it slightly to remove some dependencies.
Codecov Report
@@ Coverage Diff @@
## master #1994 +/- ##
==========================================
- Coverage 40.51% 39.34% -1.18%
==========================================
Files 372 410 +38
Lines 16099 17573 +1474
Branches 2216 2425 +209
==========================================
+ Hits 6523 6914 +391
- Misses 9054 10112 +1058
- Partials 522 547 +25
|
- Make posting a PR review comment delete the draft - Remove the placeholder logic from `InlineCommentPeekViewModel` as this is now handled by the draft system
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. |
Thanks @grokys. This looks great to me. |
All of the inline comment stuff seems to be working great! I cloned and opened solutions and my comments are still there. 🎉 With the pull request saving functionality, I tried the following: The details from the previously created pull request are restored. Are you missing a clear when a pull request is created? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great!
Just a few comments on the tests. Is WithScheduler
still necessary? There are a bunch of tests that still use it. I few other minor commands inline on the tests.
[Test] | ||
public async Task SavesDraftForEditingComment() | ||
{ | ||
using (TestUtils.WithScheduler(Scheduler.CurrentThread)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need to use WithScheduler
after your unit testing fix?
@@ -115,6 +171,13 @@ IEnumerable<InlineCommentModel> CreateComments(params string[] bodies) | |||
} | |||
} | |||
|
|||
IPullRequestSessionFile CreateFile(string relativePath = "file.cs") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be static.
result.RelativePath.Returns(relativePath); | ||
return result; | ||
} | ||
|
||
IViewViewModelFactory CreateFactory() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be static.
@@ -327,12 +291,13 @@ InlineCommentModel CreateComment(string body) | |||
|
|||
IViewViewModelFactory CreateFactory() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be static.
@@ -0,0 +1,165 @@ | |||
////using System.Collections.Generic; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like commented out test file has come back?
No longer needed after #1997.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good. LGTM!
Save drafts of inline comments, PR reviews and PRs.
As described in #1905, it is easy to lose a comment that you're working on if you close the diff view accidentally. This PR saves drafts of comments as they are being written to an SQLite database.
In addition to saving drafts of inline comments, it also saves comments to PR reviews and PRs themselves.
The comments are written to an SQLite database directly instead of going through Akavache because in the case of inline reviews, there can be many drafts in progress on a separate file. When a diff is opened we need to look for any comments present on that file and show the most recent. That use-case didn't fit well with Akavache (being a pure key/value store).
Testing
Inline Comments
PR reviews
PRs
Depends on #1993
Fixes #1905