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

Commit 8340942

Browse files
authored
Merge pull request #2070 from github/donokuda/polish-conversation-view
Begin polish for conversation view
2 parents 1308c0e + 1d57ce8 commit 8340942

File tree

5 files changed

+122
-50
lines changed

5 files changed

+122
-50
lines changed

src/GitHub.VisualStudio.UI/Styles/ThemeDark.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
<Color x:Key="GitHubActionLinkItemColor">#FF0097FB</Color>
1414
<SolidColorBrush x:Key="GitHubActionLinkItemBrush" Color="{StaticResource GitHubActionLinkItemColor}" PresentationOptions:Freeze="true" />
15-
16-
<Color x:Key="GitHubHeaderSeparatorColor">#FF2D2D30</Color>
15+
16+
<Color x:Key="GitHubHeaderSeparatorColor">#FF3f3f46</Color>
1717
<SolidColorBrush x:Key="GitHubHeaderSeparatorBrush" Color="{StaticResource GitHubHeaderSeparatorColor}" PresentationOptions:Freeze="true" />
1818

1919
<Color x:Key="GitHubPaneTitleColor">#FFFFFFFF</Color>

src/GitHub.VisualStudio.UI/Styles/ThemeLight.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<Color x:Key="GitHubActionLinkItemColor">#FF0E70C0</Color>
1414
<SolidColorBrush x:Key="GitHubActionLinkItemBrush" Color="{StaticResource GitHubActionLinkItemColor}" PresentationOptions:Freeze="true" />
1515

16-
<Color x:Key="GitHubHeaderSeparatorColor">#FFEEEEF2</Color>
16+
<Color x:Key="GitHubHeaderSeparatorColor">#FFcccedb</Color>
1717
<SolidColorBrush x:Key="GitHubHeaderSeparatorBrush" Color="{StaticResource GitHubHeaderSeparatorColor}" PresentationOptions:Freeze="true" />
1818

1919
<Color x:Key="GitHubPaneTitleColor">#FF1B293E</Color>

src/GitHub.VisualStudio.UI/Views/CommentThreadView.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<ItemsControl ItemsSource="{Binding Comments}">
3434
<ItemsControl.ItemTemplate>
3535
<DataTemplate>
36-
<local:CommentView Margin="0 4"/>
36+
<local:CommentView />
3737
</DataTemplate>
3838
</ItemsControl.ItemTemplate>
3939
</ItemsControl>

src/GitHub.VisualStudio.UI/Views/CommentView.xaml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
<Grid IsEnabled="{Binding IsSubmitting, Converter={ui:InverseBooleanConverter}}">
3939
<!-- Displays an existing comment-->
40-
<StackPanel Orientation="Vertical" Margin="4">
40+
<StackPanel Orientation="Vertical" Margin="0 4 0 0">
4141
<StackPanel.Style>
4242
<Style TargetType="FrameworkElement">
4343
<Setter Property="Visibility" Value="Collapsed"/>
@@ -49,17 +49,20 @@
4949
</Style>
5050
</StackPanel.Style>
5151

52-
<DockPanel>
52+
<DockPanel Margin="4">
5353
<StackPanel Orientation="Horizontal" DockPanel.Dock="Left" >
5454
<views:ActorAvatarView Width="16"
5555
Height="16"
5656
ViewModel="{Binding Author}"/>
5757

58-
<TextBlock Foreground="{DynamicResource GitHubVsToolWindowText}" FontWeight="Bold" Text="{Binding Author.Login}" Margin="4 0"/>
58+
<TextBlock Foreground="{DynamicResource GitHubVsToolWindowText}" Margin="4 0">
59+
<Run FontWeight="Bold" Text="{Binding Author.Login}" />
60+
<Run Text="commented" />
61+
</TextBlock>
5962
<ui:GitHubActionLink Content="{Binding CreatedAt, Converter={ui:DurationToStringConverter}}"
60-
Command="{Binding OpenOnGitHub}"
61-
Foreground="{DynamicResource GitHubVsToolWindowText}"
62-
Opacity="0.75" />
63+
Command="{Binding OpenOnGitHub}"
64+
Foreground="{DynamicResource GitHubVsToolWindowText}"
65+
Opacity="0.75" />
6366
<Border Background="{DynamicResource VsBrush.InfoBackground}"
6467
BorderBrush="{DynamicResource VsBrush.AccentPale}"
6568
BorderThickness="1"
@@ -91,7 +94,7 @@
9194

