From 383b0a7afb3d09ea39dad2bf9bf50d50e3395758 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Mon, 6 Apr 2026 16:19:10 -0300 Subject: [PATCH] settings_ui: Recategorize some panel settings (#53243) Was looking around the panels page in the settings UI and noticed there was a standalone "Auto Open Files" section. That felt a bit out of place because those settings are really project panel-specific. So this PR moves them under the project panels section of the panels page. Release Notes: - N/A --- crates/settings_ui/src/page_data.rs | 71 +++++++++++++---------------- 1 file changed, 32 insertions(+), 39 deletions(-) diff --git a/crates/settings_ui/src/page_data.rs b/crates/settings_ui/src/page_data.rs index bacfd227d83933d3ebd9b2d8836bbe19958acf2b..20a0c53534988a873b3b3f6e393eefd5bb0b3f7c 100644 --- a/crates/settings_ui/src/page_data.rs +++ b/crates/settings_ui/src/page_data.rs @@ -4433,7 +4433,7 @@ fn window_and_layout_page() -> SettingsPage { } fn panels_page() -> SettingsPage { - fn project_panel_section() -> [SettingsPageItem; 24] { + fn project_panel_section() -> [SettingsPageItem; 28] { [ SettingsPageItem::SectionHeader("Project Panel"), SettingsPageItem::SettingItem(SettingItem { @@ -4914,31 +4914,25 @@ fn panels_page() -> SettingsPage { files: USER, }), SettingsPageItem::SettingItem(SettingItem { - title: "Hidden Files", - description: "Globs to match files that will be considered \"hidden\" and can be hidden from the project panel.", - field: Box::new( - SettingField { - json_path: Some("worktree.hidden_files"), - pick: |settings_content| { - settings_content.project.worktree.hidden_files.as_ref() - }, - write: |settings_content, value| { - settings_content.project.worktree.hidden_files = value; - }, - } - .unimplemented(), - ), + title: "Sort Mode", + description: "Sort order for entries in the project panel.", + field: Box::new(SettingField { + json_path: Some("project_panel.sort_mode"), + pick: |settings_content| { + settings_content.project_panel.as_ref()?.sort_mode.as_ref() + }, + write: |settings_content, value| { + settings_content + .project_panel + .get_or_insert_default() + .sort_mode = value; + }, + }), metadata: None, files: USER, }), - ] - } - - fn auto_open_files_section() -> [SettingsPageItem; 5] { - [ - SettingsPageItem::SectionHeader("Auto Open Files"), SettingsPageItem::SettingItem(SettingItem { - title: "On Create", + title: "Auto Open Files On Create", description: "Whether to automatically open newly created files in the editor.", field: Box::new(SettingField { json_path: Some("project_panel.auto_open.on_create"), @@ -4964,7 +4958,7 @@ fn panels_page() -> SettingsPage { files: USER, }), SettingsPageItem::SettingItem(SettingItem { - title: "On Paste", + title: "Auto Open Files On Paste", description: "Whether to automatically open files after pasting or duplicating them.", field: Box::new(SettingField { json_path: Some("project_panel.auto_open.on_paste"), @@ -4990,7 +4984,7 @@ fn panels_page() -> SettingsPage { files: USER, }), SettingsPageItem::SettingItem(SettingItem { - title: "On Drop", + title: "Auto Open Files On Drop", description: "Whether to automatically open files dropped from external sources.", field: Box::new(SettingField { json_path: Some("project_panel.auto_open.on_drop"), @@ -5016,20 +5010,20 @@ fn panels_page() -> SettingsPage { files: USER, }), SettingsPageItem::SettingItem(SettingItem { - title: "Sort Mode", - description: "Sort order for entries in the project panel.", - field: Box::new(SettingField { - pick: |settings_content| { - settings_content.project_panel.as_ref()?.sort_mode.as_ref() - }, - write: |settings_content, value| { - settings_content - .project_panel - .get_or_insert_default() - .sort_mode = value; - }, - json_path: Some("project_panel.sort_mode"), - }), + title: "Hidden Files", + description: "Globs to match files that will be considered \"hidden\" and can be hidden from the project panel.", + field: Box::new( + SettingField { + json_path: Some("worktree.hidden_files"), + pick: |settings_content| { + settings_content.project.worktree.hidden_files.as_ref() + }, + write: |settings_content, value| { + settings_content.project.worktree.hidden_files = value; + }, + } + .unimplemented(), + ), metadata: None, files: USER, }), @@ -5807,7 +5801,6 @@ fn panels_page() -> SettingsPage { title: "Panels", items: concat_sections![ project_panel_section(), - auto_open_files_section(), terminal_panel_section(), outline_panel_section(), git_panel_section(),