From 2909d8b1d7e49745e23be00ab09b6977e3313767 Mon Sep 17 00:00:00 2001 From: Zac Gaetano Date: Wed, 13 May 2026 00:20:23 -0400 Subject: [PATCH] feat(winui3): wire Settings drawer slide-in animation into MainWindow Hosts SettingsDrawer in the main content grid as a fixed-width 400px panel positioned at the right edge, with a TranslateTransform pre-set to X=400 so it starts off-screen. The rail's settings icon triggers a 220ms ease-out-quart slide-in storyboard; CloseRequested (or the drawer's Esc/close button) triggers a 180ms ease-in slide-out. IsHitTestVisible toggles in sync so the off-screen drawer doesn't intercept clicks on the participants list. This is the structural commitment from DESIGN.md: settings live in a right-drawer (not a permanent 380px panel), the participants table reclaims full width when settings aren't being edited. Builds clean. Followup: tab content currently rebuilds imperatively in code-behind; wire it to a SettingsViewModel mirror of the WPF host's GlobalSettingsViewModel once the view-model migration starts (Phase 4 of the migration plan). --- src/TeamsISO.App.WinUI/Views/MainWindow.xaml | 39 +++++++++++++++- .../Views/MainWindow.xaml.cs | 44 +++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/src/TeamsISO.App.WinUI/Views/MainWindow.xaml b/src/TeamsISO.App.WinUI/Views/MainWindow.xaml index 788fc85..40677ed 100644 --- a/src/TeamsISO.App.WinUI/Views/MainWindow.xaml +++ b/src/TeamsISO.App.WinUI/Views/MainWindow.xaml @@ -3,7 +3,8 @@ x:Class="TeamsISO.App.WinUI.Views.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:models="using:TeamsISO.App.WinUI.Models"> + xmlns:models="using:TeamsISO.App.WinUI.Models" + xmlns:views="using:TeamsISO.App.WinUI.Views"> + + + + + + + + + + + + + + + + + + + + + + + /// Toggle the settings drawer with a slide animation. The drawer is + /// pre-translated 400px off the right edge in XAML; the storyboard + /// animates X back to 0 to slide it in. Hit-testing is gated so the + /// off-screen drawer doesn't intercept clicks on the participants list. + /// + private void OnSettingsClick(object sender, RoutedEventArgs e) + { + if (_drawerOpen) + { + CloseDrawer(); + } + else + { + OpenDrawer(); + } + } + + private void OpenDrawer() + { + if (_drawerOpen) return; + _drawerOpen = true; + SettingsDrawerHost.IsHitTestVisible = true; + var sb = (Microsoft.UI.Xaml.Media.Animation.Storyboard)((Microsoft.UI.Xaml.Controls.Grid)Content) + .Resources["DrawerSlideIn"]; + sb.Begin(); + SettingsDrawerHost.CloseRequested -= OnDrawerCloseRequested; + SettingsDrawerHost.CloseRequested += OnDrawerCloseRequested; + } + + private void CloseDrawer() + { + if (!_drawerOpen) return; + _drawerOpen = false; + var sb = (Microsoft.UI.Xaml.Media.Animation.Storyboard)((Microsoft.UI.Xaml.Controls.Grid)Content) + .Resources["DrawerSlideOut"]; + sb.Completed += (_, _) => SettingsDrawerHost.IsHitTestVisible = false; + sb.Begin(); + } + + private void OnDrawerCloseRequested(object? sender, System.EventArgs e) => CloseDrawer(); + /// /// Push a resolved theme to the visual tree and to the AppWindow /// title-bar buttons. Called on every