aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorakbash <akbash@herdr.dev>2026-08-05 02:18:56 +0300
committerGitHub <noreply@github.com>2026-08-05 02:18:56 +0300
commit1f1e434268ad6e8102fdac6d5996e3f190138a28 (patch)
tree8ea2e75f819464dc71c8a44b909be2fbbafdee21 /src
parentd57cefb879e685b4876a84fa20cbfd0702ce4140 (diff)
fix(config): accept retired agent panel scope (#2295)
refs #2292 Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com> Co-authored-by: Can Celik <ogulcancelik@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/config/io.rs37
-rw-r--r--src/config/model.rs11
2 files changed, 48 insertions, 0 deletions
diff --git a/src/config/io.rs b/src/config/io.rs
index e19f6944..b6a70427 100644
--- a/src/config/io.rs
+++ b/src/config/io.rs
@@ -954,6 +954,25 @@ claude = [["terminal_title"]]
}
#[test]
+ fn load_live_config_accepts_legacy_agent_panel_scope_without_warning() {
+ let loaded = load_live_config_from_str(
+ r#"
+[ui]
+agent_panel_scope = "current"
+agent_panel_sort = "priority"
+"#,
+ )
+ .unwrap();
+
+ assert!(loaded.diagnostics.is_empty());
+ assert!(loaded.invalid_sections.is_empty());
+ assert_eq!(
+ loaded.config.ui.agent_panel_sort,
+ super::super::AgentPanelSortConfig::Priority
+ );
+ }
+
+ #[test]
fn load_live_config_discards_ignored_keys_from_an_invalid_section() {
let loaded = load_live_config_from_str(
r#"
@@ -971,6 +990,24 @@ mouse_captur = true
}
#[test]
+ fn startup_config_accepts_legacy_agent_panel_scope_without_warning() {
+ let _guard = crate::config::test_config_env_lock().lock().unwrap();
+ let path = std::env::temp_dir().join(format!(
+ "herdr-config-legacy-agent-panel-scope-{}.toml",
+ std::process::id()
+ ));
+ std::fs::write(&path, "[ui]\nagent_panel_scope = \"all\"\n").unwrap();
+ std::env::set_var(CONFIG_PATH_ENV_VAR, &path);
+
+ let loaded = Config::load();
+
+ std::env::remove_var(CONFIG_PATH_ENV_VAR);
+ let _ = std::fs::remove_file(path);
+
+ assert!(loaded.diagnostics.is_empty(), "{:?}", loaded.diagnostics);
+ }
+
+ #[test]
fn startup_config_load_warns_about_unknown_top_level_sections() {
let _guard = crate::config::test_config_env_lock().lock().unwrap();
let path = std::env::temp_dir().join(format!(
diff --git a/src/config/model.rs b/src/config/model.rs
index 97b8c7fa..5cbafaec 100644
--- a/src/config/model.rs
+++ b/src/config/model.rs
@@ -106,6 +106,13 @@ impl AgentPanelSortConfig {
}
}
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)]
+#[serde(rename_all = "lowercase")]
+enum LegacyAgentPanelScopeConfig {
+ Current,
+ All,
+}
+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, Default)]
#[serde(rename_all = "lowercase")]
pub enum StatusIndicatorStyle {
@@ -843,6 +850,9 @@ pub struct UiConfig {
pub tab_bar_position: TabBarPositionConfig,
/// Agent sidebar ordering. Saved values are "spaces" or "priority". Default: "spaces".
pub agent_panel_sort: AgentPanelSortConfig,
+ /// Retired setting that Herdr wrote before the workspace filter was removed.
+ #[serde(rename = "agent_panel_scope")]
+ _legacy_agent_panel_scope: Option<LegacyAgentPanelScopeConfig>,
/// Agent status indicator style. Saved values are "dots" or "symbols". Default: "dots".
pub status_indicators: StatusIndicatorStyle,
/// Expanded sidebar row composition.
@@ -1048,6 +1058,7 @@ impl Default for UiConfig {
hide_tab_bar_when_single_tab: false,
tab_bar_position: TabBarPositionConfig::Top,
agent_panel_sort: AgentPanelSortConfig::Spaces,
+ _legacy_agent_panel_scope: None,
status_indicators: StatusIndicatorStyle::Dots,
sidebar: SidebarConfig::default(),
accent: "cyan".into(),