FModel/.github
Rob Trame 4d82992237
phase2: migrate App.xaml + App.xaml.cs to Avalonia bootstrap (#14) (#67)
* feat(#14): migrate App.xaml + App.xaml.cs to Avalonia bootstrap

- App.xaml: replace WPF/AdonisUI xmlns with Avalonia xmlns=https://github.com/avaloniaui; add FluentTheme; remove AdonisUI MergedDictionaries and BooleanToVisibilityConverter (Views/Resources/* will be re-added as they are migrated in later issues)
- App.xaml.cs: inherit Avalonia.Application; OnFrameworkInitializationCompleted replaces OnStartup; AppExit wired via IClassicDesktopStyleApplicationLifetime.Exit; AdonisUI MessageBox replaced with inline Avalonia Window dialog; P/Invokes guarded with OperatingSystem.IsWindows(); GetRegistryValue guarded for Linux (P3-006 will replace fully)
- Program.cs (new): Avalonia entry point with BuildAvaloniaApp + Main; AppDomain.UnhandledException registered to drive ShowErrorDialog
- AssemblyInfo.cs: remove WPF ThemeInfoAttribute (no Avalonia equivalent)
- FModel.csproj: StartupObject -> FModel.Program; add Serilog.Sinks.Console 6.1.1 (needed for AnsiConsoleTheme in debug logger); exclude Properties/Resources.resx + Designer.cs (WPF boilerplate, unreferenced)

Closes #14

* fix(#14): address code review findings in App bootstrap

[C1] Replace AppDomain.UnhandledException with Dispatcher.UIThread
     .UnhandledExceptionFilter — fires on UI thread, allows Handled=true
[C2] Wrap dialog.Show() fallback in try/catch; return early if app is
     shutting down to avoid silent crash
[M1] Add TODO(#15) comment for desktop.MainWindow assignment
[M2] Change Dispatcher.UIThread.Post → InvokeAsync; restructure
     ShowErrorDialog to only use tcs.Task in the modeless path
[M3] Restore Environment.Exit(0) in AppExit to preserve original
     termination behaviour until proper cancellation is in place
[m2] Add SolidColorBrush resources (AccentColorBrush, AlertColorBrush,
     ErrorColorBrush) alongside Color resources in App.xaml

* fix(#14): address second-pass review findings

[m1/s1] Move Dispatcher.UIThread.UnhandledExceptionFilter subscription
        to after Log.Logger is configured; Log.Error calls inside the
        handler were no-ops when exceptions occurred during the ~80-line
        init block (settings load, directory creation)
[m2]    Attach .ContinueWith(OnlyOnFaulted) to the InvokeAsync task in
        ShowErrorDialog so secondary exceptions in the error-handling
        path (UserSettings.Delete, Restart) are logged rather than
        silently swallowed as unobserved task faults

* Address review feedback
2026-03-11 20:32:20 -06:00
..
agents phase2: migrate App.xaml + App.xaml.cs to Avalonia bootstrap (#14) (#67) 2026-03-11 20:32:20 -06:00
ISSUE_TEMPLATE because human input can be trusted 2021-09-06 18:21:44 +02:00
workflows action updates 2025-12-10 21:59:59 +01:00
FUNDING.yml hmmm odd chance 🤔 2022-08-15 19:23:43 +02:00