From 69c13b5aae55bc257bd7e34bb6abfc7406c316bb Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Wed, 29 Jul 2026 14:04:32 +0200 Subject: [PATCH] fix(client/windows): the settings pane stops auto-collapsing under the default window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WinUI Auto mode collapses the NavigationView pane below 1008 epx — narrower than the app's own 1000-wide default window, so the scope switcher kept getting booted out of the nav into its inline fallback. The page now forces the mode: Left (always expanded, at a tighter 250 pane length) down to 720 epx, LeftMinimal below that — the switcher lives in the pane wherever the content column still gets a workable width. Co-Authored-By: Claude Fable 5 --- clients/windows/src/app/settings.rs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/clients/windows/src/app/settings.rs b/clients/windows/src/app/settings.rs index 4198af52..34e8d8ed 100644 --- a/clients/windows/src/app/settings.rs +++ b/clients/windows/src/app/settings.rs @@ -1326,12 +1326,13 @@ pub(crate) fn settings_page(props: &SettingsProps, cx: &mut RenderCx) -> Element // the whole surface read as clutter. Editing the profile itself (name, colour, delete) // is a modal behind the "Edit profile…" button, not inline chrome. // - // But ONLY while the pane is expanded: in Auto display mode WinUI collapses the pane - // below 1008 epx (compact rail, then minimal), and pane-footer content is CLIPPED to the - // rail, not adapted. Reactor exposes no pane-opened/closed event, so the switcher follows - // the same width threshold WinUI uses: expanded pane → footer; collapsed → a slim row at - // the top of the content column instead. - let pane_expanded = window_width >= 1008.0; + // But ONLY while the pane is expanded — pane-footer content is CLIPPED to the compact + // rail, not adapted. WinUI's Auto mode would collapse the pane below 1008 epx (under the + // app's own 1000-wide default window!), which kept booting the switcher out of the nav, + // so the page FORCES the pane: expanded (`Left`, at a tighter 250 length) whenever the + // content column still gets a workable width, minimal below that. Reactor exposes no + // pane-opened/closed event, so the switcher placement rides the same threshold. + let pane_expanded = window_width >= 720.0; let catalog = ProfilesFile::load(); let mut scope_names = vec!["Default settings".to_string()]; let mut scope_ids: Vec = vec![String::new()]; @@ -1527,6 +1528,12 @@ pub(crate) fn settings_page(props: &SettingsProps, cx: &mut RenderCx) -> Element }); let mut nav = NavigationView::new(items, content) .pane_title("Settings") + .pane_display_mode(if pane_expanded { + NavigationViewPaneDisplayMode::Left + } else { + NavigationViewPaneDisplayMode::LeftMinimal + }) + .open_pane_length(250.0) .selected_tag(section) .on_selection_changed({ let ss = set_section.clone();