9295
<markdig:MarkdownViewer Grid.Column="1" Grid.Row="1"
9396
Name="bodyMarkdown"
94-
Margin="0 2 0 0"
97+
Margin="24 4 0 0"
9598
Foreground="{DynamicResource VsBrush.WindowText}"
9699
Markdown="{Binding Body}"/>
97100

@@ -108,9 +111,14 @@
108111
</Style.Triggers>
109112
</Style>
110113
</DockPanel.Style>
114+
111115
<ui:OcticonImage DockPanel.Dock="Left" Icon="alert" Margin="0 0 4 0"/>
112116
<TextBlock Text="{Binding ErrorMessage}" TextWrapping="Wrap"/>
113117
</DockPanel>
118+
119+
<Border BorderThickness="0,1,0,0"
120+
BorderBrush="{DynamicResource GitHubHeaderSeparatorBrush}"
121+
Margin="0,8,0,0" />
114122
</StackPanel>
115123

116124
<!-- Displays edit view or a reply placeholder-->
@@ -141,16 +149,13 @@
141149
<RowDefinition Height="Auto"/>
142150
</Grid.RowDefinitions>
143151

144-
<Separator Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Margin="0 0 0 4"
145-
Background="{DynamicResource GitHubButtonBorderBrush}"/>
146-
147152
<ui:PromptTextBox Name="body"
148153
Grid.Column="1"
149154
Grid.Row="1"
150155
AcceptsReturn="True"
151156
AcceptsTab="True"
152157
IsReadOnly="{Binding IsReadOnly}"
153-
Margin="4 0"
158+
Margin="4 8"
154159
Text="{Binding Body, UpdateSourceTrigger=PropertyChanged}"
155160
TextWrapping="Wrap"
156161
VerticalAlignment="Center"
@@ -200,7 +205,7 @@
200205

201206
<StackPanel Name="buttonPanel"
202207
Grid.Column="1" Grid.Row="3"
203-
Margin="4 8"
208+
Margin="4 4 4 8"
204209
HorizontalAlignment="Left"
205210
Orientation="Horizontal"
206211
IsVisibleChanged="buttonPanel_IsVisibleChanged">

src/GitHub.VisualStudio.UI/Views/Documents/PullRequestPageView.xaml

Lines changed: 101 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
xmlns:markdig="clr-namespace:Markdig.Wpf;assembly=Markdig.Wpf"
88
xmlns:vsui="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.14.0"
99
xmlns:v="clr-namespace:GitHub.VisualStudio.Views"
10+
xmlns:ui="clr-namespace:GitHub.UI;assembly=GitHub.UI"
1011
mc:Ignorable="d" d:DesignHeight="1200" d:DesignWidth="800"
1112
MaxWidth="800">
1213
<d:DesignData.DataContext>
@@ -39,6 +40,7 @@
3940
</Grid.RowDefinitions>
4041

4142
<TextBlock Margin="0 8"
43+
Foreground="{DynamicResource VsBrush.WindowText}"
4244
Style="{DynamicResource {x:Static vsui:VsResourceKeys.TextBlockEnvironment200PercentFontSizeStyleKey}}">
4345
<Run Text="{Binding Title, Mode=OneWay}"/>
4446
<Hyperlink Command="{Binding OpenOnGitHub}">
@@ -47,7 +49,7 @@
4749
</TextBlock>
4850

