mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
Cherry-pick of #56250 to stable ---- Resolves https://github.com/zed-industries/zed/issues/56129 The edit prediction status bar menu only showed a checkmark for the active provider when that provider was Zed AI. Non-Zed providers such as Mercury could be selected and active, but the Providers section rendered them as unchecked because the toggle condition required `provider = EditPredictionProvider::Zed`. This updates the menu condition to show the checkmark for any active provider, while preserving the existing exception that hides the Zed AI checkmark when Zed AI is disabled by organization policy. <div align="center"> <img width="371" height="187" alt="Screenshot 2026-05-08 at 11 27 49 PM" src="https://github.com/user-attachments/assets/5278a102-bd7d-44a5-a655-74c6ed90b0f9" /> </div> Release Notes: - Fixed edit prediction provider menu checkmarks for active non-Zed providers. Co-authored-by: liam <liam@scalzulli.com>
This commit is contained in:
parent
c17f25cd78
commit
8c09ba73d0
1 changed files with 9 additions and 19 deletions
|
|
@ -594,30 +594,20 @@ impl EditPredictionButton {
|
|||
continue;
|
||||
};
|
||||
let is_current = provider == current_provider;
|
||||
let is_disabled_zed_provider =
|
||||
provider == EditPredictionProvider::Zed && is_zed_provider_disabled;
|
||||
let fs = self.fs.clone();
|
||||
|
||||
menu = menu.item(
|
||||
ContextMenuEntry::new(name)
|
||||
.toggleable(
|
||||
IconPosition::Start,
|
||||
is_current
|
||||
&& (provider == EditPredictionProvider::Zed
|
||||
&& !is_zed_provider_disabled),
|
||||
)
|
||||
.disabled(
|
||||
provider == EditPredictionProvider::Zed && is_zed_provider_disabled,
|
||||
)
|
||||
.when(
|
||||
provider == EditPredictionProvider::Zed && is_zed_provider_disabled,
|
||||
|item| {
|
||||
item.documentation_aside(DocumentationSide::Left, move |_cx| {
|
||||
Label::new(
|
||||
"Edit predictions are disabled for this organization.",
|
||||
)
|
||||
.toggleable(IconPosition::Start, is_current && !is_disabled_zed_provider)
|
||||
.disabled(is_disabled_zed_provider)
|
||||
.when(is_disabled_zed_provider, |item| {
|
||||
item.documentation_aside(DocumentationSide::Left, move |_cx| {
|
||||
Label::new("Edit predictions are disabled for this organization.")
|
||||
.into_any_element()
|
||||
})
|
||||
},
|
||||
)
|
||||
})
|
||||
})
|
||||
.handler(move |_, cx| {
|
||||
set_completion_provider(fs.clone(), cx, provider);
|
||||
}),
|
||||
|
|
|
|||
Loading…
Reference in a new issue