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>
This commit is contained in:
Christine Yan 2026-05-07 18:12:33 -04:00 committed by GitHub
parent adcccc9b56
commit 43873c1005
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View File

@ -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">
<Window.SystemBackdrop>
<MicaBackdrop/>

View File

@ -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);
}
/// <summary>
/// Navigate to the default page. Call after setting Settings/GatewayClient.
/// </summary>