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:

<img width="607" height="120" alt="image"
src="https://github.com/user-attachments/assets/26f998dd-1801-4e6c-a40c-acb58f8f3efc"
/>

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
This commit is contained in:
Justin Su authored and GitHub committed 2026-06-01 06:15:06 +00:00
1 parent 0711d9e42b
commit 747c41f1cb
1 file changed
+10 -8
@@ -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),
}