Add a setting to prevent sharing projects in public channels (#41395)
This PR adds a setting to prevent projects from being shared in public
channels.
This can be enabled by adding the following to the project settings
(`.zed/settings.json`):
```json
{
"prevent_sharing_in_public_channels": true
}
```
This will then disable the "Share" button when not in a private channel:
<img width="380" height="115" alt="Screenshot 2025-10-28 at 2 28 10 PM"
src="https://github.com/user-attachments/assets/6761ac34-c0d5-4451-a443-adf7a1c42bcd"
/>
Release Notes:
- collaboration: Added a `prevent_sharing_in_public_channels` project
setting for preventing projects from being shared in public channels.
This commit is contained in:
@@ -64,6 +64,12 @@ pub struct WorktreeSettingsContent {
|
||||
#[serde(skip_serializing_if = "Maybe::is_unset")]
|
||||
pub project_name: Maybe<String>,
|
||||
|
||||
/// Whether to prevent this project from being shared in public channels.
|
||||
///
|
||||
/// Default: false
|
||||
#[serde(default)]
|
||||
pub prevent_sharing_in_public_channels: bool,
|
||||
|
||||
/// Completely ignore files matching globs from `file_scan_exclusions`. Overrides
|
||||
/// `file_scan_inclusions`.
|
||||
///
|
||||
|
||||
@@ -855,6 +855,7 @@ impl VsCodeSettings {
|
||||
fn worktree_settings_content(&self) -> WorktreeSettingsContent {
|
||||
WorktreeSettingsContent {
|
||||
project_name: crate::Maybe::Unset,
|
||||
prevent_sharing_in_public_channels: false,
|
||||
file_scan_exclusions: self
|
||||
.read_value("files.watcherExclude")
|
||||
.and_then(|v| v.as_array())
|
||||
|
||||
Reference in New Issue
Block a user