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

Speed up PR list and other improvements #1737

Merged
merged 41 commits into from
Jul 4, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
599efea
Basic reimplementation of PR list.
grokys Jun 14, 2018
b9ce76b
Double clicking a PR opens it.
grokys Jun 14, 2018
71f57c6
Implement PR state filter.
grokys Jun 14, 2018
c084813
Display more accurate comment count.
grokys Jun 15, 2018
77c48cc
Implement Refresh.
grokys Jun 15, 2018
421ad8d
Cancel previous load on refresh.
grokys Jun 15, 2018
3c9cebb
Implement filtering.
grokys Jun 15, 2018
4246b53
Display messages when no PRs found.
grokys Jun 15, 2018
aec7a5a
Started implementing an author filter.
grokys Jun 15, 2018
0921da9
Make author filter work.
grokys Jun 15, 2018
f1c3255
Close author filter on selection.
grokys Jun 15, 2018
e19d3c1
Merge branch 'refactor/pr-models' into refactor/pr-list
grokys Jun 17, 2018
373226f
Style PR list a bit.
grokys Jun 17, 2018
9b722a4
Wire up create pull request.
grokys Jun 17, 2018
f30cab3
Use IIssueListItemViewModelBase not IViewModel.
grokys Jun 17, 2018
f4a8b8e
Display the current PR in the list.
grokys Jun 17, 2018
58a49b5
Fix dark theme.
grokys Jun 17, 2018
55b1611
Switch between fork/parent repository.
grokys Jun 19, 2018
6157a24
Merge branch 'master' into refactor/pr-list
jcansdale Jun 19, 2018
2cccd71
Fix non-compiling tests.
grokys Jun 20, 2018
19f56c0
Merge branch 'refactor/pr-list' of https://github.com/github/VisualSt…
grokys Jun 20, 2018
5b6ac81
Merge branch 'master' into refactor/pr-list
StanleyGoldman Jun 20, 2018
dbe8d3b
Make virtualizing list unit testable.
grokys Jun 20, 2018
1991f03
Added failing test.
grokys Jun 20, 2018
1636c1d
Fix failing test.
grokys Jun 20, 2018
4876f10
Merge branch 'refactor/pr-list' of https://github.com/github/VisualSt…
grokys Jun 20, 2018
a94466b
Merge branch 'master' into refactor/pr-list
grokys Jun 21, 2018
307b45a
Merge branch 'master' into refactor/pr-list
grokys Jun 28, 2018
7718388
Consolidate Octokit.GraphQL package version.
grokys Jun 28, 2018
aa85e58
Added XML docs and logging.
grokys Jun 28, 2018
dd6d3f8
Added/updated view model XML docs.
grokys Jun 28, 2018
ebc0127
Don't show NoOpenItems when there's search criteria.
grokys Jun 29, 2018
a5871c6
Hide author filter when no items.
grokys Jun 29, 2018
a6200b3
Implement opening PR list in browser.
grokys Jun 29, 2018
7598d20
Added context menu to PR list.
grokys Jul 3, 2018
809ebca
Hide PR count when list is loading.
grokys Jul 3, 2018
f59a513
Clear user filter when item selected.
grokys Jul 3, 2018
022271e
Navigate to PR with enter key from PR list.
grokys Jul 3, 2018
db00183
Fix typo.
grokys Jul 4, 2018
d52302a
ReadParentOwnerLogin -> FindParent.
grokys Jul 4, 2018
7ce21a3
Fix non-compiling tests.
grokys Jul 4, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Style PR list a bit.
  • Loading branch information
grokys committed Jun 17, 2018
commit 373226fbdbeaaf719d848620a14969af3b4d72bb
104 changes: 30 additions & 74 deletions src/GitHub.VisualStudio.UI/Styles/ItemsControls.xaml
Original file line number Diff line number Diff line change
@@ -1,90 +1,46 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<SolidColorBrush x:Key="FlatListViewGridLineBrush" Color="{DynamicResource VsColor.GridLine}"/>
<SolidColorBrush x:Key="FlatListViewHighlightBackgroundBrush" Color="{DynamicResource VsColor.Highlight}"/>
<SolidColorBrush x:Key="FlatListViewHighlightForegroundBrush" Color="White"/>
<SolidColorBrush x:Key="FlatListViewHoverBrush" Color="{DynamicResource VsColor.InactiveBorder}"/>

