Lock private profile sync state

This commit is contained in:
2026-05-08 20:19:09 -04:00
parent a299815e51
commit 8e450496e0
5 changed files with 58 additions and 4 deletions
@@ -8,7 +8,7 @@ use gpui::{
px, rgb,
};
use gpui_component::{
IconName, Selectable, Sizable, StyledExt,
Disableable, IconName, Selectable, Sizable, StyledExt,
button::{Button, ButtonVariants},
scroll::ScrollableElement,
};
@@ -146,7 +146,13 @@ fn render_profile_row(
default_for_active_space,
cx,
))
.child(render_profile_sync_action(index, sync_profile_id, sync_policy, cx))
.child(render_profile_sync_action(
index,
sync_profile_id,
profile.allows_sync(),
sync_policy,
cx,
))
.child(render_profile_action(index, profile_id, active, cx)),
)
.into_any_element()
@@ -220,9 +226,21 @@ fn render_profile_action(
fn render_profile_sync_action(
index: usize,
profile_id: ProfileId,
allows_sync: bool,
sync_policy: ProfileSyncPolicy,
cx: &mut Context<ElyShell>,
) -> AnyElement {
if !allows_sync {
return Button::new(("profile-sync-policy", index))
.ghost()
.xsmall()
.selected(true)
.disabled(true)
.label("Sync Paused")
.tooltip("Private Profiles keep Sync paused")
.into_any_element();
}
let next_policy = sync_policy.toggled();
let paused = sync_policy == ProfileSyncPolicy::Paused;