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

Commit 5589c01

Browse files
committed
Revert pull request #1025 from github/feature/inline-reviews-tooltip
This reverts commit 2ad7b46, reversing changes made to d9116de.
1 parent 2cafd0a commit 5589c01

13 files changed

+9
-360
lines changed

src/GitHub.InlineReviews/GitHub.InlineReviews.csproj

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@
9292
<Compile Include="Peek\InlineCommentPeekResultPresentation.cs" />
9393
<Compile Include="Peek\InlineCommentPeekResultPresenter.cs" />
9494
<Compile Include="Properties\AssemblyInfo.cs" />
95-
<Compile Include="Resources.Designer.cs">
96-
<AutoGen>True</AutoGen>
97-
<DesignTime>True</DesignTime>
98-
<DependentUpon>Resources.resx</DependentUpon>
99-
</Compile>
10095
<Compile Include="SampleData\CommentThreadViewModelDesigner.cs" />
10196
<Compile Include="SampleData\DiffCommentThreadViewModelDesigner.cs" />
10297
<Compile Include="SampleData\PullRequestCommentsViewModelDesigner.cs" />
@@ -119,10 +114,6 @@
119114
<Compile Include="ViewModels\IPullRequestCommentsViewModel.cs" />
120115
<Compile Include="ViewModels\IssueCommentThreadViewModel.cs" />
121116
<Compile Include="ViewModels\PullRequestCommentsViewModel.cs" />
122-
<Compile Include="ViewModels\TooltipCommentThreadViewModel.cs" />
123-
<Compile Include="Views\TooltipCommentThreadView.xaml.cs">
124-
<DependentUpon>TooltipCommentThreadView.xaml</DependentUpon>
125-
</Compile>
126117
<Compile Include="Views\DiffCommentThreadView.xaml.cs">
127118
<DependentUpon>DiffCommentThreadView.xaml</DependentUpon>
128119
</Compile>
@@ -388,21 +379,13 @@
388379
</VSCTCompile>
389380
</ItemGroup>
390381
<ItemGroup>
391-
<EmbeddedResource Include="Resources.resx">
392-
<Generator>PublicResXFileCodeGenerator</Generator>
393-
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
394-
</EmbeddedResource>
395382
<EmbeddedResource Include="VSPackage.resx">
396383
<MergeWithCTO>true</MergeWithCTO>
397384
<ManifestResourceName>VSPackage</ManifestResourceName>
398385
<SubType>Designer</SubType>
399386
</EmbeddedResource>
400387
</ItemGroup>
401388
<ItemGroup>
402-
<Page Include="Views\TooltipCommentThreadView.xaml">
403-
<Generator>MSBuild:Compile</Generator>
404-
<SubType>Designer</SubType>
405-
</Page>
406389
<Page Include="Views\DiffCommentThreadView.xaml">
407390
<SubType>Designer</SubType>
408391
<Generator>MSBuild:Compile</Generator>

src/GitHub.InlineReviews/Resources.Designer.cs

Lines changed: 0 additions & 81 deletions
This file was deleted.

src/GitHub.InlineReviews/Resources.resx

Lines changed: 0 additions & 126 deletions
This file was deleted.

src/GitHub.InlineReviews/SampleData/CommentViewModelDesigner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System;
22
using System.Reactive;
3-
using ReactiveUI;
43
using GitHub.InlineReviews.ViewModels;
54
using GitHub.Models;
65
using GitHub.SampleData;
76
using GitHub.UI;
7+
using ReactiveUI;
88

