From 726c665b5fb355af42006518d63ef1d5dd08bc41 Mon Sep 17 00:00:00 2001 From: landon Date: Thu, 17 Sep 2026 12:00:19 -0500 Subject: [PATCH] fix: Use show_animated with width persistence for file panel - Use show_animated instead of show() to maintain egui's animation - Add .default_width() from config - Update config when panel width changes - This should allow the panel to maintain its width after resizing Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- src/app/file_list.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/app/file_list.rs b/src/app/file_list.rs index 92ff275..ca1ab1b 100644 --- a/src/app/file_list.rs +++ b/src/app/file_list.rs @@ -164,13 +164,11 @@ impl App { /// editor rather than leaving an empty column. pub(super) fn left_pane(&mut self, ctx: &egui::Context) { let show_files = self.config.show_file_panel; - if show_files { - let panel = egui::SidePanel::left("files") - .resizable(true) - .default_width(self.config.file_panel_width) - .width_range(260.0..=600.0); - - let response = panel.show(ctx, |ui| { + if let Some(response) = egui::SidePanel::left("files") + .resizable(true) + .default_width(self.config.file_panel_width) + .width_range(260.0..=600.0) + .show_animated(ctx, show_files, |ui| { // The default theme renders unselected list rows fairly dim; bump // the widget text colours so file names stay legible (especially in // dark mode) without affecting the rest of the app. @@ -605,9 +603,8 @@ impl App { } }); } - }); - - // Update the config with the current panel width if it changed + }) { + // Update the config with the current panel width let new_width = response.response.rect.width(); if (new_width - self.config.file_panel_width).abs() > 0.1 { self.config.file_panel_width = new_width;