From 4e9f757ce17340f3f658e52179e777fff7319dfc Mon Sep 17 00:00:00 2001 From: "j.foucher" Date: Fri, 1 May 2026 09:40:50 +0200 Subject: [PATCH] UI rework: per-row actions, drop sidebar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the sidebar + hero + single big-button layout with a flat list of per-version cards. Each card carries its own action button: - Installed: ▶ Lancer (green, primary) - Available on server only: ⬇ Installer (blue, accent) + lighter blue card - Busy: inline mini progress bar with %, card tinted green Each card also exposes a "..." menu (left-click opens it) with: - Voir les release notes (works for installed and remote-only versions) - Ouvrir le dossier (installed only) - Supprimer cette version (installed only, with confirmation dialog) VersionRowViewModel owns its state (InstalledIdle / AvailableIdle / Downloading / Installing / Uninstalling) and its commands; MainViewModel wires per-row handlers after instantiation so the row VM stays UI-only and the services live one layer up. ReleaseNotesViewerDialog: separate dialog reused by the menu — same Markdown rendering as UpdateAvailableDialog but no download CTA. Theme: AccentButton + IconButton + dark ContextMenu/MenuItem styles. Behavior changes: - The single global SelectedVersion + AvailableUpdate are gone; each row is independently actionable. - The list now merges installed + remote: a version present on the server but not locally appears as a "remote-only" row, and vice-versa. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/PSLauncher.App/Resources/Theme.xaml | 71 +++ .../ViewModels/MainViewModel.cs | 474 ++++++++++-------- .../ViewModels/VersionRowViewModel.cs | 139 +++++ src/PSLauncher.App/Views/MainWindow.xaml | 294 ++++++----- src/PSLauncher.App/Views/MainWindow.xaml.cs | 15 + .../Views/ReleaseNotesViewerDialog.xaml | 42 ++ .../Views/ReleaseNotesViewerDialog.xaml.cs | 37 ++ 7 files changed, 730 insertions(+), 342 deletions(-) create mode 100644 src/PSLauncher.App/ViewModels/VersionRowViewModel.cs create mode 100644 src/PSLauncher.App/Views/ReleaseNotesViewerDialog.xaml create mode 100644 src/PSLauncher.App/Views/ReleaseNotesViewerDialog.xaml.cs diff --git a/src/PSLauncher.App/Resources/Theme.xaml b/src/PSLauncher.App/Resources/Theme.xaml index 9a05fbd..b1ef735 100644 --- a/src/PSLauncher.App/Resources/Theme.xaml +++ b/src/PSLauncher.App/Resources/Theme.xaml @@ -94,6 +94,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TextWrapping="Wrap" /> + - - - + + - + + /// Le bouton "..." ouvre son ContextMenu sur clic gauche (par défaut, ContextMenu ne s'ouvre qu'au clic droit). + /// + private void OnMoreMenuClick(object sender, RoutedEventArgs e) + { + if (sender is Button btn && btn.ContextMenu is { } menu) + { + menu.PlacementTarget = btn; + menu.Placement = PlacementMode.Bottom; + menu.IsOpen = true; + } + } } diff --git a/src/PSLauncher.App/Views/ReleaseNotesViewerDialog.xaml b/src/PSLauncher.App/Views/ReleaseNotesViewerDialog.xaml new file mode 100644 index 0000000..48ad195 --- /dev/null +++ b/src/PSLauncher.App/Views/ReleaseNotesViewerDialog.xaml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + +