Commit Graph

16 Commits

Author SHA1 Message Date
93f54d094a Theme : dark global ToolTip style
WPF's default ToolTip is a white-on-black system look that clashes
with the dark theme — visible whenever the user hovers a button with
ToolTip="…", a health banner pill, the « ⋯ » menu hint, etc.

Global TargetType=ToolTip style :
  Background  : Brush.Bg.Card
  Foreground  : Brush.Text.Primary
  Border      : Brush.Border, 1 px, 6 px corner radius
  Padding     : 12 × 8 (more breathing room than default)
  MaxWidth    : 360 — so the longer health-banner tooltips wrap to a
                second/third line instead of running off the right edge
  HasDropShadow : true (the only WPF-native cue that says « this is a
                  tooltip floating above » since we removed the OS skin)
  Inner TextBlock style cascades TextWrapping=Wrap on string-content
  tooltips so multi-line messages format nicely.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 18:52:38 +02:00
0bd4c8a4be Theme : pull palette back towards black (v0.18 was too navy)
User feedback : the blue shift was too much. Reining in the saturation:
  Window  : #0A1220 → #050A14
  Sidebar : #0E1422 → #0B1018
  Card    : #161D2C → #131826
  Footer  : #060A14 → #04070D
  BlueTint overlay : 8% opacity → 4%

The result is a near-black palette with just a hint of blue depth, rather
than a clearly navy one. Stays in the dark-theme zone while keeping a
discreet ASTERION VR vibe.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 18:17:28 +02:00
8366ca2669 v0.18.0 — Bluer dark palette to match ASTERION VR identity
Shifts the launcher background from pure black to deep navy and adds a
subtle blue tint over the body bitmap so the overall feel is closer to
the brand's blue/cyan accent rather than neutral black-on-grey.

Theme.xaml palette tweaks
- Brush.Bg.Window  : #000000 → #0A1220 (deep navy, ~95% black)
- Brush.Bg.Sidebar : #0E1218 → #0E1422
- Brush.Bg.Card    : #161B23 → #161D2C
- Brush.Bg.Footer  : #050709 → #060A14
- New Brush.Bg.BlueTint : #3050A0 @ 8% opacity, used as overlay

MainWindow.xaml
- Outer Grid Background : hardcoded "Black" → Brush.Bg.Window
  (so future tweaks of the brush propagate)
- New Rectangle on top of the body Background.png with the blue tint
  brush, IsHitTestVisible=False so it doesn't block clicks.

Versions bumped to 0.18.0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 11:30:24 +02:00
288cad585a Right sidebar nav: Library / Reports / Documentation tabs (WebView2)
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) <noreply@anthropic.com>
2026-05-03 08:52:51 +02:00
9cea07d6be Downloads: parallel multi-segment, sparse pre-alloc, faster SHA-256, URL auto-refresh
DownloadManager
- Parallel multi-segment download (default 8 connections, configurable up to 16)
  with per-segment Range requests. Bypasses OVH/Apache per-connection bandwidth
  throttling — typical speed-up ×4 to ×8 vs single connection.
- Reporter task on a dedicated Task with Interlocked aggregate counter (no lock
  contention with workers). Reports speed/ETA every 250ms even mid-download,
  fixes the "speed only shows at install transition" bug.
- Sparse file pre-allocation via FSCTL_SET_SPARSE before SetLength: no zero-fill,
  no SeManageVolumePrivilege, instant on any disk type. Removes 5-30s of
  preparation lag on HDD.
- HEAD probe skipped (trust manifest size, signed Ed25519). Falls back to
  single-segment if first segment returns 200 instead of 206.
- Resume URL comparison fixed: ignores HMAC querystring (?exp=&sig=) which
  changes per request, compares only host+path. Previously every resume started
  fresh because the old URL never matched the freshly signed one.
- Auto-refresh signed URL on 403/410 mid-DL: SemaphoreSlim with 5s debounce so
  8 simultaneous segment expirations trigger a single /api/download-url/ call.
  Slow-connection users (1 Mbps, 30+ hours for 14 GB) keep downloading
  transparently across multiple TTL cycles.
- Per-version hashAlgorithm:none in manifest skips client SHA-256 verification
  (still relying on Ed25519 manifest signature + HMAC URL).