<Style x:Key="FlatListViewItemStyle" TargetType="ListViewItem">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vsp="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0">
<Style TargetType="ListBoxItem">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="Padding" Value="4,1"/>
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<Border Name="Border" Background="Transparent" Padding="2">
<GridViewRowPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="border"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="true">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" TargetName="Border" Value="{StaticResource FlatListViewHoverBrush}"/>
<Setter Property="Background" TargetName="border" Value="{DynamicResource VsBrush.CommandBarHover}"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="TextBlock.Foreground" TargetName="Border" Value="{StaticResource FlatListViewHighlightForegroundBrush}"/>
<Setter Property="Background" TargetName="Border" Value="{StaticResource FlatListViewHighlightBackgroundBrush}"/>
<Setter Property="Background" TargetName="border" Value="{DynamicResource {x:Static vsp:TreeViewColors.SelectedItemActiveBrushKey}}" />
<Setter Property="TextElement.Foreground" TargetName="border" Value="{DynamicResource {x:Static vsp:TreeViewColors.SelectedItemActiveTextBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="FlatGridViewColumnHeaderGripper" TargetType="{x:Type Thumb}">
<Setter Property="Canvas.Right" Value="-9"/>
<Setter Property="Width" Value="18"/>
<Setter Property="Height" Value="{Binding ActualHeight, RelativeSource={RelativeSource TemplatedParent}}"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Background" Value="{StaticResource FlatListViewGridLineBrush}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border Background="Transparent" Padding="{TemplateBinding Padding}">
<Rectangle Fill="{TemplateBinding Background}" HorizontalAlignment="Center" Width="1"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="FlatGridViewColumnHeader" TargetType="GridViewColumnHeader">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{DynamicResource GitHubVsWindowText}"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
<Grid SnapsToDevicePixels="True">
<Border Name="HeaderBorder"
BorderThickness="0,0,0,1"
BorderBrush="{StaticResource FlatListViewGridLineBrush}"
Background="Transparent">
<TextBlock x:Name="ContentHeader" Margin="6,1,0,0" Text="{TemplateBinding Content}" Width="{TemplateBinding Width}" TextAlignment="Left" />
</Border>
<Canvas>
<Thumb Name="PART_HeaderGripper" Style="{StaticResource FlatGridViewColumnHeaderGripper}"/>
</Canvas>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" TargetName="HeaderBorder" Value="{StaticResource FlatListViewHoverBrush}"/>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="True" />
<Condition Property="Selector.IsSelectionActive" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="border" Value="{DynamicResource {x:Static vsp:TreeViewColors.SelectedItemInactiveBrushKey}}" />
<Setter Property="TextElement.Foreground" TargetName="border" Value="{DynamicResource {x:Static vsp:TreeViewColors.SelectedItemInactiveTextBrushKey}}" />
</MultiTrigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="TextElement.Foreground" TargetName="border" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="Role" Value="Padding">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
<Border x:Name="HeaderBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,1,0,1" Background="{TemplateBinding Background}"/>
<ControlTemplate.Triggers>
<Trigger Property="Height" Value="Auto">
<Setter Property="MinHeight" Value="20"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,12 @@
<StackPanel DockPanel.Dock="Top"
Margin="0,2,5,0"
Orientation="Horizontal"
TextBlock.Foreground="{DynamicResource GitHubVsGrayText}">
Opacity="0.5">
<TextBlock>
<Hyperlink>
<Run Text="{Binding Number, Mode=OneWay, StringFormat=#{0}}"/>
</Hyperlink>
<Run Text="{Binding UpdatedAt, Converter={ghfvs:DurationToStringConverter}, Mode=OneWay}"/>
<Run>by</Run>
<Run Text="{Binding Author.Login, Mode=OneWay}"/>
<Run Text="{Binding UpdatedAt, Converter={ghfvs:DurationToStringConverter}, Mode=OneWay}"/>
by
<Run Text="{Binding Author.Login, Mode=OneWay}"/>
</TextBlock>
<TextBlock Margin="4 0" Visibility="{Binding CommentCount, Converter={ghfvs:CountToVisibilityConverter}}">
<ghfvs:OcticonImage Icon="comment" Width="16" Height="16" Margin="0 0 0 -4"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.PullRequestListViewCustom}">
<d:DesignProperties.DataContext>
<ghfvs:PullRequestListViewModelDesigner Message="NoItemsMatchCriteria"/>
<ghfvs:PullRequestListViewModelDesigner Message="None"/>
</d:DesignProperties.DataContext>

<UserControl.Resources>
Expand All @@ -20,7 +20,7 @@
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>

<DockPanel>
<DockPanel DockPanel.Dock="Top"
Margin="8">
Expand Down Expand Up @@ -80,7 +80,7 @@
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
Visibility="{Binding Message, Converter={ghfvs:EqualsToVisibilityConverter None}}">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
<EventSetter Event="MouseDoubleClick" Handler="ListBoxItem_MouseDoubleClick"/>
</Style>
</ListBox.ItemContainerStyle>
Expand Down