From 9c9490d764d306b6cc093b5b3de1ccd4e6467c94 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Thu, 16 Jul 2026 03:28:57 +0300 Subject: feat: configure collapsed sidebar startup state refs #1463 --- src/config/model.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/config') diff --git a/src/config/model.rs b/src/config/model.rs index 60dd2471..b32dc8a9 100644 --- a/src/config/model.rs +++ b/src/config/model.rs @@ -780,6 +780,8 @@ pub struct UiConfig { pub sidebar_min_width: u16, /// Maximum sidebar width (columns) when expanded. Default: 36. pub sidebar_max_width: u16, + /// Start with the sidebar collapsed. Default: false. + pub sidebar_start_collapsed: bool, /// Collapsed sidebar presentation. Default: compact. pub sidebar_collapsed_mode: SidebarCollapsedModeConfig, /// Terminal width at or below which Herdr uses the mobile single-column layout. Default: 64. @@ -990,6 +992,7 @@ impl Default for UiConfig { sidebar_width: 26, sidebar_min_width: 18, sidebar_max_width: 36, + sidebar_start_collapsed: false, sidebar_collapsed_mode: SidebarCollapsedModeConfig::Compact, mobile_width_threshold: DEFAULT_MOBILE_WIDTH_THRESHOLD, mouse_capture: true, @@ -1363,6 +1366,19 @@ mobile_width_threshold = 96 assert_eq!(config.ui.mobile_width_threshold, 96); } + #[test] + fn sidebar_start_collapsed_defaults_off_and_parses_on() { + let default_config = Config::default(); + assert!(!default_config.ui.sidebar_start_collapsed); + + let toml = r#" +[ui] +sidebar_start_collapsed = true +"#; + let config: Config = toml::from_str(toml).unwrap(); + assert!(config.ui.sidebar_start_collapsed); + } + #[test] fn sidebar_collapsed_mode_defaults_compact_and_parses_hidden() { let default_config = Config::default(); -- cgit v1.2.3