- DangerButton style (red) added to Theme.xaml for the new cancel-resume action.

IntegrityService
- 16 MiB buffer (was 1 MiB), FileOptions.SequentialScan + Asynchronous,
  IncrementalHash (uses SHA-NI hardware extensions on .NET 8), double-buffering
  to overlap CPU and I/O. Typical 14 GB hash verification: 60-180s → 15-40s.

HttpClient
- MaxConnectionsPerServer=16, EnableMultipleHttp2Connections, HTTP/2 preferred,
  AutomaticDecompression=None (ZIPs are already compressed), 5min pooled
  connection lifetime.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 19:15:27 +02:00
b9ce591d22 ComboBox fixes: clickable center + display the option name, not the record
Two issues with the language picker after the dark restyling:

1. Click on the center of the ComboBox was a no-op — only the arrow
   triggered the dropdown. The previous template had a separate
   ToggleButton in column 1 covering only the arrow region. New
   template wraps the entire body in a single ToggleButton (with its
   own template carrying the border + arrow), and the ContentPresenter
   for the selected text floats on top with IsHitTestVisible="False"
   so clicks pass through to the toggle.

2. Selected item showed "LanguageOption { Code = auto, Name = ... }"
   instead of just the name. C# record types stringify with property
   names by default. Override LanguageOption.ToString() to return Name
   so the SelectionBox falls back to a clean label even though
   DisplayMemberPath="Name" is set on the dropdown items.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 13:44:00 +02:00
5d0284f1db Theme: dark ComboBox to match the rest of the launcher chrome
The native WPF ComboBox style is light grey on white — unreadable on
the dark Settings dialog. Re-template both ComboBox and ComboBoxItem:

- Body: #1A1A20 background (same as other inputs), border with hover
  highlight in Brush.Accent.
- Custom toggle button arrow in secondary text color, brightens on
  hover.
- Popup: Brush.Bg.Card background with border, 4px radius, 300px max
  height, scrollable.
- Items: highlighted hover in Brush.Accent with white foreground
  (same convention as MenuItem). Selected item gets a subtle
  #2C2C32 strip so the current value is visible after closing.

Affects every ComboBox in the app — only one for now (language
picker in Settings) but stays consistent if more get added later.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 13:10:14 +02:00
c27066ffe4 Theme: window control buttons hover in blue, not yellow-white
The min/max button hover was set to #FFFFFF22, intended as "white at
13% alpha". WPF Color literals are AARRGGBB though, not RRGGBBAA, so
that's actually opaque red+green+a-touch-of-blue → yellow-ish white,
unreadable on the dark chrome.