99
namespace GitHub.InlineReviews.SampleData
1010
{

src/GitHub.InlineReviews/Tags/InlineCommentGlyphFactory.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ public UIElement GenerateGlyph(IWpfTextViewLine line, InlineCommentTag tag)
7070
{
7171
var glyph = CreateGlyph(tag);
7272
glyph.DataContext = tag;
73-
7473
glyph.MouseLeftButtonUp += (s, e) =>
7574
{
7675
if (OpenThreadView(tag)) e.Handled = true;

src/GitHub.InlineReviews/Tags/ShowInlineCommentGlyph.xaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
mc:Ignorable="d"
7-
ToolTipService.ShowDuration="600000" ToolTipService.HasDropShadow="True">
6+
mc:Ignorable="d">
87

98
<UserControl.Resources>
109
<!-- This will be the color of an added/deleted word in the diff view or the indicator margin color -->
1110
<SolidColorBrush x:Key="DiffChangeBackground" Color="DarkSlateGray" />
1211
</UserControl.Resources>
1312

14-
<UserControl.ToolTip>
15-
<ToolTip x:Name="CommentToolTip" />
16-
</UserControl.ToolTip>
1713

1814
<Grid Background="{DynamicResource DiffChangeBackground}">
1915
<Viewbox>
Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
using System;
22
using System.Windows.Controls;
3-
using GitHub.InlineReviews.Views;
4-
using GitHub.InlineReviews.ViewModels;
5-
using System.Linq;
6-
using GitHub.Models;
73

84
namespace GitHub.InlineReviews.Tags
95
{
@@ -14,29 +10,5 @@ public ShowInlineCommentGlyph()
1410
InitializeComponent();
1511
}
1612

17-
protected override void OnToolTipOpening(ToolTipEventArgs e)
18-
{
19-
var tag = DataContext as ShowInlineCommentTag;
20-
if (tag != null)
21-
{
22-
var comments = tag.Thread.Comments.Select(comment => new PullRequestReviewCommentModel
23-
{
24-
User = comment.User,
25-
Body = comment.Body,
26-
CreatedAt = comment.CreatedAt
27-
});
28-
29-
var viewModel = new TooltipCommentThreadViewModel(comments);
30-
var view = new TooltipCommentThreadView();
31-
view.DataContext = viewModel;
32-
33-
CommentToolTip.Content = view;
34-
}
35-
}
36-
37-
protected override void OnToolTipClosing(ToolTipEventArgs e)
38-
{
39-
CommentToolTip.Content = null;
40-
}
4113
}
4214
}

src/GitHub.InlineReviews/ViewModels/CommentThreadViewModel.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ public abstract class CommentThreadViewModel : ReactiveObject, ICommentThreadVie
1717
/// <summary>
1818
/// Intializes a new instance of the <see cref="CommentThreadViewModel"/> class.
1919
/// </summary>
20-
/// <param name="currentUser">The current user on null if not required.</param>
20+
/// <param name="currentUser">The current user.</param>
2121
/// <param name="commentModels">The thread comments.</param>
22-
public CommentThreadViewModel(IAccount currentUser = null)
22+
public CommentThreadViewModel(IAccount currentUser)
2323
{
24+
Guard.ArgumentNotNull(currentUser, nameof(currentUser));
25+
2426
Comments = new ObservableCollection<ICommentViewModel>();
2527
CurrentUser = currentUser;
2628
}

src/GitHub.InlineReviews/ViewModels/CommentViewModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class CommentViewModel : ReactiveObject, ICommentViewModel
2626
/// Initializes a new instance of the <see cref="CommentViewModel"/> class.
2727
/// </summary>
2828
/// <param name="thread">The thread that the comment is a part of.</param>
29-
/// <param name="currentUser">The current user or null if not used.</param>
29+
/// <param name="currentUser">The current user.</param>
3030
/// <param name="commentId">The ID of the comment.</param>
3131
/// <param name="body">The comment body.</param>
3232
/// <param name="state">The comment edit state.</param>
@@ -42,6 +42,7 @@ public CommentViewModel(
4242
DateTimeOffset updatedAt)
4343
{
4444
Guard.ArgumentNotNull(thread, nameof(thread));
45+
Guard.ArgumentNotNull(currentUser, nameof(currentUser));
4546
Guard.ArgumentNotNull(body, nameof(body));
4647
Guard.ArgumentNotNull(user, nameof(user));
4748

src/GitHub.InlineReviews/ViewModels/TooltipCommentThreadViewModel.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)