From 43873c10058fee405e8aa46a60ecde24d451a482 Mon Sep 17 00:00:00 2001 From: Christine Yan <34801076+christineyan4@users.noreply.github.com> Date: Thu, 7 May 2026 18:12:33 -0400 Subject: [PATCH] fix: enforce min window size and pin navigation sidebar (#293) Resolved conflict with current master, preserving navigation pane persistence while keeping the wider minimum size and dynamic pane width.\n\nValidation: local ARM64 build passed; Shared tests 1296 passed / 20 skipped; Tray tests 466 passed; remote CI green.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml | 2 +- src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml.cs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml b/src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml index 2c41678..fc54a84 100644 --- a/src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml +++ b/src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml @@ -5,7 +5,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:winex="using:WinUIEx" Title="OpenClaw" - MinWidth="600" MinHeight="400"> + MinWidth="750" MinHeight="400"> diff --git a/src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml.cs b/src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml.cs index fd592f8..6379483 100644 --- a/src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml.cs +++ b/src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml.cs @@ -83,10 +83,22 @@ public sealed partial class HubWindow : WindowEx this.CenterOnScreen(); this.SetIcon(IconHelper.GetStatusIconPath(ConnectionStatus.Connected)); + RootGrid.SizeChanged += OnRootGridSizeChanged; + // Don't select a nav item here — Settings/GatewayClient aren't set yet. // ShowHub() in App.xaml.cs calls NavigateToDefault() after setting properties. } + private void OnRootGridSizeChanged(object sender, SizeChangedEventArgs e) + { + const double minPane = 200; + const double maxPane = 320; + const double ratio = 0.25; + + double desired = e.NewSize.Width * ratio; + NavView.OpenPaneLength = Math.Clamp(desired, minPane, maxPane); + } + /// /// Navigate to the default page. Call after setting Settings/GatewayClient. ///