From 747c41f1cbc22c7d05abf7df586075cf60411f8a Mon Sep 17 00:00:00 2001 From: Justin Su Date: Mon, 1 Jun 2026 02:15:06 -0400 Subject: [PATCH] Shorten explanation when edit predictions are disabled for a language (#54808) The current text is a bit wordy and puts the actually important information at the end: image The button already shows as disabled, so the text just needs to explain why. I don't think this affects accessibility, because a screen reader should be able to tell that the button is disabled. Self-Review Checklist: - [ ] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable Release Notes: - N/A --- .../src/edit_prediction_button.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/crates/edit_prediction_ui/src/edit_prediction_button.rs b/crates/edit_prediction_ui/src/edit_prediction_button.rs index cd3164d2ee..1d1a423cc8 100644 --- a/crates/edit_prediction_ui/src/edit_prediction_button.rs +++ b/crates/edit_prediction_ui/src/edit_prediction_button.rs @@ -712,14 +712,16 @@ impl EditPredictionButton { match language_state.clone() { Some((language, false)) => { - menu = menu.item( - entry - .disabled(true) - .documentation_aside(DocumentationSide::Left, move |_cx| { - Label::new(format!("Edit predictions cannot be toggled for this buffer because they are disabled for {}", language.name())) - .into_any_element() - }) - ); + menu = menu.item(entry.disabled(true).documentation_aside( + DocumentationSide::Left, + move |_cx| { + Label::new(format!( + "Edit predictions are disabled for {}", + language.name() + )) + .into_any_element() + }, + )); } Some(_) | None => menu = menu.item(entry), }