From 176672f38b175d67c356a44281d458bdfc955054 Mon Sep 17 00:00:00 2001 From: liam Date: Sat, 9 May 2026 15:08:54 -0400 Subject: [PATCH] Fix edit prediction provider checkmark (#56250) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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.
Screenshot 2026-05-08 at 11 27 49 PM
Release Notes: - Fixed edit prediction provider menu checkmarks for active non-Zed providers. --- .../src/edit_prediction_button.rs | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/crates/edit_prediction_ui/src/edit_prediction_button.rs b/crates/edit_prediction_ui/src/edit_prediction_button.rs index d8e52fe8a7bb40..3d539e143e55b4 100644 --- a/crates/edit_prediction_ui/src/edit_prediction_button.rs +++ b/crates/edit_prediction_ui/src/edit_prediction_button.rs @@ -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); }),