diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-06 22:53:56 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-06 22:53:56 +0300 |
| commit | 34df89ae655076b0493a1d8833f6790ca9d5c3ff (patch) | |
| tree | 3b2246673fbf12f4c68a2d6528932a71a9b40b85 /src/config | |
| parent | 9f94974de704646ba9b45b1cfc09cba6139e8924 (diff) | |
fix: persist agent panel scope in config
Diffstat (limited to 'src/config')
| -rw-r--r-- | src/config/model.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/config/model.rs b/src/config/model.rs index 5a17bea7..7e6c7382 100644 --- a/src/config/model.rs +++ b/src/config/model.rs @@ -11,6 +11,23 @@ pub enum ToastDelivery { Terminal, } +#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, Default)] +#[serde(rename_all = "lowercase")] +pub enum AgentPanelScopeConfig { + Current, + #[default] + All, +} + +impl AgentPanelScopeConfig { + pub fn as_str(self) -> &'static str { + match self { + Self::Current => "current", + Self::All => "all", + } + } +} + #[derive(Debug, Clone)] pub struct ToastConfig { pub delivery: ToastDelivery, @@ -106,6 +123,8 @@ pub struct UiConfig { pub sidebar_width: u16, /// Ask for confirmation before closing a workspace. Default: true. pub confirm_close: bool, + /// Agent sidebar scope. Saved values are "current" or "all". Default: "all". + pub agent_panel_scope: AgentPanelScopeConfig, /// Accent color for highlights, borders, and navigation UI. /// Accepts hex (#89b4fa), named colors (cyan, blue), or RGB (rgb(137,180,250)). pub accent: String, @@ -161,6 +180,7 @@ impl Default for UiConfig { Self { sidebar_width: 26, confirm_close: true, + agent_panel_scope: AgentPanelScopeConfig::All, accent: "cyan".into(), toast: ToastConfig::default(), sound: SoundConfig::default(), @@ -212,6 +232,16 @@ mod tests { use super::*; #[test] + fn agent_panel_scope_config_parses() { + let toml = r#" +[ui] +agent_panel_scope = "all" +"#; + let config: Config = toml::from_str(toml).unwrap(); + assert_eq!(config.ui.agent_panel_scope, AgentPanelScopeConfig::All); + } + + #[test] fn toast_config_parses() { let toml = r#" [ui.toast] |
