From 288cad585a35f2868d990c0244d135cc7070a371 Mon Sep 17 00:00:00 2001 From: "j.foucher" Date: Sun, 3 May 2026 08:52:51 +0200 Subject: [PATCH] Right sidebar nav: Library / Reports / Documentation tabs (WebView2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The body of the launcher is now a 2-column layout: - Left : swappable content area - Right (200px) : sidebar with 3 nav buttons + active-state highlighting Three pages, all under the same window chrome / footer: 1. **Library** (default) — the existing main view (featured version, other versions list, floating "Vérifier les MAJ" button, copyright). 2. **Reports** — embedded WebView2 navigated to a configurable URL. Default http://localhost/ProserveReport/ which matches the local stats tool installed on each customer machine alongside XAMPP. 3. **Documentation** — WebView2 with a configurable URL, falls back to a placeholder explaining where to set it if empty. Implementation - LocalConfig gains ReportUrl + DocumentationUrl (string). - MainViewModel gains LauncherPage enum + CurrentPage state with Navigate{Library,Report,Documentation}Command. ReportUri / DocumentationUri parse the strings to Uri for WebView2.Source. - Theme.xaml: NavButton style (transparent, left-aligned, hover darken, active state highlighted via Tag bool + accent left-border). - InverseBoolToVisibilityConverter added (true → Collapsed) for the documentation placeholder fallback. - Microsoft.Web.WebView2 NuGet (1.0.2792.45). Runtime is pre-installed on Win11 and auto-pushed via Windows Update on Win10. If absent, WebView2 surfaces an error which the user sees inline. - Settings → Avancés → Serveur extended with the two URL fields. - Strings.cs: NavLibrary / NavReport / NavDocumentation, SettingsReportUrl / SettingsDocsUrl, DocsPlaceholder, WebViewLoadError. Sidebar localized in 5 languages. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/PSLauncher.App/PSLauncher.App.csproj | 5 ++ .../InverseBoolToVisibilityConverter.cs | 18 +++++ src/PSLauncher.App/Resources/Theme.xaml | 42 ++++++++++ .../ViewModels/MainViewModel.cs | 34 ++++++++ .../ViewModels/SettingsViewModel.cs | 6 ++ src/PSLauncher.App/Views/MainWindow.xaml | 79 ++++++++++++++++++- src/PSLauncher.App/Views/SettingsDialog.xaml | 17 ++++ src/PSLauncher.Core/Localization/Strings.cs | 22 ++++++ src/PSLauncher.Models/LocalConfig.cs | 15 ++++ 9 files changed, 237 insertions(+), 1 deletion(-) create mode 100644 src/PSLauncher.App/Resources/InverseBoolToVisibilityConverter.cs diff --git a/src/PSLauncher.App/PSLauncher.App.csproj b/src/PSLauncher.App/PSLauncher.App.csproj index cbeff65..b035d50 100644 --- a/src/PSLauncher.App/PSLauncher.App.csproj +++ b/src/PSLauncher.App/PSLauncher.App.csproj @@ -40,6 +40,11 @@ + + diff --git a/src/PSLauncher.App/Resources/InverseBoolToVisibilityConverter.cs b/src/PSLauncher.App/Resources/InverseBoolToVisibilityConverter.cs new file mode 100644 index 0000000..7607627 --- /dev/null +++ b/src/PSLauncher.App/Resources/InverseBoolToVisibilityConverter.cs @@ -0,0 +1,18 @@ +using System.Globalization; +using System.Windows; +using System.Windows.Data; + +namespace PSLauncher.App.Resources; + +/// +/// Inverse de : true → Collapsed, false → Visible. +/// Utile pour afficher un placeholder quand un binding bool est false (ex. "DocumentationUrl est vide"). +/// +public sealed class InverseBoolToVisibilityConverter : IValueConverter +{ + public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) + => value is bool b && b ? Visibility.Collapsed : Visibility.Visible; + + public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) + => value is Visibility v && v != Visibility.Visible; +} diff --git a/src/PSLauncher.App/Resources/Theme.xaml b/src/PSLauncher.App/Resources/Theme.xaml index dde54d5..bed4e6b 100644 --- a/src/PSLauncher.App/Resources/Theme.xaml +++ b/src/PSLauncher.App/Resources/Theme.xaml @@ -3,6 +3,7 @@ xmlns:res="clr-namespace:PSLauncher.App.Resources"> + pack://application:,,,/Resources/#Pirulen @@ -72,6 +73,47 @@ + + +