From 3189ede2b9225b1b930cc43368248c6b4f3a4daf Mon Sep 17 00:00:00 2001 From: "CHIH,GODLEE" <61595521+ChihGodlee@users.noreply.github.com> Date: Mon, 18 May 2026 20:27:43 +0800 Subject: feat: configure sidebar min/max width via [ui] (#135) * feat: configure sidebar min/max width via [ui] Expose the previously hardcoded MIN_SIDEBAR_WIDTH / MAX_SIDEBAR_WIDTH clamps as [ui] sidebar_min_width / sidebar_max_width. Defaults remain 18 / 36 so existing configs are unchanged. Hot-reload is wired through the existing [ui] block; reload re-clamps the live width to the new bounds so tightening takes effect immediately. Reject inverted bounds (min > max) at every entry point so a bad config can never reach u16::clamp(min, max), which panics: App::new falls back to defaults, and apply_live_config treats the whole [ui] section as invalid and returns a partial reload report. refs #132 * test: keep sidebar reload width within bounds refs #132 --------- Co-authored-by: Ogulcan Celik --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index c1b0acd3..2c17e704 100644 --- a/src/main.rs +++ b/src/main.rs @@ -130,6 +130,12 @@ const DEFAULT_CONFIG: &str = r##"# herdr configuration # Sidebar width (auto-scaled based on workspace names, this sets the default) # sidebar_width = 26 +# Minimum sidebar width when expanded (columns) +# sidebar_min_width = 18 + +# Maximum sidebar width when expanded (columns) +# sidebar_max_width = 36 + # Capture mouse input for Herdr's mouse UI. # Set false to let the terminal handle normal clicks, such as Cmd-clicking URLs. # Pane apps like lazygit and btop can still receive mouse when they request it. -- cgit v1.2.3