Switch to Brush.Accent (#3B82F6) on hover with white foreground,
matching the close button red on hover (#E81123) — both controls now
have clear, distinct hover states.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 11:50:59 +02:00
74f48419e6 UI: borderless window with custom chrome, default 1280x720
Window
------
- Default size 1280x720 (16:9 widescreen — matches the screenshot framing
  the user requested), MinWidth=980 MinHeight=600.
- WindowStyle=None + ResizeMode=CanResize: drop the OS title bar but
  keep edge resize.
- WindowChrome: CaptionHeight=56 makes the top bar Border the
  drag-handle for moving the window. ResizeBorderThickness=6 gives
  6px of grab area on each edge, GlassFrameThickness=0 disables Aero.

Custom chrome buttons
---------------------
Three new style keys in Theme.xaml:
- WindowControlButton: 46x32 transparent button, hovers at #FFFFFF22
  (semi-translucent white) — used for minimize and maximize/restore.
- WindowCloseButton: same shape, hovers at #E81123 (Win11 red).

Three handlers wired up: OnMinimizeClick, OnMaxRestoreClick, OnCloseClick.

Caption click-through
---------------------
WindowChrome reserves the caption area for window dragging by default —
buttons inside it would otherwise feel "dead". Each interactive control
in the top bar (Vérifier les MAJ / Dossier / License pill / Activer /
Paramètres / min / max / close) gets
shell:WindowChrome.IsHitTestVisibleInChrome="True" so clicks reach the
button instead of starting a drag. The text/logo region remains
draggable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 09:09:14 +02:00
2c79a5111e UI: brand background image + Pirulen font for PROSERVE wordmark
Window background
-----------------
Brush.Bg.Window is now pure #000000 (was a slightly blue-tinted dark).
The previous tint added value to the bitmap overlay, washing out the
image's bright spots. With pure black behind, the 50% overlay sits
cleanly on top.

Cards / sidebar / footer keep a faint blue tint (#161B23, #0E1218,
#050709) so the chrome reads as cool/dark while the body shows the
hardware texture clearly through the gaps.

Background image
----------------
Resources/Background.png (the engraved ASTERION VR wordmark on dark
metal) is now an embedded WPF Resource on the App project. MainWindow
draws it as the first child of the root grid, RowSpan=3, Stretch=
UniformToFill, Opacity=0.5, IsHitTestVisible=False so it never steals
clicks. It shows behind the body's empty regions; the cards' solid
backgrounds cover it where readability matters.

Pirulen wordmark
----------------
Resources/pirulen.otf (the user-supplied OpenType font) is embedded as
a Resource and exposed via Theme.xaml's Font.Brand FontFamily resource
using the standard pack URI form (#Pirulen). The top bar replaces the
plain "PROSERVE Launcher" with a horizontal stack: PROSERVE in 22pt
Pirulen + a smaller "Launcher" label in secondary text. The brand
typeface is reusable elsewhere via {StaticResource Font.Brand}.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 08:57:49 +02:00
fb2a18ddf7 Theme: retemplate ContextMenu, brighter MenuItem hover
The white strip on the left of the context menu wasn't from MenuItem
itself — it was the ContextMenu's default template that draws an icon
column on the left of its popup chrome. Retemplating MenuItem alone
left that column visible. Now the ContextMenu template is also reduced
to a single Border + IsItemsHost StackPanel — no icon column at all.

The MenuItem hover was barely visible (#2C2C32 vs Brush.Bg.Card #26262B).
Now hover paints the row in Brush.Accent (#3B82F6 vivid blue) with white
foreground — clearly readable.

HasDropShadow=False on the ContextMenu removes the default drop shadow
that was clashing with the WPF Aero-ish look.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 08:43:21 +02:00
4bec49bcaf v0.5 fixes: settings crash, ContextMenu icon column, auto-refresh
Settings crash on ⚙ click
-------------------------
The InverseBoolConverter was declared with `xmlns:local` inline on the
resource element. WPF's BAML compiler did parse it, but the resource
lookup at dialog open time was unstable depending on which XAML reader
processed it first. Move the namespace declaration to the
ResourceDictionary root (xmlns:res) — standard pattern, no more crash.

White strip on the left of the ContextMenu
------------------------------------------
WPF's default MenuItem template renders a column for the icon/check
indicator that's painted in SystemColors.MenuBarBrush (light gray on
default themes), creating a visible white strip on a dark menu. Fix by
fully retemplating MenuItem with just a Border + ContentPresenter for the
header, no icon column, no check indicator. Hover state uses #2C2C32 to
match the rest of the dark theme. Separator is also styled to use
Brush.Border.

Auto-refresh on startup
-----------------------
MainViewModel now triggers CheckForUpdatesAsync from its constructor via
a fire-and-forget Task. A 500ms delay lets the UI render before the
HTTP call, and the call is dispatched back to the UI thread for the VM
state mutations. Failures (offline, server down) are logged but don't
prevent the launcher from being usable on installed versions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 08:39:50 +02:00
eeff3c007b v0.5: settings dialog, persistent Serilog logs, Windows toasts
Settings (⚙ button in top bar)
------------------------------
SettingsDialog opens via OpenSettings command in MainViewModel. Sections:
- Serveur: server URL field + "Tester" button that GETs /api/health
  and reports status inline.
- Installation: installRoot path with Browse button
  (Microsoft.Win32.OpenFolderDialog, .NET 8 native).
- License: shows status / owner / exp / machine ID (read-only,
  copy-to-clipboard button), "Désactiver" wipes the cached license.
- Cache: shows download cache path + current size, opens or empties it.
- Logs & Application: launcher version + logs path with "Open" button.

Apply persists to LocalConfig via IConfigStore. After save, MainViewModel
RebuildList()s so changes to ServerBaseUrl or InstallRoot take effect
without restart.

Persistent Serilog logs
-----------------------
Logs now live in %LocalAppData%/PSLauncher/logs/app-YYYYMMDD.log, rolling
daily, 10 days kept. Output template includes source context and stack
traces. Generic Host wired up via .UseSerilog() so all
ILogger<T>-injected types share the sink. Unhandled AppDomain and
Dispatcher exceptions are routed to Serilog before propagation.

Windows toasts
--------------
IToastService + ToastService backed by Microsoft.Toolkit.Uwp.Notifications
(ToastContentBuilder.Show()). Required bumping the App TFM from
net8.0-windows to net8.0-windows10.0.17763.0 (with explicit
WindowsSdkPackageVersion=10.0.17763.41 to satisfy CommunityToolkit.Mvvm
8.3.2's MVVMTKCFG0003 check). Triggered on:
- successful install completion: "Proserve v{X} est prête à être lancée"
- install/download error: short error excerpt

Misc
----
- InverseBoolConverter for "disable button while busy" patterns.
- Added Markdig.Wpf import to ReleaseNotesViewerDialog (was implicit
  before, now required explicitly).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 11:35:22 +02:00
6128f7d220 UI: featured hero card, vivid status colors, themed Markdown render
Featured version
----------------
The highest installed version (or highest remote if none installed) now
gets a large hero card at the top of the window: 32px Proserve title,
oversized colored status pill, and a much bigger primary action button
(LANCER / INSTALLER 56px padding). All other versions move below into a
"AUTRES VERSIONS" section with a horizontal divider, displayed as the
existing compact rows.

MainViewModel exposes FeaturedVersion + OtherVersions instead of one
flat Versions collection.

Vivid status colors
-------------------
Card backgrounds were too close (dark gray vs slightly bluer dark gray).
New scheme:
- Installed: card stays dark gray, but a 4px green strip on the left and
  a vivid green "● Installée" pill make it unmistakable.
- Available remote-only: distinct dark blue card + vivid blue strip + blue
  "○ Disponible" pill.
- Busy: amber strip + amber pill, amber progress bar.

Brushes added to Theme.xaml: Brush.Status.Installed (#16A34A),
Brush.Status.Available (#3B82F6), Brush.Status.Busy (#F59E0B), each with
a matching very-dark-tint *Bg variant for card backgrounds.

Markdown theming
----------------
Release notes dialogs were unreadable (white background, near-white text).
Markdig.Wpf produces a FlowDocument with default white bg / black fg
regardless of the host control. Added MarkdownTheming.BuildThemedDocument
which renders the Markdown then walks all blocks/inlines to apply the
launcher's dark palette (Brush.Bg.Card transparent, Brush.Text.Primary
foreground, Brush.Accent links). Both UpdateAvailableDialog and
ReleaseNotesViewerDialog use this helper.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 09:50:51 +02:00
4e9f757ce1 UI rework: per-row actions, drop sidebar
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) <noreply@anthropic.com>
2026-05-01 09:40:50 +02:00
1c8c6803e8 Initial scaffolding: PS_Launcher v0.2
Client (C# / .NET 8 / WPF, MVVM via CommunityToolkit.Mvvm):
- PSLauncher.App: WPF UI dark theme (Epic-style sidebar + hero + big play button)
  with UpdateAvailableDialog rendering Markdown release notes via Markdig.Wpf.
- PSLauncher.Core: services for installation registry (scans Proserve v{X.Y.Z}/),
  process launcher, manifest fetch, SHA-256 integrity, HTTP download with
  progress, ZIP install via .tmp + atomic rename, update orchestrator.
- PSLauncher.Models: RemoteManifest, InstalledVersion, LocalConfig DTOs.

Server (PHP 8 for OVH mutualisé, deployed under www/PS_Launcher/):
- Front controller + routes /manifest and /releasenotes/{version}.
- Static signed-manifest workflow with tools/sign-manifest.php CLI to
  recompute SHA-256 and sizeBytes after each ZIP upload.
- .htaccess: HTTPS redirect, rewrite, security headers.
- config.example.php template; real config.php is gitignored.

Cohabiting versions: each release lives in its own Proserve v{version}/ folder
under installRoot. Old versions are never deleted automatically.

Roadmap: v0.3 = HTTP Range resume + Polly retry + state.json,
v0.4 = MySQL license + Ed25519 signatures + DPAPI, v0.5 = settings/UX polish.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 08:54:45 +02:00