diff options
Diffstat (limited to 'src/config')
| -rw-r--r-- | src/config/model.rs | 16 |
1 files changed, 16 insertions, 0 deletions
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, @@ -1364,6 +1367,19 @@ 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(); assert_eq!( |
