* fix: address remaining WPF→Avalonia gaps for phase 2 completion
Resolves r6e/FModel-Linux#84
- Convert Colors.xaml & Icons.xaml to Avalonia xmlns
- Migrate CommitControl to Avalonia (replace DataTriggers with IsVisible)
- Migrate SearchTextBox to Avalonia (StyledProperty, native Watermark)
- Migrate TreeViewItemBehavior to Avalonia attached properties
- Replace ListCollectionView with DataGridCollectionView in 8 ViewModels
- Add Framework/CompositeCollection as WPF CompositeCollection replacement
- Remove AdonisUI.Controls refs from LoadCommand & AddEditDirectoryCommand
- Replace SystemParameters with Avalonia screen API in CUE4ParseViewModel
- Rewrite Resources.xaml for Avalonia Fluent theme (~2150→290 lines)
- Extend CommitMessageConverter with HasDescription parameter support
* fix: address review findings for PR #85
- C1: Fix ToolTip syntax (TextBlock.ToolTip → ToolTip.Tip) in tree view
- C2: Add Fill binding to folder icons via ConverterParameter=Brush
- C3: Convert AddEditDirectoryCommand.ShowDialog() to async with owner
- M1: Convert keyed Style → ControlTheme + Theme= in all consumers
- M2: Fix CommitControl badge overlap (Latest/Current mutual exclusivity)
Add FallbackValue=False for null-safe Asset.IsLatest binding
- M3: Add TODO(P4-004) markers for OpenFileDialog/SaveFileDialog
- M4: Implement IDisposable on CompositeCollection; dispose on replace
- PR: Add UrlToBitmapConverter for HTTP avatar image loading
- PR: Fix ContextMenu DataContext in GameFilesTabControl ContentTemplate
Restore 'Disable Alpha Channel' toggle (NoAlpha binding)
- PR: Replace ElementName=TabControlName with direct DataContext bindings
- PR: TreeViewItemBehavior uses GetObservable(IsSelectedProperty) with
proper IDisposable subscription cleanup
- S1: Clarify UpdateViewModel grouping TODO (non-DataGrid limitation)
- S2: Cache compiled Regex in SearchViewModel.ItemFilter
- m3: Implement TabItemFillSpace with HorizontalAlignment=Stretch
Also updates FolderToGeometryConverter to support ConverterParameter
for explicit brush/geometry selection.
* fix: address review #2 findings on PR #85
- M1/m1/m2: UrlToBitmapConverter — sync download with ConcurrentDictionary
URL cache, 4-space indent, doc comment noting async limitation
- M2: Remove duplicate IsVisible attribute on Latest badge Border
(MultiBinding property element takes precedence; attribute was dead code)
- m3: Add TimeSpan.FromSeconds(1) timeout to user-input Regex construction
- PR: ZIndex → Panel.ZIndex in SearchTextBox.xaml (Avalonia attached prop)
- PR: ShadowEffect comment updated to reflect key removal (no consumers)
- PR: CustomSeparator Tag TextBlock hidden when empty via
StringConverters.IsNotNullOrEmpty (eliminates unwanted 10px margin)
- PR: CustomVerticalSeparator BasedOn changed from default Separator to
CustomSeparator (preserves tagged template inheritance from WPF)
- PR: AddEditDirectoryCommand — early return when owner is null instead
of silently skipping dialog
- PR: CompositeCollection.Count — skip non-ICollection sources instead
of O(n) enumeration fallback
* Fix Avalonia parity gaps in updates, styles, and dialogs
* fix: address parity review follow-ups and unresolved PR comments
* Fix remaining PR review thread regressions
* Address review findings: thread safety, Linux guards, indentation, and cleanup
- [C1] Fix LoadCoAuthors thread race by snapshotting Commits before Task.Run
- [M1] Remove IsAsync=True (WPF-only) from Avalonia bindings
- [M2] Add OperatingSystem.IsWindows() guard for Win32 OpenFileDialog
- [M3] Add null-safety for Application.Current in PlayPause converter
- [N1] Add BrushTransition to HighlightedCheckBox for animation parity
- [N2] Dispose TreeViewItem subscriptions on DetachedFromVisualTree
- [N3] Fix SelectionMode converter: only Multiple uses multi-select
- [S1] Simplify AddEditDirectoryCommand owner-null to early return
- [S3] Remove dead WPF trigger comments from UpdateView.xaml
- [S4] Add 10s timeout to UrlToBitmapConverter HttpClient
- PR: Reformat UrlToBitmapConverter to 4-space indentation
- PR: Catch RegexMatchTimeoutException in SearchViewModel filter
* Fix review round 2: ActualWidth→Bounds, IsAsync removal, FindAncestor xmlns, misc
Critical:
- C1: Replace ActualHeight/ActualWidth with Bounds.Height/Bounds.Width
in UpdateView, MainWindow, SettingsView, DirectorySelector (Avalonia
has no ActualWidth/ActualHeight properties)
- C2: Remove remaining IsAsync=True from SearchView.xaml and
AudioPlayer.xaml (WPF-only, no-op in Avalonia)
Major:
- M1: Add xmlns:views for FModel.Views and replace dotted sub-namespace
local:Views.SettingsView with views:SettingsView in all 23
FindAncestor bindings (avoids ambiguous XAML type resolution)
- M2: CompositeCollection.Count now skips non-ICollection sources
instead of enumerating them (O(1) for current callers)
Minor:
- N1: Add Application.Current null guard in FolderToGeometryConverter
(matches PlaybackStateToPlayPauseConverter pattern)
Suggestions:
- S1: UrlToBitmapConverter.LoadAsync now cleans up _inFlight on all
exit paths (defense-in-depth for exceptional failures)
- S2: Add comment in CommitMessageConverter documenting interaction
with LoadCoAuthors co-author cleanup
* fix: merge resource dicts, regex cache, handler cleanup, null-init
- Merge Colors.xaml, Icons.xaml, Resources.xaml into App.xaml so
StaticResource/DynamicResource lookups resolve at runtime
- Cache invalid regex state in SearchViewModel to avoid repeated
recompilation on every filter invocation
- Detach DetachedFromVisualTree handler in TreeViewItemBehavior
when IsBroughtIntoViewWhenSelected is set to false
- Fix LoadingModeToSelectionModeConverter doc to match behavior
- Initialize Commit/Author backing fields with null! to satisfy
non-nullable contract before JSON deserialization
- Add Debug.Fail in CompositeCollection.Count for non-ICollection
sources to surface unexpected usage in development
* fix: load missing resource dictionaries, remove dead style refs, fix using
- App.xaml: add ResourceInclude for FileContextMenu, FolderContextMenu,
and TiledExplorer/Resources.xaml so StaticResource lookups resolve at
runtime (C1 fix)
- TiledExplorer/Resources.xaml: remove ContextMenu Setters from both
TiledExplorer and AssetsListBox styles; Avalonia does not support
x:Shared="False", so the shared instance would break when two
ListBoxes reference the same ContextMenu. ListBoxItemBehavior already
handles assignment programmatically via TryFindResource on right-click.
- SettingsView.xaml: remove 11 references to undefined TextBoxDefaultStyle;
HotkeyTextBox inherits FluentTheme TextBox styling by default (C2 fix)
- LoadingModeToSelectionModeConverter.cs: add missing 'using FModel' for
ELoadingMode resolution (M1 fix)
* fix: convert Resources.xaml to Styles root, restore toggle button states
- Resources.xaml: change root from <ResourceDictionary> to <Styles> so
StyleInclude in App.xaml correctly loads an IStyle-implementing element.
All keyed resources (ControlThemes, converters) moved into
<Styles.Resources>; selector-based styles (audio controls, FoldingMargin)
are direct <Styles> children.
- AssetsExplorerToggleButtonStyle: restore IsChecked-dependent behavior
using Avalonia selectors. :checked shows FolderIconAlt + accent background,
:unchecked shows AssetIcon + default background. Tooltip shows hotkey.
- MainWindow.xaml: add Classes="AssetsExplorerToggle" to the toggle button
so the selector-based checked/unchecked styles match.
* Fix Round 7 review findings: ControlTheme, ToolTip.Tip, dead code
- C1: Convert keyed Styles to ControlTheme in TiledExplorer/Resources.xaml,
update Style= to Theme= in MainWindow.xaml, convert CustomRichTextBox
to auto-applying Style Selector in Resources.xaml
- M1: Fix ToolTip= to ToolTip.Tip= across SearchView, SettingsView,
AudioPlayer, and DirectorySelector (22 occurrences)
- m1: Remove duplicate _inFlight.TryRemove in UrlToBitmapConverter.cs
- m2: Remove dead Result property from CustomDir.xaml.cs
- S2: Remove unused InvertBooleanConverter from Resources.xaml
* Fix PR review findings: image column collapse, thread safety
- Add HasImageToColumnSpanConverter so AvalonEditor spans all columns
when HasImage is false, preventing unused blank space from the image
column width (Resources.xaml GameFilesTabControl ContentTemplate)
- Marshal LoadAssets and LoadCoAuthors collection/property mutations to
Dispatcher.UIThread.InvokeAsync for explicit thread safety
* fix: reformat HasImageToColumnSpanConverter to 4-space indentation
* fix: map All/AllButNew/AllButModified/AllButPatched to multi-select
LoadingModeToSelectionModeConverter only mapped Multiple to
SelectionMode.Multiple. The original WPF DataTriggers also enabled
Extended selection for All, AllButNew, AllButModified, and
AllButPatched modes. Add those mappings to restore parity.
* feat(images): Migrate BitmapImage/ImageSource to Avalonia.Media.Imaging.Bitmap [P2-011]
Replace WPF image types in the three affected ViewModels with their
Avalonia.Media.Imaging.Bitmap equivalents. Closes#24.
TabControlViewModel.cs (TabImage):
- Remove 'using System.Windows' and 'using System.Windows.Media.Imaging'
- Add 'using Avalonia.Media.Imaging'
- BitmapImage _image / public BitmapImage Image -> Bitmap
- Both SetImage overloads (SKBitmap and CTexture): replace
BeginInit/CacheOption/StreamSource/EndInit/Freeze pattern
with 'Image = new Bitmap(stream)'. Bitmap reads the stream
into an internal buffer at construction; disposing the
MemoryStream after is safe.
GameFileViewModel.cs:
- Remove 'using System.Windows', '.Windows.Media',
'.Windows.Media.Imaging'
- Add 'using Avalonia.Media.Imaging', 'using Avalonia.Threading'
- ImageSource _previewImage / public ImageSource PreviewImage -> Bitmap
- SetPreviewImage: replace WPF BitmapImage construction +
Application.Current.Dispatcher.InvokeAsync with
new Bitmap(stream) + Dispatcher.UIThread.Post. Bitmap is
immutable and not UI-thread-affine; constructing on the
background Thread and posting the property assignment is safe.
CustomDirectoriesViewModel.cs:
- Remove 'using System.Windows', '.Windows.Controls',
'.Windows.Media.Imaging'
- Add 'using Avalonia.Controls', 'using Avalonia.Layout',
'using Avalonia.Media.Imaging', 'using Avalonia.Platform'
- MenuItem/Image/Separator/Control -> Avalonia equivalents
(same class names, different namespaces)
- BitmapImage(new Uri('/FModel;component/Resources/xxx.png'))
-> new Bitmap(AssetLoader.Open(new Uri('avares://FModel/...')))
for the four directory-icon menu items
* fix(images): Address PR #79 review findings [P2-011]
FModel.csproj [C1]:
- Change <Resource> to <AvaloniaResource> for the four directory icon
PNGs (add_directory, delete, edit, go_to_directory). WPF <Resource>
items are not processed into Avalonia's avares resource manifest,
so AssetLoader.Open would have thrown at runtime on every app startup.
GameFileViewModel.cs [m1 + PR comment]:
- Remove redundant 'ms.Position = 0' in SetPreviewImage: MemoryStream
initializes to position 0, making the reset a no-op.
- Fix 'Resolved |= ~EResolveCompute.Preview' to 'Resolved &= ~...'.
The bitwise-NOT operator on an enum value produces a large negative
int, ORing in undefined bits; ORing never clears bits, so the intent
(undo the premature Preview flag set at the top of
ResolveByExtensionAsync) required &= ~, not |= ~.
CustomDirectoriesViewModel.cs [PR comment]:
- Extract private static LoadIcon(string filename) helper to wrap each
AssetLoader.Open call in a using, ensuring the stream returned by
AssetLoader.Open is disposed after Bitmap copies its data.
[m2] (Bitmap disposal in Image/PreviewImage setters) is intentionally
deferred: disposing the old Bitmap in the setter while the Avalonia
render thread may still hold it for the current frame risks a crash.
* fix(magnifier): Address review findings [M1, m1, m2, S1]
MagnifierManager.cs [M1]:
- Replace AdornerLayer.SetAdornment(element, adorner) / SetAdornment(element, null)
with AdornerLayer.SetAdornedElement + layer.Children.Add in VerifyAdornerLayer
and Parent-cast + Children.Remove in Detach(). SetAdornment is a single-slot
API that silently evicts any other adornment on the same element; the collection
API matches WPF's AdornerLayer.Add/Remove semantics and allows co-existing
adorners.
MagnifierManager.cs [S1]:
- Set e.Handled = true after a zoom change when the adorner is visible so that
a parent ScrollViewer does not also scroll while the user is zooming the
magnifier.
- Adjust the zoom-out floor from 0 to ZoomFactorOnMouseWheel now that the
ZoomFactor validator rejects values <= 0.
- Only call UpdateViewBox when the adorner is visible (no-op otherwise).
Magnifier.cs [m1]:
- Change ZoomFactor validate: v >= 0 -> v > 0. ZoomFactor = 0 produced a
zero-sized SourceRect on the VisualBrush which rendered undefined content.
The minimum meaningful zoom is any positive value.
MagnifierAdorner.cs [m2]:
- Return early from HandlePointerEvent when Bounds.Width and Bounds.Height are
both 0: the first PointerPressed arrives before the adorner canvas has been
through a layout pass, so GetPosition(this) returns meaningless coordinates.
The subsequent PointerMoved fires after layout and picks up correct values.
* Fix reviewer to stop it getting confused
* chore: update identity, branding, and CI for FModel Linux fork
- README.md: complete rewrite with fork identity disclaimer, upstream
attribution, updated links, and removal of sponsorship section
- NOTICE: add upstream FModel GPL-3 attribution; update library list
(add Avalonia/AvaloniaEdit/Svg.Skia/Twizzle.ImGui-Bundle.NET, remove
AdonisUI/AutoUpdater.NET/CSCore/ImGui.NET/Ookii.Dialogs.Wpf)
- Constants.cs: update ISSUE_LINK and GH_REPO to r6e/FModel-Linux;
clear DISCORD_LINK pending app registration
- FModel.csproj: add opt-in USE_FMODEL_API build flag
(-p:UseFModelApi=true) for upstream api.fmodel.app integration
- FModelApiEndpoint.cs: gate all api.fmodel.app calls behind
#if USE_FMODEL_API; rewrite CheckForUpdatesAsync to use GitHub
Releases API and return GitHubRelease? for caller-side notification
- GitHubApiEndpoint.cs: add GetLatestReleaseAsync() for /releases/latest
- GitHubResponse.cs: add TagName/HtmlUrl/Body to GitHubRelease; replace
AutoUpdater.DownloadUpdate with Process.Start(UseShellExecute=true)
- MainWindow.xaml.cs: surface update availability via FLogger [WRN] entry
at startup when a newer GitHub release is found
- DiscordService.cs: disable RPC (empty APP_ID, early-return guard)
pending Discord application registration for the fork
- About.xaml: version label reads 'FModel Linux {0}'; dual credit lines
for Asval (original) and Rob Trame (Linux port)
- AboutViewModel.cs: update description, contributors, and references
list to reflect current Avalonia-based dependency set
- .github/workflows: target ubuntu-latest, linux-x64, net8.0; remove
fmodel.app deploy steps; rename artifact to FModel-Linux.zip
- .github/ISSUE_TEMPLATE: update assignee and remove Discord link
- .github/FUNDING.yml: note donation link points to upstream project
* Fix whitespace issues
* chore: address PR review feedback
- NOTICE: remove orphaned MS-PL and BSD 3-Clause license texts; the
index already lists only MIT and Apache 2.0, and no current dependency
uses either of those licenses
- GitHubResponse.cs: guard against null Asset/BrowserDownloadUrl in
Download(); log a warning via Serilog instead of NullReferenceException
or re-throwing InvalidOperationException
- MainWindow.xaml.cs: run update check in a background Task.Run to
avoid blocking startup; post FLogger notification back on
Dispatcher.UIThread; swallow exceptions so a failed check never
impacts startup
- FModelApiEndpoint.cs: log a warning when the current application
version string cannot be parsed, matching the existing behaviour for
an unparseable latest-release tag
- .github/workflows: add `permissions: contents: write` to both
main.yml and qa.yml (GitHub Advanced Security finding)
* chore: address second round of PR review feedback
- NOTICE: add missing direct NuGet dependencies —
EpicManifestParser.ZlibngDotNetDecompressor, Serilog.Sinks.Console,
Serilog.Sinks.File, and SkiaSharp.HarfBuzz — each with their
respective copyright notice and license (MIT / Apache 2.0)
- FModelApiEndpoint.cs: remove now-unused _applicationView property
(CheckForUpdatesAsync was refactored to use GitHubApi directly;
_applicationView is dead code outside of #if USE_FMODEL_API blocks)
- DiscordService.cs: fix DiscordRpcClient being constructed at
field-init time with an empty APP_ID string; make _client nullable
and only instantiate when APP_ID is non-empty; update all call sites
to use null-safe pattern matching (_client is not { IsInitialized:
true }) so callers are safe without runtime client construction
* chore: address third round of PR review feedback
- MenuCommand.cs: guard Help_Discord action against empty DISCORD_LINK;
Process.Start with an empty FileName throws at runtime, so the action
is now a no-op when no Discord server URL is configured
- qa.yml: zip the full publish output directory (./FModel/bin/Publish/)
rather than just the single executable; --no-self-contained publishes
companion files (*.deps.json, *.runtimeconfig.json) that are required
at runtime alongside the PublishSingleFile output
- main.yml: same fix — zip ./FModel/bin/Publish/ so the release artifact
includes all required publish outputs, not just the executable
* Update FModel/ViewModels/ApiEndpoints/FModelApiEndpoint.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* 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