From bd80f32b4b088fc6d804be29b6a78b5cc812a3d6 Mon Sep 17 00:00:00 2001 From: Jonathan Horvath Date: Sat, 24 Jan 2026 14:52:51 -0500 Subject: [PATCH 01/34] Fix code inspection issue --- src/UI/Windows/Views/Windows/MainWindow.xaml.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/UI/Windows/Views/Windows/MainWindow.xaml.cs b/src/UI/Windows/Views/Windows/MainWindow.xaml.cs index f3bc258..6663f9f 100644 --- a/src/UI/Windows/Views/Windows/MainWindow.xaml.cs +++ b/src/UI/Windows/Views/Windows/MainWindow.xaml.cs @@ -1,5 +1,4 @@ using System.Windows; -using System.Windows.Media; using OSDPBench.Core.Services; using OSDPBench.Core.ViewModels.Windows; using Wpf.Ui; From c55929c9be7a0674ee9a77c53b3046b1ee9f4102 Mon Sep 17 00:00:00 2001 From: Jonathan Horvath Date: Sat, 7 Feb 2026 20:35:43 -0500 Subject: [PATCH 02/34] Add Guidelines as submodule at lib/Guidelines Integrate shared WPF component library for design system reuse. Guidelines v1.0.0 with Apache 2.0 license. Next steps: Add project references and update App.xaml to use shared styles. Co-Authored-By: Claude Sonnet 4.5 --- .gitmodules | 3 +++ lib/Guidelines | 1 + 2 files changed, 4 insertions(+) create mode 160000 lib/Guidelines diff --git a/.gitmodules b/.gitmodules index 92596a9..b7e84bf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "src/UI/UsbSerialForAndroid"] path = src/UI/UsbSerialForAndroid url = https://github.com/bytedreamer/UsbSerialForAndroid +[submodule "lib/Guidelines"] + path = lib/Guidelines + url = https://github.com/Z-bit-Systems-LLC/Guidelines.git diff --git a/lib/Guidelines b/lib/Guidelines new file mode 160000 index 0000000..f915e95 --- /dev/null +++ b/lib/Guidelines @@ -0,0 +1 @@ +Subproject commit f915e956e71cf0f80cb1d5ca412178d1091e5c6c From 4b693335ca6ecfd1a933f255efbefe148b7815de Mon Sep 17 00:00:00 2001 From: Jonathan Horvath Date: Sat, 7 Feb 2026 20:38:38 -0500 Subject: [PATCH 03/34] Integrate Guidelines shared WPF library v1.0.0 - Add Guidelines project to solution - Reference ZBitSystems.Wpf.UI in Windows project - Update App.xaml to use shared design system via pack URIs - Remove migrated files: DesignTokens, ThemeSemanticColors, ComponentStyles, CopyTextBoxHelper - Keep LayoutTemplates.xaml (OSDP-specific, not migrated) - Update CLAUDE.md with submodule workflow documentation Phase 1 Complete: Design system and CopyTextBoxHelper migrated to shared library. All pages render correctly, theme switching works, no visual regressions. Build: Success (0 errors, 13 warnings - all XML docs in Guidelines library) Code Inspection: Clean (no new warnings in OSDP-Bench code) Co-Authored-By: Claude Sonnet 4.5 --- .gitignore | 1 + CLAUDE.md | 36 ++- OSDP-Bench.sln | 31 ++ src/UI/Windows/App.xaml | 9 +- src/UI/Windows/Helpers/CopyTextBoxHelper.cs | 64 ---- src/UI/Windows/Styles/ComponentStyles.xaml | 299 ------------------ src/UI/Windows/Styles/DesignTokens.xaml | 65 ---- .../Windows/Styles/ThemeSemanticColors.xaml | 19 -- src/UI/Windows/Windows.csproj | 1 + 9 files changed, 73 insertions(+), 452 deletions(-) delete mode 100644 src/UI/Windows/Helpers/CopyTextBoxHelper.cs delete mode 100644 src/UI/Windows/Styles/ComponentStyles.xaml delete mode 100644 src/UI/Windows/Styles/DesignTokens.xaml delete mode 100644 src/UI/Windows/Styles/ThemeSemanticColors.xaml diff --git a/.gitignore b/.gitignore index dd93f3d..7ce1313 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ BundleArtifacts/ /src/UI/WinUI (Package)/WinUI (Package).assets.cache .claude +results.sarif diff --git a/CLAUDE.md b/CLAUDE.md index 9f624dd..26c6f2e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -121,6 +121,38 @@ $sarif.runs[0].results | Where-Object { $_.level -eq 'warning' } | ForEach-Objec - Use meaningful variable names that reflect their purpose - Keep methods focused and small with a single responsibility +## Shared UI Components + +This project uses the [Guidelines](https://github.com/Z-bit-Systems-LLC/Guidelines) shared WPF library for design system components. + +### Working with the Guidelines Submodule + +**Initial clone (new developers):** +```bash +git clone --recursive https://github.com/Z-bit-Systems-LLC/OSDP-Bench.git +``` + +**Update Guidelines to latest version:** +```bash +git submodule update --remote lib/Guidelines +git add lib/Guidelines +git commit -m "Update Guidelines submodule to latest version" +``` + +**Making changes to Guidelines:** +If you need to modify the shared library: +1. Make changes in `lib/Guidelines/` +2. Test changes in OSDP-Bench (local project reference) +3. Commit and push in Guidelines repository +4. Update submodule reference in OSDP-Bench + +### Design System Reference +See `lib/Guidelines/src/ZBitSystems.Wpf.UI/Styles/StyleGuide.md` for: +- Available styles and design tokens +- Standard components and layouts +- Theme-aware semantic colors +- Usage examples and best practices + ## UI Style Guidelines - **Always use standard styles** - Apply predefined styles from the design system instead of inline properties - **Use design tokens for spacing** - Reference `{StaticResource Margin.Card}` instead of hardcoding values @@ -131,4 +163,6 @@ $sarif.runs[0].results | Where-Object { $_.level -eq 'warning' } | ForEach-Objec - **Use WrapPanel for responsive layouts** - When controls should be horizontal on wide screens but wrap to vertical on narrow screens, use WrapPanel instead of fixed Grid layouts - **Prefer dynamic resources for colors** - Use `{DynamicResource}` instead of `{StaticResource}` for colors to ensure theme compatibility -For detailed UI styling guidelines and examples, see: `src/UI/Windows/Styles/StyleGuide.md` +For detailed UI styling guidelines and examples, see: `lib/Guidelines/src/ZBitSystems.Wpf.UI/Styles/StyleGuide.md` + +**Note:** OSDP-specific layout templates remain in `src/UI/Windows/Styles/LayoutTemplates.xaml` diff --git a/OSDP-Bench.sln b/OSDP-Bench.sln index 50cfe1f..bdab9ac 100644 --- a/OSDP-Bench.sln +++ b/OSDP-Bench.sln @@ -30,6 +30,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{ED2EC291-3 CLAUDE.md = CLAUDE.md EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lib", "lib", "{3A8DF596-E814-FECC-DD4B-D8EF8AAC1A0D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Guidelines", "Guidelines", "{704960A3-6C7D-5CB1-1F34-76459FC7CBAE}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DDC3EA95-9E27-4E54-C9B7-EF99E65DDDE0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZBitSystems.Wpf.UI", "lib\Guidelines\src\ZBitSystems.Wpf.UI\ZBitSystems.Wpf.UI.csproj", "{B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -104,6 +112,26 @@ Global {79C7EB0F-A75B-4DA7-BDDF-12C9714B48DF}.Release|x64.Build.0 = Release|x64 {79C7EB0F-A75B-4DA7-BDDF-12C9714B48DF}.Release|x86.ActiveCfg = Release|Any CPU {79C7EB0F-A75B-4DA7-BDDF-12C9714B48DF}.Release|x86.Build.0 = Release|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Debug|ARM.ActiveCfg = Debug|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Debug|ARM.Build.0 = Debug|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Debug|ARM64.Build.0 = Debug|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Debug|x64.ActiveCfg = Debug|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Debug|x64.Build.0 = Debug|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Debug|x86.ActiveCfg = Debug|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Debug|x86.Build.0 = Debug|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Release|Any CPU.Build.0 = Release|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Release|ARM.ActiveCfg = Release|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Release|ARM.Build.0 = Release|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Release|ARM64.ActiveCfg = Release|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Release|ARM64.Build.0 = Release|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Release|x64.ActiveCfg = Release|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Release|x64.Build.0 = Release|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Release|x86.ActiveCfg = Release|Any CPU + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -111,6 +139,9 @@ Global GlobalSection(NestedProjects) = preSolution {5D426D86-43BB-4D6D-A6BF-0ACC65A19C92} = {8FB5794C-299E-4B9E-8D0D-6BFC695DA91B} {DD8BD355-FB29-42BD-AADD-C0E391EE1825} = {6AF5FFEF-AFBA-4BB8-A14F-FDE4AEEC19AB} + {704960A3-6C7D-5CB1-1F34-76459FC7CBAE} = {3A8DF596-E814-FECC-DD4B-D8EF8AAC1A0D} + {DDC3EA95-9E27-4E54-C9B7-EF99E65DDDE0} = {704960A3-6C7D-5CB1-1F34-76459FC7CBAE} + {B5DAB0A8-CF87-4799-8BAE-08CE2A33E97E} = {DDC3EA95-9E27-4E54-C9B7-EF99E65DDDE0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {09928BD4-7D4E-4C9A-86DA-49BC36820716} diff --git a/src/UI/Windows/App.xaml b/src/UI/Windows/App.xaml index 904c180..b2b16a4 100644 --- a/src/UI/Windows/App.xaml +++ b/src/UI/Windows/App.xaml @@ -11,10 +11,11 @@ - - - - + + + + + diff --git a/src/UI/Windows/Helpers/CopyTextBoxHelper.cs b/src/UI/Windows/Helpers/CopyTextBoxHelper.cs deleted file mode 100644 index 6b0479f..0000000 --- a/src/UI/Windows/Helpers/CopyTextBoxHelper.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; - -namespace OSDPBench.Windows.Helpers; - -public static class CopyTextBoxHelper -{ - public static readonly DependencyProperty CopyCommandProperty = - DependencyProperty.RegisterAttached( - "CopyCommand", - typeof(ICommand), - typeof(CopyTextBoxHelper), - new PropertyMetadata(null)); - - public static ICommand GetCopyCommand(DependencyObject obj) - { - return (ICommand)obj.GetValue(CopyCommandProperty); - } - - public static void SetCopyCommand(DependencyObject obj, ICommand value) - { - obj.SetValue(CopyCommandProperty, value); - } - - public static readonly ICommand DefaultCopyCommand = new RelayCommand( - parameter => - { - if (parameter is TextBox textBox && !string.IsNullOrEmpty(textBox.Text)) - { - try - { - Clipboard.SetText(textBox.Text); - } - catch (System.Runtime.InteropServices.COMException) - { - // Clipboard is locked by another application, ignore silently - // This is a common Windows issue and shouldn't crash the app - } - } - }); -} - -public class RelayCommand(Action execute, Func? canExecute = null) - : ICommand -{ - private readonly Action _execute = execute ?? throw new ArgumentNullException(nameof(execute)); - - public event EventHandler? CanExecuteChanged - { - add => CommandManager.RequerySuggested += value; - remove => CommandManager.RequerySuggested -= value; - } - - public bool CanExecute(object? parameter) - { - return parameter != null && (canExecute?.Invoke(parameter) ?? true); - } - - public void Execute(object? parameter) - { - if (parameter != null) _execute(parameter); - } -} \ No newline at end of file diff --git a/src/UI/Windows/Styles/ComponentStyles.xaml b/src/UI/Windows/Styles/ComponentStyles.xaml deleted file mode 100644 index e4af3c0..0000000 --- a/src/UI/Windows/Styles/ComponentStyles.xaml +++ /dev/null @@ -1,299 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/UI/Windows/Styles/DesignTokens.xaml b/src/UI/Windows/Styles/DesignTokens.xaml deleted file mode 100644 index 8c2be05..0000000 --- a/src/UI/Windows/Styles/DesignTokens.xaml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 4 - 8 - 16 - 24 - 32 - 48 - - - 10,5 - 0,0,16,0 - 8,4 - 0,0,0,16 - - - 16 - 8,4 - 16,8 - - - 4 - 8 - 12 - - - 12 - 14 - 16 - 20 - 24 - 32 - 36 - - - - - - - - - - - - - - - - - - - 28 - 32 - 40 - - 120 - 200 - 280 - - \ No newline at end of file diff --git a/src/UI/Windows/Styles/ThemeSemanticColors.xaml b/src/UI/Windows/Styles/ThemeSemanticColors.xaml deleted file mode 100644 index 196a4ee..0000000 --- a/src/UI/Windows/Styles/ThemeSemanticColors.xaml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/UI/Windows/Windows.csproj b/src/UI/Windows/Windows.csproj index 3303828..22ef924 100644 --- a/src/UI/Windows/Windows.csproj +++ b/src/UI/Windows/Windows.csproj @@ -45,6 +45,7 @@ + From c3cbdfe26dd73ee40c38bb26008c8d4542cf90b9 Mon Sep 17 00:00:00 2001 From: Jonathan Horvath Date: Sat, 7 Feb 2026 20:40:58 -0500 Subject: [PATCH 04/34] Remove duplicate StyleGuide.md StyleGuide.md is now maintained in the Guidelines shared library at: lib/Guidelines/src/ZBitSystems.Wpf.UI/Styles/StyleGuide.md ExampleImplementation.md remains in OSDP-Bench as it contains application-specific implementation examples. Co-Authored-By: Claude Sonnet 4.5 --- src/UI/Windows/Styles/StyleGuide.md | 289 ---------------------------- 1 file changed, 289 deletions(-) delete mode 100644 src/UI/Windows/Styles/StyleGuide.md diff --git a/src/UI/Windows/Styles/StyleGuide.md b/src/UI/Windows/Styles/StyleGuide.md deleted file mode 100644 index 21f57bb..0000000 --- a/src/UI/Windows/Styles/StyleGuide.md +++ /dev/null @@ -1,289 +0,0 @@ -# OSDP Bench UI Style Guide - -## Overview -This style guide provides a comprehensive design system for OSDP Bench, ensuring visual consistency and maintainability across the application. - -## Design System Structure - -### 1. Design Tokens (`DesignTokens.xaml`) -Foundation values for spacing, typography, colors, and sizing. - -#### Spacing System (8px grid) -```xml -{StaticResource Spacing.XSmall} -{StaticResource Spacing.Small} -{StaticResource Spacing.Medium} -{StaticResource Spacing.Large} -{StaticResource Spacing.XLarge} -{StaticResource Spacing.XXLarge} -``` - -#### Standard Margins & Padding -```xml -{StaticResource Margin.Card} -{StaticResource Margin.Control} -{StaticResource Margin.Button} -{StaticResource Padding.Card} -{StaticResource Padding.Control} -``` - -#### Typography Scale -```xml -{StaticResource FontSize.Caption} -{StaticResource FontSize.Body} -{StaticResource FontSize.BodyLarge} -{StaticResource FontSize.Subtitle} -{StaticResource FontSize.Title} -{StaticResource FontSize.Headline} -{StaticResource FontSize.Display} -``` - -### 2. Component Styles (`ComponentStyles.xaml`) -Reusable styles for UI components. - -#### Typography Usage -```xml - - - - - - - - - - - - - -``` - -#### Form Controls -```xml - -