From 45fa03410796db8ac488b781b915e4c80a588f1a Mon Sep 17 00:00:00 2001 From: Finn Evers Date: Fri, 5 Sep 2025 21:50:51 +0200 Subject: [PATCH] Restore notification panel settings (#37661) Follow-up to https://github.com/zed-industries/zed/pull/37489 Notification panel settings were always missing the content, hence this PR adds it. After #37489, the use of the same content twice broke things, which currently makes the notification panel non-configurable on Nightly. This PR fixes this. There once was an issue about the documentation for the panel being wrong as well. However, I was just unable to find that sadly. Release Notes: - N/A --- crates/collab_ui/src/panel_settings.rs | 34 +++++++++++++++++++------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/crates/collab_ui/src/panel_settings.rs b/crates/collab_ui/src/panel_settings.rs index bae118d819..81d441167c 100644 --- a/crates/collab_ui/src/panel_settings.rs +++ b/crates/collab_ui/src/panel_settings.rs @@ -44,14 +44,6 @@ pub struct ChatPanelSettingsContent { pub default_width: Option, } -#[derive(Deserialize, Debug, SettingsKey)] -#[settings_key(key = "notification_panel")] -pub struct NotificationPanelSettings { - pub button: bool, - pub dock: DockPosition, - pub default_width: Pixels, -} - #[derive(Clone, Default, Serialize, Deserialize, JsonSchema, Debug, SettingsUi, SettingsKey)] #[settings_key(key = "collaboration_panel")] pub struct PanelSettingsContent { @@ -69,6 +61,30 @@ pub struct PanelSettingsContent { pub default_width: Option, } +#[derive(Deserialize, Debug)] +pub struct NotificationPanelSettings { + pub button: bool, + pub dock: DockPosition, + pub default_width: Pixels, +} + +#[derive(Clone, Default, Serialize, Deserialize, JsonSchema, Debug, SettingsUi, SettingsKey)] +#[settings_key(key = "notification_panel")] +pub struct NotificationPanelSettingsContent { + /// Whether to show the panel button in the status bar. + /// + /// Default: true + pub button: Option, + /// Where to dock the panel. + /// + /// Default: right + pub dock: Option, + /// Default width of the panel in pixels. + /// + /// Default: 300 + pub default_width: Option, +} + #[derive(Clone, Default, Serialize, Deserialize, JsonSchema, Debug, SettingsUi, SettingsKey)] #[settings_key(key = "message_editor")] pub struct MessageEditorSettings { @@ -106,7 +122,7 @@ impl Settings for ChatPanelSettings { } impl Settings for NotificationPanelSettings { - type FileContent = PanelSettingsContent; + type FileContent = NotificationPanelSettingsContent; fn load( sources: SettingsSources,