< Summary

Line coverage
100%
Covered lines: 132
Uncovered lines: 0
Coverable lines: 132
Total lines: 260
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
File 1: !XamlIlPopulate(...)100%22100%
File 1: Build_1(...)100%11100%
File 2: .ctor()100%11100%

File(s)

/home/runner/work/LOCKnet/LOCKnet/src/LOCKnet.App/Views/CredentialListView.axaml

#LineLine coverage
 41<UserControl xmlns="https://github.com/avaloniaui"
 2             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 3             xmlns:vm="using:LOCKnet.App.ViewModels"
 4             xmlns:data="using:LOCKnet.Core.DataAbstractions"
 5             xmlns:mi="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
 6             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
 7             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 8             mc:Ignorable="d" d:DesignWidth="900" d:DesignHeight="600"
 9             x:Class="LOCKnet.App.Views.CredentialListView"
 10             x:DataType="vm:CredentialListViewModel"
 211             Background="{StaticResource BrushBg}">
 12
 13    <Design.DataContext>
 14        <x:Static Member="vm:DesignData.CredentialList"/>
 15    </Design.DataContext>
 16
 617    <Grid RowDefinitions="Auto,*,Auto">
 18
 19        <!-- ── Top bar ── -->
 620        <Border Grid.Row="0"
 221                Background="{StaticResource BrushSurface}"
 22                Padding="16,12">
 623            <Grid ColumnDefinitions="Auto,Auto,*,Auto,Auto,Auto,Auto">
 24
 25                <!-- Logo -->
 1026                <Image Grid.Column="0"
 227                       Source="/Assets/favicon-32x32.png"
 228                       Width="30" Height="30"
 29                       VerticalAlignment="Center"
 230                       Margin="0,0,8,0"/>
 31
 832                <TextBlock Grid.Column="1"
 233                           Text="LOCKnet"
 34                           FontSize="17"
 235                           FontWeight="Bold"
 236                           Foreground="{StaticResource BrushTextPrimary}"
 37                           VerticalAlignment="Center"
 238                           Margin="0,0,20,0"/>
 39
 640                <TextBox Grid.Column="2"
 241                         Text="{Binding SearchText, Mode=TwoWay}"
 242                         Watermark="Suchen…"
 43                         VerticalAlignment="Center"/>
 44
 1045                <Button Grid.Column="3"
 246                        Content="Neu"
 47                        Classes="primary"
 248                        Command="{Binding AddCommand}"
 49                        Margin="12,0,0,0"
 250                        Padding="14,8"
 51                        VerticalAlignment="Center"/>
 52
 1053                <Button Grid.Column="4"
 254                        Content="Bearbeiten"
 55                        Classes="ghost"
 256                        Command="{Binding EditCommand}"
 57                        Margin="8,0,0,0"
 258                        Padding="14,8"
 59                        VerticalAlignment="Center"/>
 1060                <Button Grid.Column="5"
 261                        Content="Hilfe"
 62                        Classes="ghost"
 263                        Command="{Binding ShowTutorialCommand}"
 64                        Margin="8,0,0,0"
 265                        Padding="14,8"
 66                        VerticalAlignment="Center"/>
 1067                <Button Grid.Column="6"
 268                        Content="Sperren"
 69                        Classes="ghost"
 270                        Command="{Binding LockCommand}"
 71                        Margin="8,0,0,0"
 272                        Padding="14,8"
 73                        VerticalAlignment="Center"/>
 74            </Grid>
 75        </Border>
 76
 77        <!-- ── List ── -->
 1278        <ListBox Grid.Row="1"
 79                 Padding="20,16"
 280                 ItemsSource="{Binding Credentials}"
 281                 SelectedItem="{Binding SelectedCredential, Mode=TwoWay}"
 82                 Background="Transparent"
 283                 BorderThickness="0">
 84            <ListBox.Styles>
 85                <!-- Base style: provides defaults so Style setters can override (Local Values would block this) -->
 286                <Style Selector="Border.credential-card">
 687                    <Setter Property="Background" Value="{StaticResource BrushSurface}"/>
 688                    <Setter Property="BorderBrush" Value="Transparent"/>
 689                    <Setter Property="BorderThickness" Value="3,0,0,0"/>
 90                </Style>
 91
 92                <!-- Suppress Fluent's built-in ListBoxItem highlight -->
 293                <Style Selector="ListBoxItem:pointerover /template/ ContentPresenter">
 694                    <Setter Property="Background" Value="Transparent"/>
 95                </Style>
 296                <Style Selector="ListBoxItem:selected /template/ ContentPresenter">
 697                    <Setter Property="Background" Value="Transparent"/>
 98                </Style>
 299                <Style Selector="ListBoxItem:selected:focus /template/ ContentPresenter">
 6100                    <Setter Property="Background" Value="Transparent"/>
 101                </Style>
 2102                <Style Selector="ListBoxItem:selected:pointerover /template/ ContentPresenter">
 6103                    <Setter Property="Background" Value="Transparent"/>
 104                </Style>
 105
 106                <!-- Hover -->
 2107                <Style Selector="ListBoxItem:pointerover Border.credential-card">
 6108                    <Setter Property="Background" Value="#252B4A"/>
 109                </Style>
 110
 111                <!-- Selected: accent left border + brighter background -->
 2112                <Style Selector="ListBoxItem:selected Border.credential-card">
 6113                    <Setter Property="Background" Value="#2D3575"/>
 6114                    <Setter Property="BorderBrush" Value="#6C63FF"/>
 115                </Style>
 2116                <Style Selector="ListBoxItem:selected:pointerover Border.credential-card">
 6117                    <Setter Property="Background" Value="#2D3575"/>
 6118                    <Setter Property="BorderBrush" Value="#6C63FF"/>
 119                </Style>
 2120                <Style Selector="ListBoxItem:selected:focus Border.credential-card">
 6121                    <Setter Property="Background" Value="#2D3575"/>
 6122                    <Setter Property="BorderBrush" Value="#6C63FF"/>
 123                </Style>
 124            </ListBox.Styles>
 125            <ListBox.ItemTemplate>
 4126                <DataTemplate x:DataType="data:CredentialRecord">
 4127                    <Border Classes="credential-card"
 1128                            CornerRadius="{StaticResource RadiusMd}"
 129                            Padding="16,12"
 1130                            Cursor="Hand">
 3131                        <Grid ColumnDefinitions="Auto,*,Auto">
 132
 133                            <!-- Avatar -->
 6134                            <Border Grid.Column="0"
 1135                                    Width="40" Height="40"
 136                                    CornerRadius="20"
 1137                                    Background="{StaticResource BrushAccent}"
 138                                    Opacity="0.35"
 1139                                    Margin="0,0,16,0"
 140                                    ClipToBounds="True">
 1141                                <Grid>
 5142                                    <mi:MaterialIcon Kind="{Binding IconKey, Converter={StaticResource StringToMaterialI
 143                                                     Width="20"
 1144                                                     Height="20"
 145                                                     Foreground="White"
 1146                                                     HorizontalAlignment="Center"
 147                                                     VerticalAlignment="Center"
 1148                                                     IsVisible="{Binding IconKey, Converter={x:Static StringConverters.I
 5149                                    <TextBlock Text="{Binding Title}"
 150                                               FontSize="15"
 1151                                               FontWeight="SemiBold"
 152                                               Foreground="White"
 1153                                               HorizontalAlignment="Center"
 154                                               VerticalAlignment="Center"
 1155                                               IsVisible="{Binding IconKey, Converter={x:Static StringConverters.IsNullO
 156                                </Grid>
 157                            </Border>
 158
 5159                            <StackPanel Grid.Column="1" Spacing="2" VerticalAlignment="Center">
 3160                                <TextBlock Text="{Binding Title}"
 161                                           FontSize="15"
 1162                                           FontWeight="SemiBold"
 1163                                           Foreground="{StaticResource BrushTextPrimary}"/>
 3164                                <TextBlock Text="{Binding Username}"
 165                                           FontSize="12"
 1166                                           Foreground="{StaticResource BrushTextSecondary}"
 1167                                           IsVisible="{Binding Username, Converter={x:Static StringConverters.IsNotNullO
 4168                                 <Border CornerRadius="4" Padding="5,2" Background="#1A2A5E"
 1169                                         IsVisible="{Binding CredentialType, Converter={StaticResource CredentialTypeIsA
 5170                                     <TextBlock Text="API-Schlüssel" FontSize="9" Foreground="#6C8FFF" FontWeight="SemiB
 171                                 </Border>
 4172                                 <Border CornerRadius="4" Padding="5,2" Background="#2D3A1A"
 1173                                         IsVisible="{Binding CredentialType, Converter={StaticResource CredentialTypeIsB
 5174                                     <TextBlock Text="Backup Codes" FontSize="9" Foreground="#A6D96A" FontWeight="SemiBo
 175                                 </Border>
 3176                                 <TextBlock Text="{Binding Url}"
 177                                            FontSize="11"
 1178                                            Foreground="{StaticResource BrushAccent}"
 1179                                            IsVisible="{Binding Url, Converter={x:Static StringConverters.IsNotNullOrEmp
 180                            </StackPanel>
 181
 4182                            <TextBlock Grid.Column="2"
 1183                                       Text="›"
 184                                       FontSize="18"
 1185                                       Foreground="{StaticResource BrushTextMuted}"
 186                                       VerticalAlignment="Center"
 1187                                       Margin="8,0,0,0"/>
 188                        </Grid>
 189                    </Border>
 190                </DataTemplate>
 191            </ListBox.ItemTemplate>
 192        </ListBox>
 193
 194        <!-- ── Bottom action bar ── -->
 6195        <Border Grid.Row="2"
 2196                Background="{StaticResource BrushSurface}"
 197                Padding="20,10">
 6198            <Grid ColumnDefinitions="Auto,Auto,*,Auto">
 199
 6200                <Button Grid.Column="0"
 2201                        Content="Löschen"
 202                        Classes="danger"
 2203                        Command="{Binding DeleteCommand}"/>
 204
 8205                <Button Grid.Column="1"
 2206                        Content="Kopieren"
 207                        Classes="ghost"
 2208                        Command="{Binding CopyPasswordCommand}"
 209                        Margin="8,0,0,0"/>
 210
 10211                <StackPanel Grid.Column="3"
 212                            Orientation="Horizontal"
 2213                            HorizontalAlignment="Right"
 214                            VerticalAlignment="Center"
 2215                            Spacing="16">
 8216                    <StackPanel Orientation="Horizontal"
 217                                Spacing="8"
 2218                                VerticalAlignment="Center"
 2219                                IsVisible="{Binding IsStorageCleanupPending}">
 10220                        <TextBlock Text="{Binding StorageCleanupMessage}"
 221                                   Foreground="#F4B266"
 2222                                   FontSize="12"
 223                                   TextWrapping="Wrap"
 2224                                   MaxWidth="340"
 225                                   VerticalAlignment="Center"/>
 8226                        <Button Content="Bereinigung erneut versuchen"
 227                                Classes="ghost"
 2228                                Command="{Binding RetryStorageCleanupCommand}"
 2229                                IsEnabled="{Binding !IsRetryingStorageCleanup}"
 230                                VerticalAlignment="Center"/>
 231                    </StackPanel>
 6232                    <TextBlock Text="{Binding LockTimerText}"
 2233                               Foreground="{StaticResource BrushTextMuted}"
 234                               FontSize="12"
 2235                               VerticalAlignment="Center"
 2236                               IsVisible="{Binding LockTimerText, Converter={x:Static StringConverters.IsNotNullOrEmpty}
 6237                    <TextBlock Text="{Binding StatusMessage}"
 2238                               Foreground="{StaticResource BrushSuccess}"
 239                               FontSize="12"
 2240                               VerticalAlignment="Center"
 2241                               IsVisible="{Binding StatusMessage, Converter={x:Static StringConverters.IsNotNullOrEmpty}
 242                </StackPanel>
 243
 244            </Grid>
 245        </Border>
 246
 247    </Grid>
 248
 249</UserControl>

/home/runner/work/LOCKnet/LOCKnet/src/LOCKnet.App/Views/CredentialListView.axaml.cs

#LineLine coverage
 1using Avalonia.Controls;
 2
 3namespace LOCKnet.App.Views;
 4
 5public partial class CredentialListView : UserControl
 6{
 27  public CredentialListView()
 28  {
 29    InitializeComponent();
 210  }
 11}