Skip to content

Migrate HyPrism desktop launcher from Electron to Avalonia 12 - #405

Draft
freakdaniel wants to merge 142 commits into
mainfrom
avalonia
Draft

freakdaniel wants to merge 142 commits into
mainfrom
avalonia

Conversation

@freakdaniel

@freakdaniel freakdaniel commented Aug 24, 2026

Copy link
Copy Markdown
Member

Summary

This Draft PR migrates HyPrism from Electron.NET and React to a native Avalonia 12 desktop application on .NET 10

Electron required a separate frontend, an IPC bridge, duplicated contracts, and additional packaging logic

Avalonia replaces that boundary with direct C# service calls, native desktop integrations, one dependency graph, and headless UI testing

The new structure separates the launcher into three parts:

  • HyPrism.Core contains UI-independent launcher logic
  • HyPrism.Desktop contains the Avalonia application, views, styles, localization, and platform integrations
  • HyPrism.LocalNode provides autonomous local authentication and game services

Type of Change

  • Bug fix
  • New feature
  • Enhancement / improvement
  • Documentation update
  • Build / CI changes
  • Other: Desktop platform migration with removal of Electron and the IPC bridge

Changes

Avalonia desktop application

  • Replaced the Electron and React desktop shell with Avalonia 12.1.2
  • Added adaptive layouts for wide and compact windows
  • Added shared navigation, master-detail layouts, dialogs, popups, selectors, switches, segmented controls, and settings rows
  • Added reusable wizard transitions for instance creation, profile creation, and download source setup
  • Added a native startup loading screen and reusable Lottie animation handling
  • Added smooth scrolling, deferred content loading, batched UI updates, and render-focused performance improvements
  • Raised the Avalonia GPU resource cache limit to 256 MB
  • Replaced JSON localization files with .resx resources for all supported languages
  • Added native file picker, URI launcher, memory detection, GPU discovery, Discord Rich Presence, and remote image caching
  • Added compiled bindings by default for safer and faster view binding

User-facing functionality

  • Made Instances the primary launcher page and default landing screen
  • Removed the unused Home/Dashboard page to avoid duplicating instance management workflows
  • Removed customizable launcher backgrounds, including their settings, configuration field, assets, and screenshots
  • Added the instance list, creation flow, reordering, installation, launch, cancellation, and deletion foundation
  • Added a native news feed with article reading, rich content, image loading, caching, and external links
  • Added the instance list, creation flow, reordering, installation, launch, cancellation, and deletion foundation
  • Added navigation placeholders for instance-specific mods, discovery, worlds, console, and logs
  • Added a native profile manager with offline and official profiles
  • Added profile creation, editing, duplication, deletion, selection, reordering, folder access, and UUID copying
  • Added profile and instance play-time statistics
  • Updated OAuth sign-in through the system browser with a localized HyPrism callback page
  • Added authenticated source availability checks and automatic mirror selection
  • Added the graphics preference picker that lists detected graphics cards by name, defaults to the discrete card, and pins game rendering to the chosen card
  • Added shared wizard transitions and the initial WizardScreen structure
  • Added improved source setup and validation for URLs and manual mirror definitions

Core architecture

  • Moved launcher behavior into the UI-independent HyPrism.Core project
  • Removed the generated TypeScript API and the frontend IPC boundary
  • Reorganized authentication, profiles, instances, downloads, versions, mirrors, mods, patching, launch, configuration, and logging into focused services
  • Added dependency injection boundaries for platform-specific behavior
  • Added operation-scoped progress reporting and cancellation
  • Added game process tracking with launch, exit, failure, and recovery events
  • Added recovery for games that continue running after the launcher closes
  • Added play-time tracking for instances and profiles
  • Added stable multi-profile storage with one selected profile identifier
  • Added instance and profile change events so the UI no longer needs polling
  • Centralized launcher version, request headers, User-Agent generation, cache paths, and log paths
  • Normalized launcher JSON models to PascalCase
  • Updated cache layout and per-instance data handling
  • Added checksum validation for official Java runtime downloads
  • Added GPU adapter discovery through lspci with a sysfs fallback for sandboxed Linux launches, and virtual/software adapter filtering
  • Added per-adapter game launch pinning: DRI_PRIME=pci:<id> on Linux and the matching DXGI preference class on Windows, with legacy type-based preferences kept compatible

Local Node

  • Added HyPrism.LocalNode as a dedicated process for autonomous authentication
  • Added local accounts, sessions, cosmetics, skins, presence preferences, and compatible empty social responses
  • Added HTTPS hosting through h.localhost
  • Added certificate creation and trust handling
  • Added macOS certificate trust support and HTTPS smoke-test coverage
  • Attached Local Node lifetime to the active game process
  • Replaced server archive modification with the DualAuth Agent flow
  • Added isolated Local Node logging and request diagnostics

Packaging and CI

  • Updated the launcher version to 4.0.0
  • Added native publishing scripts for Windows, Linux, and macOS
  • Added Windows ZIP, MSI, and setup executable outputs
  • Added Linux DEB, RPM, AppImage, Flatpak, and tar archive outputs
  • Added a macOS ARM64 DMG output
  • Added separate build workflows for Windows, Linux, and macOS
  • Added Core, Desktop, and Local Node test jobs
  • Added a macOS Local Node HTTPS smoke test
  • Updated release automation for native artifacts
  • Added REUSE and SPDX compliance checks
  • Added documentation validation and GitHub Pages deployment

