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

Commit c2f8b3e

Browse files
Merge pull request #2083 from github/features/check-suite-annotations-expanders
Adding expanders to the annotations view
2 parents 29a398d + f82a4f9 commit c2f8b3e

File tree

1 file changed

+50
-39
lines changed

1 file changed

+50
-39
lines changed

src/GitHub.VisualStudio.UI/Views/GitHubPane/PullRequestAnnotationsView.xaml

Lines changed: 50 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -27,63 +27,74 @@
2727
</Control.Resources>
2828

2929
<ScrollViewer VerticalScrollBarVisibility="Auto">
30-
<StackPanel>
31-
<StackPanel DockPanel.Dock="Top" Margin="8 0" Orientation="Vertical">
32-
<TextBlock FontSize="16" VerticalAlignment="Center">
33-
<Run FontWeight="SemiBold" Text="{Binding CheckSuiteName, Mode=OneWay}"/>
34-
<Run Text="/"/>
35-
<Run FontWeight="SemiBold" Text="{Binding CheckRunName, Mode=OneWay}"/>
36-
37-
<Run>for</Run>
38-
39-
<Hyperlink Command="{Binding NavigateToPullRequest}">
40-
<Run>#</Run><Run Text="{Binding PullRequestNumber, Mode=OneWay}"/>
41-
</Hyperlink>
42-
</TextBlock>
43-
44-
<TextBlock Foreground="{DynamicResource GitHubVsGrayText}"
45-
Margin="0"
46-
Text="{Binding PullRequestTitle}"
47-
TextWrapping="Wrap"/>
48-
49-
<markdig:MarkdownViewer FontFamily="Consolas"
50-
Visibility="{Binding CheckRunSummary, Converter={ghfvs:NullOrWhitespaceToVisibilityConverter}}"
51-
Markdown="{Binding CheckRunSummary}" />
52-
53-
<TextBlock FontFamily="Consolas"
54-
Foreground="{DynamicResource VsBrush.GrayText}"
55-
Visibility="{Binding CheckRunText, Converter={ghfvs:NullOrWhitespaceToVisibilityConverter}}">
56-
<Run Text="{Binding CheckRunText, Mode=OneWay}"/>
57-
</TextBlock>
58-
59-
<Rectangle Fill="{DynamicResource GitHubHeaderSeparatorBrush}" Height="1" Margin="-8 4"/>
60-
61-
<ItemsControl Margin="-4 0" ItemsSource="{Binding AnnotationsDictionary}">
30+
<DockPanel>
31+
<StackPanel DockPanel.Dock="Top" Orientation="Vertical">
32+
<StackPanel Margin="8 0 8 4">
33+
<TextBlock FontSize="16" VerticalAlignment="Center">
34+
<Run FontWeight="SemiBold" Text="{Binding CheckSuiteName, Mode=OneWay}"/>
35+
<Run Text="/"/>
36+
<Run FontWeight="SemiBold" Text="{Binding CheckRunName, Mode=OneWay}"/>
37+
38+
<Run>for</Run>
39+
40+
<Hyperlink Command="{Binding NavigateToPullRequest}">
41+
<Run>#</Run><Run Text="{Binding PullRequestNumber, Mode=OneWay}"/>
42+
</Hyperlink>
43+
</TextBlock>
44+
45+
<TextBlock Foreground="{DynamicResource GitHubVsGrayText}"
46+
Margin="0"
47+
Text="{Binding PullRequestTitle}"
48+
TextWrapping="Wrap"/>
49+
</StackPanel>
50+
51+
<Rectangle Fill="{DynamicResource GitHubHeaderSeparatorBrush}" Height="1" Margin="0 4"/>
52+
53+
<Expander Header="Body" Margin="0 4"
54+
FontWeight="SemiBold"
55+
Visibility="{Binding CheckRunSummary, Converter={ghfvs:NullOrWhitespaceToVisibilityConverter}}">
56+
<markdig:MarkdownViewer Margin="21 0 8 0" FontWeight="Normal" Markdown="{Binding CheckRunSummary}" />
57+
</Expander>
58+
59+
<Expander Margin="0 4"
60+
Visibility="{Binding CheckRunText, Converter={ghfvs:NullOrWhitespaceToVisibilityConverter}}">
61+
<Expander.Header>
62+
<TextBlock FontWeight="SemiBold" Text="Details" />
63+
</Expander.Header>
64+
<TextBlock Margin="21 0 8 0" FontFamily="Consolas"
65+
Foreground="{DynamicResource VsBrush.GrayText}">
66+
<Run Text="{Binding CheckRunText, Mode=OneWay}"/>
67+
</TextBlock>
68+
</Expander>
69+
70+
<Rectangle Fill="{DynamicResource GitHubHeaderSeparatorBrush}" Height="1" Margin="0 4"/>
71+
72+
<ItemsControl ItemsSource="{Binding AnnotationsDictionary}">
6273
<ItemsControl.ItemTemplate>
6374
<DataTemplate>
64-
<StackPanel>
75+
<StackPanel Margin="0 4">
6576
<Expander>
6677
<Expander.Header>
67-
<Label Foreground="{DynamicResource VsBrush.WindowText}" Content="{Binding Key}" FontWeight="SemiBold" ToolTip="{Binding Key}" />
78+
<TextBlock Margin="0 0 0 4" Foreground="{DynamicResource VsBrush.WindowText}" Text="{Binding Key}" FontWeight="SemiBold" />
6879
</Expander.Header>
6980

7081
<ItemsControl ItemsSource="{Binding Value}">
7182
<ItemsControl.ItemTemplate>
7283
<DataTemplate>
73-
<Grid Margin="26 0 0 8" >
84+
<Grid Margin="22 0 0 8" >
7485
<Grid.ColumnDefinitions>
75-
<ColumnDefinition Width="16" />
86+
<ColumnDefinition Width="20" />
7687
<ColumnDefinition Width="*" />
7788
</Grid.ColumnDefinitions>
7889

79-
<StackPanel Grid.Column="0" VerticalAlignment="Center">
90+
<StackPanel Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center">
8091
<imaging:CrispImage Width="16" Height="16" Moniker="{x:Static catalog:KnownMonikers.StatusInformation}" Visibility="{Binding Annotation.AnnotationLevel, Converter={ghfvs:EqualsToVisibilityConverter Notice}}"/>
8192
<imaging:CrispImage Width="16" Height="16" Moniker="{x:Static catalog:KnownMonikers.StatusWarning}" Visibility="{Binding Annotation.AnnotationLevel, Converter={ghfvs:EqualsToVisibilityConverter Warning}}"/>
8293
<imaging:CrispImage Width="16" Height="16" Moniker="{x:Static catalog:KnownMonikers.StatusError}" Visibility="{Binding Annotation.AnnotationLevel, Converter={ghfvs:EqualsToVisibilityConverter Failure}}"/>
8394
</StackPanel>
8495

8596
<StackPanel Margin="8,0,0,0" Grid.Column="1">
86-
<TextBlock FontWeight="SemiBold">
97+
<TextBlock FontWeight="SemiBold" TextWrapping="Wrap">
8798
<Run Text="{Binding Annotation.Title, Mode=OneWay}"/>
8899
</TextBlock>
89100

@@ -115,7 +126,7 @@
115126
</ItemsControl.ItemTemplate>
116127
</ItemsControl>
117128
</StackPanel>
118-
</StackPanel>
129+
</DockPanel>
119130
</ScrollViewer>
120131

121132
</UserControl>

0 commit comments

Comments
 (0)