edit predictions: Improve copywriting (#24689)

This commit is contained in:
Danilo Leal 2025-02-11 21:43:48 -03:00 committed by GitHub
parent f5fd3d98ad
commit 2e7a89c5e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 55 additions and 31 deletions

View file

@ -406,7 +406,7 @@ impl InlineCompletionButton {
if let Some(editor_focus_handle) = self.editor_focus_handle.clone() {
menu = menu.toggleable_entry(
"This File",
"This Buffer",
self.editor_show_predictions,
IconPosition::Start,
Some(Box::new(ToggleEditPrediction)),
@ -451,33 +451,41 @@ impl InlineCompletionButton {
let enabled = data_collection.is_enabled();
let is_open_source = data_collection.is_project_open_source();
let is_collecting = data_collection.is_enabled();
let (icon_name, icon_color) = if is_open_source && is_collecting {
(IconName::Check, Color::Success)
} else {
(IconName::Check, Color::Accent)
};
menu = menu.item(
ContextMenuEntry::new("Share Training Data")
ContextMenuEntry::new("Training Data Collection")
.toggleable(IconPosition::Start, data_collection.is_enabled())
.icon_color(if is_open_source && is_collecting {
Color::Success
} else {
Color::Accent
})
.icon(icon_name)
.icon_color(icon_color)
.documentation_aside(move |cx| {
let (msg, label_color, icon_name, icon_color) = match (is_open_source, is_collecting) {
(true, true) => (
"Project identified as open-source, and you're sharing data.",
"Project identified as open source, and you're sharing data.",
Color::Default,
IconName::Check,
Color::Success,
),
(true, false) => (
"Project identified as open-source, but you're not sharing data.",
"Project identified as open source, but you're not sharing data.",
Color::Muted,
IconName::XCircle,
IconName::Close,
Color::Muted,
),
(false, _) => (
"Project not identified as open-source. No data captured.",
(false, true) => (
"Project not identified as open source. No data captured.",
Color::Muted,
IconName::XCircle,
IconName::Close,
Color::Muted,
),
(false, false) => (
"Project not identified as open source, and setting turned off.",
Color::Muted,
IconName::Close,
Color::Muted,
),
};
@ -485,7 +493,7 @@ impl InlineCompletionButton {
.gap_2()
.child(
Label::new(indoc!{
"Help us improve our open model by sharing data from open source repositories. \
"Help us improve our open dataset model by sharing data from open source repositories. \
Zed must detect a license file in your repo for this setting to take effect."
})
)
@ -516,6 +524,16 @@ impl InlineCompletionButton {
}
})
);
if is_collecting && !is_open_source {
menu = menu.item(
ContextMenuEntry::new("No data captured.")
.disabled(true)
.icon(IconName::Close)
.icon_color(Color::Error)
.icon_size(IconSize::Small),
);
}
}
}
@ -556,7 +574,7 @@ impl InlineCompletionButton {
language::EditPredictionsMode::EagerPreview => true,
};
menu = menu.separator().toggleable_entry(
"Eager Preview",
"Eager Preview Mode",
is_eager_preview_enabled,
IconPosition::Start,
None,