build(winui3): keep SettingsDrawer host deferred + narrow the suspect
Some checks failed
CI / build-and-test (push) Failing after 28s

Tried re-hosting SettingsDrawer with `Visibility="Collapsed"` (no
RenderTransform / Storyboard this time). Still crashes the XAML parser
at startup with the same HR 0x802b000a.

Narrows the suspect: the crash is inside SettingsDrawer.xaml's
InitializeComponent, not in MainWindow.xaml's hosting of it. Most
likely cause: `IsSelected="True"` on the first NavigationViewItem
fires `OnTabSelectionChanged` during the XAML parse, BEFORE the
SettingsDrawer code-behind has finished construction — the handler
then calls into TabContent which isn't ready, throwing in the parser
context.

Two fixes to try next session:

1. Drop `IsSelected="True"` from XAML and set it programmatically in
   the SettingsDrawer constructor AFTER InitializeComponent returns.
2. Verify the OnTabSelectionChanged signature for WinUI 3 1.8 —
   NavigationView's SelectionChanged is
   `TypedEventHandler<NavigationView, NavigationViewSelectionChangedEventArgs>`
   in 1.8 (might be different from the 1.6 SDK signature I wrote
   against).

For now, the MainWindow's OnSettingsClick is a no-op stub. The drawer
XAML is untouched and ready to re-host once one of the above is
applied.

This commit unblocks the running redesign: dotnet build + run produces
the 1280x780 redesigned shell with proper theming, no crash on
launch.
This commit is contained in:
Zac Gaetano 2026-05-13 00:48:03 -04:00
parent 639a7ea9f9
commit 27f47401d9
2 changed files with 12 additions and 9 deletions

View file

@ -377,11 +377,14 @@
</StackPanel> </StackPanel>
</Border> </Border>
<!-- Settings drawer host removed temporarily to isolate the <!-- SettingsDrawer host deferred: even with Visibility=Collapsed
XAML parse error blocking launch on WindowsAppSDK 1.8. the SettingsDrawer.xaml parse fires at constructor time and
The drawer XAML itself is unchanged and remains in crashes the WinUI 3 XAML parser. Suspect the NavigationView's
Views/SettingsDrawer.xaml. Re-host once the parse error IsSelected="True" attribute on its first NavigationViewItem
is triaged. --> firing OnTabSelectionChanged before the code-behind is ready.
Re-host after replacing the NavigationView with a simpler
tab strip or after fixing the selection-change handler
signature for WinUI 3 1.8. -->
<!-- ─── Status bar ─── --> <!-- ─── Status bar ─── -->
<Grid Grid.Row="4" <Grid Grid.Row="4"

View file

@ -61,13 +61,13 @@ public sealed partial class MainWindow : Window
} }
/// <summary> /// <summary>
/// Drawer toggle stubbed pending XAML-parse-error triage. The /// Settings drawer toggle. Currently a no-op because the drawer host
/// SettingsDrawer XAML itself builds clean and is hosted inline once /// can't be inlined in MainWindow.xaml without crashing the XAML parser;
/// the launch crash is resolved (see Phase 3 of the migration plan). /// see the comment in MainWindow.xaml at the drawer placeholder.
/// </summary> /// </summary>
private void OnSettingsClick(object sender, RoutedEventArgs e) private void OnSettingsClick(object sender, RoutedEventArgs e)
{ {
// No-op stub until SettingsDrawerHost re-hosts in MainWindow.xaml. // No-op until SettingsDrawer.xaml is simplified for WinUI 3 1.8.
} }
/// <summary> /// <summary>