aboutsummaryrefslogtreecommitdiff
path: root/src/config
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-07-16 03:28:57 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-07-16 03:28:57 +0300
commit9c9490d764d306b6cc093b5b3de1ccd4e6467c94 (patch)
treee4c7091b5418acb62067dc05b3972769cfdeb8ed /src/config
parentb16465afbbf8e4e959076fceb7e84377f2ecc379 (diff)
feat: configure collapsed sidebar startup state
refs #1463
Diffstat (limited to 'src/config')
-rw-r--r--src/config/model.rs16
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!(