<commit_before>﻿<ItemsControl x:Class="Anne.Diff.DiffView"
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:converters="clr-namespace:Anne.Foundation.Converters;assembly=Anne.Foundation"
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
              xmlns:diff="clr-namespace:Anne.Diff"
              xmlns:interfaces="clr-namespace:Anne.Features.Interfaces"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:selectors="clr-namespace:Anne.Diff.Selectors"
              BorderBrush="LightGray"
              ItemsSource="{Binding Mode=OneWay}"
              VirtualizingPanel.IsVirtualizing="True"
              VirtualizingPanel.ScrollUnit="Pixel"
              VirtualizingPanel.VirtualizationMode="Recycling"
              d:DesignHeight="300"
              d:DesignWidth="300"
              mc:Ignorable="d">
    <ItemsControl.Resources>
        <converters:PathStringToSyntaxHighlightingConverter x:Key="ToHighlighting" />

        <DataTemplate x:Key="AsciiView" DataType="{x:Type interfaces:IFileDiffVm}">
            <StackPanel Orientation="Vertical">
                <Label x:Name="PathLabel"
                       Background="LightSteelBlue"
                       Content="{Binding Path,
                                         Mode=OneTime}"
                       FontWeight="Bold"
                       Padding="4,2"
                       SnapsToDevicePixels="True" />

                <diff:DiffTextEditor FontFamily="Consolas"
                                     FontSize="12"
                                     HorizontalScrollBarVisibility="Hidden"
                                     IsReadOnly="True"
                                     SyntaxHighlighting="{Binding Path,
                                                                  Converter={StaticResource ToHighlighting},
                                                                  Mode=OneTime}"
                                     Text="{Binding Diff,
                                                    Mode=OneTime}"
                                     VerticalScrollBarVisibility="Auto"
                                     WordWrap="True" />

                <Line SnapsToDevicePixels="True"
                      Stroke="LightGray"
                      X1="0"
                      X2="{Binding ElementName=PathLabel,
                                   Path=ActualWidth,
                                   Mode=OneWay}" />
            </StackPanel>
        </DataTemplate>

        <DataTemplate x:Key="BinaryView" DataType="{x:Type interfaces:IFileDiffVm}">
            <StackPanel Orientation="Vertical">
                <Label x:Name="PathLabel"
                       Background="LightSteelBlue"
                       Content="{Binding Path,
                                         Mode=OneTime}"
                       FontWeight="Bold"
                       Padding="4,2"
                       SnapsToDevicePixels="True" />

                <TextBlock Text="Binary file" />

                <Line SnapsToDevicePixels="True"
                      Stroke="LightGray"
                      X1="0"
                      X2="{Binding ElementName=PathLabel,
                                   Path=ActualWidth,
                                   Mode=OneWay}" />
            </StackPanel>
        </DataTemplate>
    </ItemsControl.Resources>

    <ItemsControl.ItemTemplateSelector>
        <selectors:DiffTextEditorSelector Ascii="{StaticResource AsciiView}" Binary="{StaticResource BinaryView}"/>
    </ItemsControl.ItemTemplateSelector>

    <ItemsControl.Template>
        <ControlTemplate>
            <ScrollViewer CanContentScroll="True"
                          HorizontalScrollBarVisibility="Disabled"
                          PanningMode="Both"
                          VerticalScrollBarVisibility="Auto">
                <ItemsPresenter />
            </ScrollViewer>
        </ControlTemplate>
    </ItemsControl.Template>

    <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <VirtualizingStackPanel />
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
</ItemsControl><commit_msg>Label -> TextBlock<commit_after>﻿<ItemsControl x:Class="Anne.Diff.DiffView"
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:converters="clr-namespace:Anne.Foundation.Converters;assembly=Anne.Foundation"
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
              xmlns:diff="clr-namespace:Anne.Diff"
              xmlns:interfaces="clr-namespace:Anne.Features.Interfaces"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:selectors="clr-namespace:Anne.Diff.Selectors"
              BorderBrush="LightGray"
              ItemsSource="{Binding Mode=OneWay}"
              VirtualizingPanel.IsVirtualizing="True"
              VirtualizingPanel.ScrollUnit="Pixel"
              VirtualizingPanel.VirtualizationMode="Recycling"
              d:DesignHeight="300"
              d:DesignWidth="300"
              mc:Ignorable="d">
    <ItemsControl.Resources>
        <converters:PathStringToSyntaxHighlightingConverter x:Key="ToHighlighting" />

        <DataTemplate x:Key="AsciiView" DataType="{x:Type interfaces:IFileDiffVm}">
            <StackPanel Orientation="Vertical">
                <TextBlock x:Name="PathLabel"
                           Background="LightSteelBlue"
                           FontWeight="Bold"
                           Padding="4,2"
                           SnapsToDevicePixels="True"
                           Text="{Binding Path,
                                          Mode=OneTime}" />

                <diff:DiffTextEditor FontFamily="Consolas"
                                     FontSize="12"
                                     HorizontalScrollBarVisibility="Hidden"
                                     IsReadOnly="True"
                                     SyntaxHighlighting="{Binding Path,
                                                                  Converter={StaticResource ToHighlighting},
                                                                  Mode=OneTime}"
                                     Text="{Binding Diff,
                                                    Mode=OneTime}"
                                     VerticalScrollBarVisibility="Auto"
                                     WordWrap="True" />

                <Line SnapsToDevicePixels="True"
                      Stroke="LightGray"
                      X1="0"
                      X2="{Binding ElementName=PathLabel,
                                   Path=ActualWidth,
                                   Mode=OneWay}" />
            </StackPanel>
        </DataTemplate>

        <DataTemplate x:Key="BinaryView" DataType="{x:Type interfaces:IFileDiffVm}">
            <StackPanel Orientation="Vertical">
                <TextBlock x:Name="PathLabel"
                           Background="LightSteelBlue"
                           FontWeight="Bold"
                           Padding="4,2"
                           SnapsToDevicePixels="True"
                           Text="{Binding Path,
                                          Mode=OneTime}" />

                <TextBlock Text="Binary file" />

                <Line SnapsToDevicePixels="True"
                      Stroke="LightGray"
                      X1="0"
                      X2="{Binding ElementName=PathLabel,
                                   Path=ActualWidth,
                                   Mode=OneWay}" />
            </StackPanel>
        </DataTemplate>
    </ItemsControl.Resources>

    <ItemsControl.ItemTemplateSelector>
        <selectors:DiffTextEditorSelector Ascii="{StaticResource AsciiView}" Binary="{StaticResource BinaryView}" />
    </ItemsControl.ItemTemplateSelector>

    <ItemsControl.Template>
        <ControlTemplate>
            <ScrollViewer CanContentScroll="True"
                          HorizontalScrollBarVisibility="Disabled"
                          PanningMode="Both"
                          VerticalScrollBarVisibility="Auto">
                <ItemsPresenter />
            </ScrollViewer>
        </ControlTemplate>
    </ItemsControl.Template>

    <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <VirtualizingStackPanel />
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
</ItemsControl>
{'fraction_non_alphanumeric': 0.09311926605504588, 'fraction_numerical': 0.007798165137614679, 'mean_word_length': 1.3336901257693337, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 72, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 18}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 42, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '884892', 'n_tokens_mistral': 2123, 'n_tokens_neox': 1910, 'n_words': 230}