4951
<StackPanel Grid.Row="1" Orientation="Horizontal">
50-
<TextBlock >
52+
<TextBlock Foreground="{DynamicResource VsBrush.WindowText}">
5153
<InlineUIContainer BaselineAlignment="Bottom">
5254
<v:IssueishStateBadge DataContext="{Binding State}" Margin="0,0,0,-2"/>
5355
</InlineUIContainer>
@@ -74,61 +76,126 @@
7476
</Border>
7577
</InlineUIContainer>
7678
</TextBlock>
77-
7879
</StackPanel>
7980
</Grid>
8081

81-
<Rectangle DockPanel.Dock="Top" Style="{StaticResource Separator}" Height="2" Margin="0,16"/>
82+
<Rectangle DockPanel.Dock="Top" Style="{StaticResource Separator}" Height="2" Margin="0 16 0 8"/>
8283

83-
<markdig:MarkdownViewer Name="bodyMarkdown" Markdown="{Binding Body}"/>
84+
<Border BorderBrush="{DynamicResource GitHubHeaderSeparatorBrush}" BorderThickness="1" Margin="0 4">
85+
<StackPanel Orientation="Vertical">
86+
<Border Padding="8" Background="{DynamicResource GitHubBranchNameBackgroundBrush}" BorderBrush="{DynamicResource GitHubHeaderSeparatorBrush}" BorderThickness="0 0 0 1">
87+
<StackPanel Orientation="Horizontal" DockPanel.Dock="Left" >
88+
<v:ActorAvatarView Width="16"
89+
Height="16"
90+
ViewModel="{Binding Author}"/>
91+
92+
<TextBlock Foreground="{DynamicResource GitHubVsToolWindowText}" Margin="4 0">
93+
<Run FontWeight="Bold" Text="{Binding Author.Login}" />
94+
<Run Text="commented" />
95+
</TextBlock>
96+
<ui:GitHubActionLink Content="{Binding CreatedAt, Converter={ui:DurationToStringConverter}}"
97+
Command="{Binding OpenOnGitHub}"
98+
Foreground="{DynamicResource GitHubVsToolWindowText}"
99+
Opacity="0.75" />
100+
<Border Background="{DynamicResource VsBrush.InfoBackground}"
101+
BorderBrush="{DynamicResource VsBrush.AccentPale}"
102+
BorderThickness="1"
103+
CornerRadius="3"
104+
Padding="2 1"
105+
Visibility="{Binding IsPending, Converter={ui:BooleanToVisibilityConverter}, FallbackValue=Collapsed}">
106+
<TextBlock FontSize="10" Text="{x:Static ghfvs:Resources.Pending}" />
107+
</Border>
108+
</StackPanel>
109+
</Border>
110+
111+
<markdig:MarkdownViewer Name="bodyMarkdown" Margin="8" Foreground="{DynamicResource VsBrush.WindowText}" Markdown="{Binding Body}"/>
112+
</StackPanel>
113+
</Border>
114+
115+
<StackPanel Orientation="Vertical" Margin="0 8">
116+
<Grid>
117+
<Grid.ColumnDefinitions>
118+
<ColumnDefinition Width="24" />
119+
<ColumnDefinition Width="Auto" />
120+
<ColumnDefinition Width="Auto" />
121+
</Grid.ColumnDefinitions>
122+
123+
<ghfvs:OcticonImage DockPanel.Dock="Left"
124+
Margin="2 0 4 0"
125+
Width="16"
126+
Foreground="{DynamicResource VsBrush.WindowText}"
127+
Icon="repo_push"
128+
Grid.Column="0"
129+
HorizontalAlignment="Center" />
130+
131+
<v:ActorAvatarView Width="16"
132+
Height="16"
133+
Grid.Column="1"
134+
ViewModel="{Binding Author}"/>
135+
136+
<TextBlock Foreground="{DynamicResource GitHubVsToolWindowText}" Margin="4 0" Grid.Column="2">
137+
<Run FontWeight="Bold" Text="{Binding Author.Login}" />
138+
<Run Text="added some commits" />
139+
</TextBlock>
140+
</Grid>
141+
</StackPanel>
84142

