refactor(configmanager): simplify SecureStore UI with unified info view

Consolidate SecureStoreLockedFormView and SecureStoreUnlockedFormView into
a single SecureStoreInfoFormView that displays store status and metadata.
Simplifies MainWindowViewModel by removing redundant state management.
Also adds design docs for RegexTransformer feature.
This commit is contained in:
Joseph Doherty
2026-01-22 09:40:38 -05:00
parent 5669bac221
commit 9bf0c29add
28 changed files with 2811 additions and 1527 deletions
@@ -13,43 +13,6 @@
<Border Height="1" Background="#2D3540" Margin="0,12,0,0"/>
</StackPanel>
<!-- Sheet Protection Section -->
<Border Background="#0D0F12" BorderBrush="#2D3540" BorderThickness="1"
CornerRadius="6" Padding="16">
<StackPanel Spacing="16">
<TextBlock Text="Sheet Protection" Foreground="#E6EDF5"
FontWeight="SemiBold" FontSize="14"/>
<!-- Criteria Sheet Password -->
<StackPanel Spacing="4">
<TextBlock Text="Criteria Sheet Password"
Foreground="#9BA8B8" FontSize="12" FontWeight="Medium"/>
<TextBox Text="{Binding CriteriaSheetPassword}"
Background="#232A35" Foreground="#E6EDF5"
BorderBrush="#3D4550" Height="36"
FontFamily="JetBrains Mono"
PasswordChar="*"
Watermark="(optional)"/>
<TextBlock Text="Password to protect the search criteria sheet"
Foreground="#5C6A7A" FontSize="11"/>
</StackPanel>
<!-- Data Sheet Password -->
<StackPanel Spacing="4">
<TextBlock Text="Data Sheet Password"
Foreground="#9BA8B8" FontSize="12" FontWeight="Medium"/>
<TextBox Text="{Binding DataSheetPassword}"
Background="#232A35" Foreground="#E6EDF5"
BorderBrush="#3D4550" Height="36"
FontFamily="JetBrains Mono"
PasswordChar="*"
Watermark="(optional)"/>
<TextBlock Text="Password to protect the data sheet"
Foreground="#5C6A7A" FontSize="11"/>
</StackPanel>
</StackPanel>
</Border>
<!-- Output Format Section -->
<Border Background="#0D0F12" BorderBrush="#2D3540" BorderThickness="1"
CornerRadius="6" Padding="16">
@@ -92,31 +55,17 @@
<TextBlock Text="Timezone" Foreground="#E6EDF5"
FontWeight="SemiBold" FontSize="14"/>
<Grid ColumnDefinitions="*,16,Auto">
<!-- Timezone ID -->
<StackPanel Grid.Column="0" Spacing="4">
<TextBlock Text="Timezone ID"
Foreground="#9BA8B8" FontSize="12" FontWeight="Medium"/>
<TextBox Text="{Binding TimezoneId}"
Background="#232A35" Foreground="#E6EDF5"
BorderBrush="#3D4550" Height="36"
FontFamily="JetBrains Mono"
Watermark="America/Chicago"/>
</StackPanel>
<!-- Timezone Abbreviation -->
<StackPanel Grid.Column="2" Spacing="4" Width="100">
<TextBlock Text="Abbreviation"
Foreground="#9BA8B8" FontSize="12" FontWeight="Medium"/>
<TextBox Text="{Binding TimezoneAbbreviation}"
Background="#232A35" Foreground="#E6EDF5"
BorderBrush="#3D4550" Height="36"
FontFamily="JetBrains Mono"
Watermark="CST"/>
</StackPanel>
</Grid>
<TextBlock Text="Used for converting UTC timestamps to local time in exports"
Foreground="#5C6A7A" FontSize="11"/>
<StackPanel Spacing="4">
<TextBlock Text="Timezone"
Foreground="#9BA8B8" FontSize="12" FontWeight="Medium"/>
<ComboBox ItemsSource="{Binding AvailableTimezones}"
SelectedItem="{Binding SelectedTimezone}"
Background="#232A35" Foreground="#E6EDF5"
BorderBrush="#3D4550" Height="36"
HorizontalAlignment="Stretch"/>
<TextBlock Text="Used for converting UTC timestamps to local time in exports"
Foreground="#5C6A7A" FontSize="11"/>
</StackPanel>
</StackPanel>
</Border>
@@ -0,0 +1,75 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:JdeScoping.ConfigManager.ViewModels.Forms"
x:Class="JdeScoping.ConfigManager.Views.Forms.SecureStoreInfoFormView"
x:DataType="vm:SecureStoreInfoFormViewModel">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Spacing="24" MaxWidth="600">
<!-- Header -->
<StackPanel>
<StackPanel Orientation="Horizontal" Spacing="12">
<PathIcon Data="M12.65 10C11.83 7.67 9.61 6 7 6C3.69 6 1 8.69 1 12C1 15.31 3.69 18 7 18C9.61 18 11.83 16.33 12.65 14H17V18H21V14H23V10H12.65M7 14C5.9 14 5 13.1 5 12C5 10.9 5.9 10 7 10C8.1 10 9 10.9 9 12C9 13.1 8.1 14 7 14Z"
Width="24" Height="24" Foreground="#F59E0B"/>
<TextBlock Text="Secure Store"
Foreground="#E6EDF5" FontSize="18" FontWeight="SemiBold"
VerticalAlignment="Center"/>
</StackPanel>
<Border Height="1" Background="#2D3540" Margin="0,12,0,0"/>
</StackPanel>
<!-- Instructions Card -->
<Border Background="#0D0F12" BorderBrush="#2D3540" BorderThickness="1"
CornerRadius="6" Padding="16">
<StackPanel Spacing="12">
<StackPanel Orientation="Horizontal" Spacing="8">
<PathIcon Data="M11 7V9H13V7H11M14 17V15H13V11H10V13H11V15H10V17H14M22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2C17.5 2 22 6.5 22 12Z"
Width="20" Height="20" Foreground="#3B82F6"/>
<TextBlock Text="{Binding InstructionText}"
Foreground="#E6EDF5" FontSize="14"
VerticalAlignment="Center"/>
</StackPanel>
</StackPanel>
</Border>
<!-- Store Info Card -->
<Border Background="#0D0F12" BorderBrush="#2D3540" BorderThickness="1"
CornerRadius="6" Padding="16">
<StackPanel Spacing="16">
<TextBlock Text="Store Information" Foreground="#E6EDF5"
FontWeight="SemiBold" FontSize="14"/>
<!-- Store Path -->
<StackPanel Spacing="4">
<TextBlock Text="Store Path"
Foreground="#9BA8B8" FontSize="12" FontWeight="Medium"/>
<TextBox Text="{Binding StorePath}"
Background="#1A1F26" Foreground="#9BA8B8"
BorderBrush="#2D3540" Height="36"
FontFamily="JetBrains Mono" FontSize="12"
IsReadOnly="True"/>
</StackPanel>
<!-- Key File Path -->
<StackPanel Spacing="4">
<TextBlock Text="Key File Path"
Foreground="#9BA8B8" FontSize="12" FontWeight="Medium"/>
<TextBox Text="{Binding KeyFilePath}"
Background="#1A1F26" Foreground="#9BA8B8"
BorderBrush="#2D3540" Height="36"
FontFamily="JetBrains Mono" FontSize="12"
IsReadOnly="True"/>
</StackPanel>
<!-- Secret Count -->
<StackPanel Spacing="4">
<TextBlock Text="Number of Secrets"
Foreground="#9BA8B8" FontSize="12" FontWeight="Medium"/>
<TextBlock Text="{Binding SecretCount}"
Foreground="#E6EDF5" FontSize="14"/>
</StackPanel>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -2,9 +2,9 @@ using Avalonia.Controls;
namespace JdeScoping.ConfigManager.Views.Forms;
public partial class SecureStoreLockedFormView : UserControl
public partial class SecureStoreInfoFormView : UserControl
{
public SecureStoreLockedFormView()
public SecureStoreInfoFormView()
{
InitializeComponent();
}
@@ -1,82 +0,0 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:JdeScoping.ConfigManager.ViewModels.Forms"
x:Class="JdeScoping.ConfigManager.Views.Forms.SecureStoreLockedFormView"
x:DataType="vm:SecureStoreLockedFormViewModel">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Spacing="24" MaxWidth="600">
<!-- Header with Lock Icon -->
<StackPanel>
<StackPanel Orientation="Horizontal" Spacing="12">
<PathIcon Data="M12 17C10.89 17 10 16.1 10 15C10 13.89 10.89 13 12 13C13.11 13 14 13.89 14 15C14 16.1 13.11 17 12 17M18 8C19.1 8 20 8.9 20 10V20C20 21.1 19.1 22 18 22H6C4.9 22 4 21.1 4 20V10C4 8.9 4.9 8 6 8H7V6C7 3.24 9.24 1 12 1C14.76 1 17 3.24 17 6V8H18M12 3C10.34 3 9 4.34 9 6V8H15V6C15 4.34 13.66 3 12 3Z"
Width="24" Height="24" Foreground="#FFB84D"/>
<TextBlock Text="{Binding StoreName}"
Foreground="#E6EDF5" FontSize="18" FontWeight="SemiBold"
VerticalAlignment="Center"/>
</StackPanel>
<Border Height="1" Background="#2D3540" Margin="0,12,0,0"/>
</StackPanel>
<!-- Lock Status Card -->
<Border Background="#0D0F12" BorderBrush="#2D3540" BorderThickness="1"
CornerRadius="6" Padding="16">
<StackPanel Spacing="16">
<!-- Status Message -->
<StackPanel Orientation="Horizontal" Spacing="12" HorizontalAlignment="Center">
<PathIcon Data="M12 17C10.89 17 10 16.1 10 15C10 13.89 10.89 13 12 13C13.11 13 14 13.89 14 15C14 16.1 13.11 17 12 17M18 8C19.1 8 20 8.9 20 10V20C20 21.1 19.1 22 18 22H6C4.9 22 4 21.1 4 20V10C4 8.9 4.9 8 6 8H7V6C7 3.24 9.24 1 12 1C14.76 1 17 3.24 17 6V8H18M12 3C10.34 3 9 4.34 9 6V8H15V6C15 4.34 13.66 3 12 3Z"
Width="48" Height="48" Foreground="#5C6A7A"/>
</StackPanel>
<TextBlock Text="This store is locked"
Foreground="#9BA8B8" FontSize="14" FontWeight="Medium"
HorizontalAlignment="Center"/>
<TextBlock Text="Enter your password to unlock and view secrets"
Foreground="#5C6A7A" FontSize="12"
HorizontalAlignment="Center"/>
</StackPanel>
</Border>
<!-- Store Information Card -->
<Border Background="#0D0F12" BorderBrush="#2D3540" BorderThickness="1"
CornerRadius="6" Padding="16">
<StackPanel Spacing="16">
<TextBlock Text="Store Information" Foreground="#E6EDF5"
FontWeight="SemiBold" FontSize="14"/>
<!-- Store Path -->
<StackPanel Spacing="4">
<TextBlock Text="Store Path"
Foreground="#9BA8B8" FontSize="12" FontWeight="Medium"/>
<TextBox Text="{Binding StorePath}"
Background="#232A35" Foreground="#E6EDF5"
BorderBrush="#3D4550" Height="36"
FontFamily="JetBrains Mono" FontSize="11"
IsReadOnly="True"/>
</StackPanel>
<!-- Last Modified -->
<StackPanel Spacing="4" IsVisible="{Binding LastModified, Converter={x:Static ObjectConverters.IsNotNull}}">
<TextBlock Text="Last Modified"
Foreground="#9BA8B8" FontSize="12" FontWeight="Medium"/>
<TextBlock Text="{Binding LastModified, StringFormat='{}{0:yyyy-MM-dd HH:mm:ss}'}"
Foreground="#E6EDF5" FontSize="13"
FontFamily="JetBrains Mono"/>
</StackPanel>
</StackPanel>
</Border>
<!-- Unlock Button -->
<Button Command="{Binding UnlockCommand}"
HorizontalAlignment="Center"
Background="#3B82F6" Foreground="#FFFFFF"
Padding="24,12" CornerRadius="6"
FontWeight="SemiBold">
<StackPanel Orientation="Horizontal" Spacing="8">
<PathIcon Data="M18 8C19.1 8 20 8.9 20 10V20C20 21.1 19.1 22 18 22H6C4.9 22 4 21.1 4 20V10C4 8.9 4.9 8 6 8H17V6C17 3.24 14.76 1 12 1C10.07 1 8.39 2.11 7.53 3.71L6.14 2.43C7.34 0.88 9.54 0 12 0C15.87 0 19 3.13 19 7V8H18M12 17C13.11 17 14 16.1 14 15C14 13.89 13.11 13 12 13C10.89 13 10 13.89 10 15C10 16.1 10.89 17 12 17Z"
Width="16" Height="16" Foreground="#FFFFFF"/>
<TextBlock Text="Unlock Store..."/>
</StackPanel>
</Button>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -1,125 +0,0 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:JdeScoping.ConfigManager.ViewModels.Forms"
x:Class="JdeScoping.ConfigManager.Views.Forms.SecureStoreUnlockedFormView"
x:DataType="vm:SecureStoreUnlockedFormViewModel">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Spacing="24" MaxWidth="600">
<!-- Header with Unlock Icon -->
<StackPanel>
<StackPanel Orientation="Horizontal" Spacing="12">
<PathIcon Data="M18 8C19.1 8 20 8.9 20 10V20C20 21.1 19.1 22 18 22H6C4.9 22 4 21.1 4 20V10C4 8.9 4.9 8 6 8H17V6C17 3.24 14.76 1 12 1C10.07 1 8.39 2.11 7.53 3.71L5.71 2.39C6.83 0.92 9.15 0 12 0C15.87 0 19 3.13 19 7V8H18M12 17C13.11 17 14 16.1 14 15C14 13.89 13.11 13 12 13C10.89 13 10 13.89 10 15C10 16.1 10.89 17 12 17Z"
Width="24" Height="24" Foreground="#22C55E"/>
<TextBlock Text="{Binding StoreName}"
Foreground="#E6EDF5" FontSize="18" FontWeight="SemiBold"
VerticalAlignment="Center"/>
</StackPanel>
<Border Height="1" Background="#2D3540" Margin="0,12,0,0"/>
</StackPanel>
<!-- Store Status Card -->
<Border Background="#0D0F12" BorderBrush="#2D3540" BorderThickness="1"
CornerRadius="6" Padding="16">
<StackPanel Spacing="16">
<TextBlock Text="Store Status" Foreground="#E6EDF5"
FontWeight="SemiBold" FontSize="14"/>
<!-- Store Path -->
<StackPanel Spacing="4">
<TextBlock Text="Store Path"
Foreground="#9BA8B8" FontSize="12" FontWeight="Medium"/>
<TextBox Text="{Binding StorePath}"
Background="#232A35" Foreground="#E6EDF5"
BorderBrush="#3D4550" Height="36"
FontFamily="JetBrains Mono" FontSize="11"
IsReadOnly="True"/>
</StackPanel>
<!-- Secret Count -->
<StackPanel Spacing="4">
<TextBlock Text="Secrets"
Foreground="#9BA8B8" FontSize="12" FontWeight="Medium"/>
<StackPanel Orientation="Horizontal" Spacing="8">
<TextBlock Text="{Binding SecretCount}"
Foreground="#E6EDF5" FontSize="24" FontWeight="Bold"
VerticalAlignment="Center"/>
<TextBlock Text="secret(s) stored"
Foreground="#5C6A7A" FontSize="13"
VerticalAlignment="Center"/>
</StackPanel>
</StackPanel>
<!-- Unsaved Changes Status -->
<Border Background="#151920" BorderBrush="#2D3540" BorderThickness="1"
CornerRadius="4" Padding="12">
<StackPanel Orientation="Horizontal" Spacing="8">
<!-- Status indicator when no unsaved changes -->
<PathIcon Data="M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z"
Width="20" Height="20" Foreground="#22C55E"
IsVisible="{Binding !HasUnsavedChanges}"/>
<TextBlock Text="All changes saved"
Foreground="#22C55E" FontSize="13" FontWeight="Medium"
VerticalAlignment="Center"
IsVisible="{Binding !HasUnsavedChanges}"/>
<!-- Status indicator when there are unsaved changes -->
<PathIcon Data="M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2M13 17H11V15H13V17M13 13H11V7H13V13Z"
Width="20" Height="20" Foreground="#FFB84D"
IsVisible="{Binding HasUnsavedChanges}"/>
<TextBlock Text="Unsaved changes"
Foreground="#FFB84D" FontSize="13" FontWeight="Medium"
VerticalAlignment="Center"
IsVisible="{Binding HasUnsavedChanges}"/>
</StackPanel>
</Border>
</StackPanel>
</Border>
<!-- Actions Card -->
<Border Background="#0D0F12" BorderBrush="#2D3540" BorderThickness="1"
CornerRadius="6" Padding="16">
<StackPanel Spacing="16">
<TextBlock Text="Actions" Foreground="#E6EDF5"
FontWeight="SemiBold" FontSize="14"/>
<StackPanel Orientation="Horizontal" Spacing="12">
<!-- Lock Store Button -->
<Button Command="{Binding LockCommand}"
Background="#3D4550" Foreground="#E6EDF5"
Padding="16,10" CornerRadius="6">
<StackPanel Orientation="Horizontal" Spacing="8">
<PathIcon Data="M12 17C10.89 17 10 16.1 10 15C10 13.89 10.89 13 12 13C13.11 13 14 13.89 14 15C14 16.1 13.11 17 12 17M18 8C19.1 8 20 8.9 20 10V20C20 21.1 19.1 22 18 22H6C4.9 22 4 21.1 4 20V10C4 8.9 4.9 8 6 8H7V6C7 3.24 9.24 1 12 1C14.76 1 17 3.24 17 6V8H18M12 3C10.34 3 9 4.34 9 6V8H15V6C15 4.34 13.66 3 12 3Z"
Width="16" Height="16" Foreground="#E6EDF5"/>
<TextBlock Text="Lock Store"/>
</StackPanel>
</Button>
<!-- Add Secret Button -->
<Button Command="{Binding AddSecretCommand}"
Background="#22C55E" Foreground="#FFFFFF"
Padding="16,10" CornerRadius="6">
<StackPanel Orientation="Horizontal" Spacing="8">
<PathIcon Data="M19 13H13V19H11V13H5V11H11V5H13V11H19V13Z"
Width="16" Height="16" Foreground="#FFFFFF"/>
<TextBlock Text="Add Secret"/>
</StackPanel>
</Button>
<!-- Save Button -->
<Button Command="{Binding SaveCommand}"
Background="#3B82F6" Foreground="#FFFFFF"
Padding="16,10" CornerRadius="6"
IsEnabled="{Binding HasUnsavedChanges}">
<StackPanel Orientation="Horizontal" Spacing="8">
<PathIcon Data="M15 9H5V5H15M12 19C10.34 19 9 17.66 9 16C9 14.34 10.34 13 12 13C13.66 13 15 14.34 15 16C15 17.66 13.66 19 12 19M17 3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V7L17 3Z"
Width="16" Height="16" Foreground="#FFFFFF"/>
<TextBlock Text="Save"/>
</StackPanel>
</Button>
</StackPanel>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -1,11 +0,0 @@
using Avalonia.Controls;
namespace JdeScoping.ConfigManager.Views.Forms;
public partial class SecureStoreUnlockedFormView : UserControl
{
public SecureStoreUnlockedFormView()
{
InitializeComponent();
}
}