Tests

  • Split tests into Core, Desktop, and Local Node projects
  • Added Core tests for authentication, profiles, instances, downloads, launch, mirrors, configuration, cache paths, and progress reporting
  • Added headless Avalonia tests for layouts, navigation, responsive behavior, wizards, animations, settings, profiles, news, and startup
  • Added visual tree and rendering budget checks
  • Added render regression tests for the overlay modal, popup controls, note cards, and the GPU picker
  • Added Local Node tests for HTTPS hosting, account storage, session behavior, and certificate trust

Documentation

  • Replaced the previous documentation setup with Docusaurus
  • Added aligned English and Russian documentation
  • Documented the new Core, Desktop, and Local Node architecture
  • Documented building, testing, localization, packaging, and Avalonia performance guidance
  • Updated user guides for instances, profiles, mods, settings, download sources, and authentication
  • Added an Avalonia migration status page
  • Updated the README for the native application and new build process
  • Removed documentation for the deleted IPC generator and Electron frontend

Removed legacy components

  • Removed the React frontend and its npm dependencies
  • Removed Electron startup code and configuration
  • Removed the old launcher host
  • Removed the IPC source generator and generated frontend contracts
  • Removed obsolete services, models, manifests, and runtime configuration files
  • Moved reusable assets into the Avalonia desktop project

Remaining parity work

  • Implement every per-instance content page interface
    • Installed mods
    • Mod discovery
    • Worlds
    • Console
    • Logs
  • Complete the settings interfaces
    • Complete the Downloads settings interface
    • Complete the Java settings interface
    • Complete the Network settings interface
    • Complete the Data settings interface
  • Finish styling and layout consistency across all settings categories
  • Complete WizardScreen controls, buttons, spacing, and shared visual style
  • Implement the native onboarding flow
  • Run full manual smoke tests on every supported platform
  • Validate every release package through CI
  • Add screenshots and recordings before moving the PR out of Draft

Testing

  • Tested on Windows
  • Tested on Linux
  • Tested on macOS
  • Added / updated tests

Local validation results

  • Release build completed for all source and test projects
  • Desktop tests passed
  • Local Node tests passed
  • Core tests passed
  • Documentation content checks passed through the available Python command
  • TypeScript type checking passed
  • Docusaurus static export completed with PAGES_BASE_PATH=/HyPrism
  • SPDX source header validation passed
  • Complete manual launcher testing on Windows
  • Complete manual launcher testing on Linux
  • Complete manual launcher testing on macOS

Checklist

  • Code follows the project's style and conventions
  • Self-reviewed the complete diff before submitting
  • No unintended build artifacts or local configuration files are included
  • Documentation updated if needed

Documentation checklist

  • User documentation updated
  • Developer and architecture documentation updated
  • Removed IPC and bridge behavior documented
  • English and Russian documentation trees aligned
  • Screenshots/recordings are attached to the docs
  • English/Russian docs are human readable and related to their parent category
  • The styling and visual design have been fully developed
  • README updated
  • Documentation content and type checks completed separately
  • Docusaurus export builds for the /HyPrism base path
  • Final spell-check and lint completed

Screenshots / Recordings

  • Add wide layout screenshots for Instances, News, Profiles, and Settings
  • Add a compact layout recording
  • Add recordings of instance, profile, and download source wizard transitions
  • Add platform-specific screenshots if visual differences are found

SharpTheNightmare and others added 30 commits March 26, 2026 14:10
Hytale accounts with multiple profiles
- Move all source files from root to Sources/HyPrism.Launcher/
- Separate HyPrism.IpcGen and HyPrism.Tests into distinct projects
- Update CI workflows for new project structure
- Update documentation to reflect Sources/ layout
- Update all path references in build scripts
- Update FrontendGuide tech stack versions
- Add HyPrism.IpcGen as Roslyn-based IPC code generator
- Consolidate projects under Sources solution folder in HyPrism.sln
- Add pre-launch validation in LaunchGameAsync to check if instance has game client installed before attempting launch
- Create InstanceStatusResponse model with Playable flag and Reason field for instance status queries
- Add GetInstanceStatus IPC method (hyprism:instance:status) to expose instance playability to frontend
- Define specific error exit codes
- Add DetermineExitCodeForError helper method to map error messages to specific exit codes
- Auto-generate IPC TypeScript bindings for InstanceStatusResponse interface and instance status method
- Replace generic error code 1 with context-aware error codes for better debugging and user feedback
- Remove unused RosettaService
- Remove unused ButlerVersion variable and arch conversion for macOS
- Fix entire TS errors from emitter
- Update TS types
Deleted left overs of electron on the source code
@freakdaniel freakdaniel linked an issue Sep 9, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes hyprism bugs or errors core This is related to the HyPrism.Core project desktop This is related to the HyPrism.Desktop project documentation Improvements or additions to documentation enhancement New feature or request in progress translations Fix or update existing locales

Projects

None yet

4 participants