85143
<ItemsControl Name="timeline" ItemsSource="{Binding Timeline}">
86144
<ItemsControl.Resources>
87145
<DataTemplate DataType="{x:Type ghfvs:CommitSummariesViewModel}">
88-
<ItemsControl ItemsSource="{Binding Commits}"/>
146+
<Border>
147+
<StackPanel>
148+
<ItemsControl ItemsSource="{Binding Commits}"/>
149+
150+
<Border BorderThickness="0,1,0,0"
151+
BorderBrush="{DynamicResource GitHubHeaderSeparatorBrush}"
152+
DockPanel.Dock="Bottom"
153+
Margin="0,8,0,0"
154+
Padding="0,4,0,0" />
155+
</StackPanel>
156+
</Border>
89157
</DataTemplate>
90158

91159
<DataTemplate DataType="{x:Type ghfvs:CommitSummaryViewModel}">
92-
<DockPanel>
93-
<ghfvs:OcticonImage DockPanel.Dock="Left"
94-
Margin="0,0,2,0"
95-
Icon="git_commit"/>
96-
<v:ActorAvatarView DockPanel.Dock="Left"
97-
Width="16"
98-
Height="16"
99-
Margin="2"
100-
ViewModel="{Binding Author}"/>
101-
<TextBlock DockPanel.Dock="Right"
102-
FontFamily="Consolas"
103-
Margin="0,0,0,2"
104-
VerticalAlignment="Center">
105-
<Hyperlink Command="{Binding DataContext.ShowCommit, ElementName=timeline}"
106-
CommandParameter="{Binding Oid}">
107-
<Run Text="{Binding AbbreviatedOid, Mode=OneWay}"/>
108-
</Hyperlink>
109-
</TextBlock>
110-
<TextBlock Margin="0,0,0,2"
111-
Text="{Binding Header}"
112-
VerticalAlignment="Center"/>
113-
</DockPanel>
160+
<Border Padding="24 0 8 0">
161+
<DockPanel>
162+
<ghfvs:OcticonImage DockPanel.Dock="Left"
163+
Foreground="{DynamicResource VsBrush.GrayText}"
164+
Margin="0,0,2,0"
165+
Icon="git_commit"/>
166+
<v:ActorAvatarView DockPanel.Dock="Left"
167+
Width="16"
168+
Height="16"
169+
Margin="2"
170+
ViewModel="{Binding Author}"/>
171+
<TextBlock DockPanel.Dock="Right"
172+
FontFamily="Consolas"
173+
Margin="0,0,0,2"
174+
VerticalAlignment="Center">
175+
<Hyperlink Command="{Binding DataContext.ShowCommit, ElementName=timeline}"
176+
CommandParameter="{Binding Oid}">
177+
<Run Text="{Binding AbbreviatedOid, Mode=OneWay}"/>
178+
</Hyperlink>
179+
</TextBlock>
180+
<TextBlock Margin="0,0,0,2"
181+
Foreground="{DynamicResource VsBrush.WindowText}"
182+
Text="{Binding Header}"
183+
VerticalAlignment="Center"/>
184+
</DockPanel>
185+
</Border>
114186
</DataTemplate>
115187

116188
<DataTemplate DataType="{x:Type ghfvs:CommentViewModel}">
117189
<v:CommentView/>
118190
</DataTemplate>
119191

120192
<DataTemplate DataType="{x:Type ghfvs:CommentViewModelDesigner}">
121-
<v:CommentView/>
193+
<v:CommentView />
122194
</DataTemplate>
123195
</ItemsControl.Resources>
124196
<ItemsControl.ItemTemplate>
125197
<DataTemplate>
126-
<Border BorderThickness="0,1,0,0"
127-
BorderBrush="{DynamicResource GitHubHeaderSeparatorBrush}"
128-
Margin="0,16,0,0"
129-
Padding="0,16,0,0">
130-
<ContentControl Content="{Binding}"/>
131-
</Border>
198+
<ContentControl Content="{Binding}"/>
132199
</DataTemplate>
133200
</ItemsControl.ItemTemplate>
134201
</ItemsControl>

0 commit comments

Comments
 (0)