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

Conversation

@grokys
Copy link
Contributor

@grokys grokys commented Mar 20, 2018

When the user clicks on a "Reviewer" item in the PR details view, navigate to a new view to show the PR reviews by that user.

image

This PR also introduces:

  • A new global style for Expander: the default WPF expander style doesn't fit in well with Visual Studio
  • A TrimmedPathTextBlock control to intelligently trim paths (see screenshot above)

Depends on #1523
Part of #1491

grokys added 11 commits March 19, 2018 12:34
Need to make sure we match the start and end of the string.
We need to be able to read a user model by their login from the API.
This is needed to ensure comment summaries appear without newlines.
Displays a path and intelligently trims with ellipsis when the path doesn't fit in the allocated size.
The default expander style doesn't fit with the VS UI theme - set a new default style which uses a triangle octicon.
When the user clicks on a "Reviewer" item in the PR details view, navigate to a new view to show the PR reviews by that user.
And refactored the `PullRequestUserReviewsViewModel` a little bit to remove stuff that is no longer necessary.
@grokys grokys changed the base branch from feature/pr-reviews-master to feature/pr-details-review-list March 20, 2018 15:31
grokys added 2 commits March 20, 2018 17:01
Use the same triangle as used elsewhere (e.g. in `SectionControl`).
Fix a few theming issues.
@grokys grokys changed the title WIP: Display Pull Request Reviews for a User. Display Pull Request Reviews for a User. Mar 20, 2018
@grokys grokys changed the base branch from feature/pr-details-review-list to feature/pr-reviews-master March 20, 2018 16:30
@grokys grokys mentioned this pull request Mar 20, 2018
17 tasks
@meaghanlewis
Copy link
Contributor

This LGTM 👍

@jcansdale jcansdale changed the base branch from feature/pr-reviews-master to feature/pr-reviews April 4, 2018 10:41
@jcansdale jcansdale changed the base branch from feature/pr-reviews to feature/pr-reviews-master April 4, 2018 10:41
string RelativePath { get; }

/// <summary>
/// Gets a comment which opens the comment in a diff view.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be simply, "Opens the comment in a diff view"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, should be "Gets a command...". If you look around at C# documentation, properties always start with "Gets a" (for read-only properties) or "Gets or sets a" (for read/write properties). See https://softwareengineering.stackexchange.com/questions/193244/is-the-gets-or-sets-necessary-in-xml-documentation-of-properties and http://stylecop.soyuz5.com/SA1623.html.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I hadn't noticed that convention.

{
var text = value as string;
if (String.IsNullOrEmpty(text)) return null;
return Regex.Replace(text, @"\t|\n|\r", " ");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We we want to replace tabs with a single space as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're displaying a comment on a single line, it would make sense to me to convert tabs to spaces, because otherwise we'd be wasting space. Tabs are generally used for alignment between lines, so if we've got no lines it makes sense to strip them. Do you have an example where this wouldn't be a good idea?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I was just comparing it to the comment: "trims newlines from a string and replaces them with spaces".

@grokys
Copy link
Contributor Author

grokys commented Apr 5, 2018

@jcansdale addressed your feedback.

@grokys grokys merged commit bff9aac into feature/pr-reviews-master Apr 9, 2018
@grokys grokys deleted the feature/pr-user-reviews branch April 9, 2018 15:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants