Make slash command descriptions consistent (#18595)

This PR adds a description constant in most of the slash command files
so that both the editor _and_ footer pickers use the same string. In
terms of copywriting, I did some tweaking to reduce the longer ones a
bit. Also standardized them all to use sentence case, as opposed to each
instance using a different convention. The editor picker needs more
work, though, given the arguments and descriptions are being cut at the
moment. This should happen in a follow-up!

<img width="900" alt="Screenshot 2024-10-01 at 7 25 19 PM"
src="https://github.com/user-attachments/assets/e8759eff-0de9-4a4d-a026-366d85507b3c">

---

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
Danilo Leal 2024-10-02 15:35:50 +02:00 committed by GitHub
parent 82d3fcdf4b
commit 8a18c94f33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 29 additions and 27 deletions

View file

@ -31,11 +31,11 @@ impl SlashCommand for AutoCommand {
} }
fn description(&self) -> String { fn description(&self) -> String {
"Automatically infer what context to add, based on your prompt".into() "Automatically infer what context to add".into()
} }
fn menu_text(&self) -> String { fn menu_text(&self) -> String {
"Automatically Infer Context".into() self.description()
} }
fn label(&self, cx: &AppContext) -> CodeLabel { fn label(&self, cx: &AppContext) -> CodeLabel {

View file

@ -19,11 +19,11 @@ impl SlashCommand for DeltaSlashCommand {
} }
fn description(&self) -> String { fn description(&self) -> String {
"re-insert changed files".into() "Re-insert changed files".into()
} }
fn menu_text(&self) -> String { fn menu_text(&self) -> String {
"Re-insert Changed Files".into() self.description()
} }
fn requires_argument(&self) -> bool { fn requires_argument(&self) -> bool {

View file

@ -95,7 +95,7 @@ impl SlashCommand for DiagnosticsSlashCommand {
} }
fn menu_text(&self) -> String { fn menu_text(&self) -> String {
"Insert Diagnostics".into() self.description()
} }
fn requires_argument(&self) -> bool { fn requires_argument(&self) -> bool {

View file

@ -104,11 +104,11 @@ impl SlashCommand for FetchSlashCommand {
} }
fn description(&self) -> String { fn description(&self) -> String {
"insert URL contents".into() "Insert fetched URL contents".into()
} }
fn menu_text(&self) -> String { fn menu_text(&self) -> String {
"Insert fetched URL contents".into() self.description()
} }
fn requires_argument(&self) -> bool { fn requires_argument(&self) -> bool {

View file

@ -110,11 +110,11 @@ impl SlashCommand for FileSlashCommand {
} }
fn description(&self) -> String { fn description(&self) -> String {
"insert file".into() "Insert file".into()
} }
fn menu_text(&self) -> String { fn menu_text(&self) -> String {
"Insert File".into() self.description()
} }
fn requires_argument(&self) -> bool { fn requires_argument(&self) -> bool {

View file

@ -19,11 +19,11 @@ impl SlashCommand for NowSlashCommand {
} }
fn description(&self) -> String { fn description(&self) -> String {
"insert the current date and time".into() "Insert current date and time".into()
} }
fn menu_text(&self) -> String { fn menu_text(&self) -> String {
"Insert Current Date and Time".into() self.description()
} }
fn requires_argument(&self) -> bool { fn requires_argument(&self) -> bool {

View file

@ -47,11 +47,11 @@ impl SlashCommand for ProjectSlashCommand {
} }
fn description(&self) -> String { fn description(&self) -> String {
"Generate semantic searches based on the current context".into() "Generate a semantic search based on context".into()
} }
fn menu_text(&self) -> String { fn menu_text(&self) -> String {
"Project Context".into() self.description()
} }
fn requires_argument(&self) -> bool { fn requires_argument(&self) -> bool {

View file

@ -16,11 +16,11 @@ impl SlashCommand for PromptSlashCommand {
} }
fn description(&self) -> String { fn description(&self) -> String {
"insert prompt from library".into() "Insert prompt from library".into()
} }
fn menu_text(&self) -> String { fn menu_text(&self) -> String {
"Insert Prompt from Library".into() self.description()
} }
fn requires_argument(&self) -> bool { fn requires_argument(&self) -> bool {

View file

@ -34,11 +34,11 @@ impl SlashCommand for SearchSlashCommand {
} }
fn description(&self) -> String { fn description(&self) -> String {
"semantic search".into() "Search your project semantically".into()
} }
fn menu_text(&self) -> String { fn menu_text(&self) -> String {
"Semantic Search".into() self.description()
} }
fn requires_argument(&self) -> bool { fn requires_argument(&self) -> bool {

View file

@ -17,11 +17,11 @@ impl SlashCommand for OutlineSlashCommand {
} }
fn description(&self) -> String { fn description(&self) -> String {
"insert symbols for active tab".into() "Insert symbols for active tab".into()
} }
fn menu_text(&self) -> String { fn menu_text(&self) -> String {
"Insert Symbols for Active Tab".into() self.description()
} }
fn complete_argument( fn complete_argument(

View file

@ -24,11 +24,11 @@ impl SlashCommand for TabSlashCommand {
} }
fn description(&self) -> String { fn description(&self) -> String {
"insert open tabs (active tab by default)".to_owned() "Insert open tabs (active tab by default)".to_owned()
} }
fn menu_text(&self) -> String { fn menu_text(&self) -> String {
"Insert Open Tabs".to_owned() self.description()
} }
fn requires_argument(&self) -> bool { fn requires_argument(&self) -> bool {

View file

@ -29,11 +29,11 @@ impl SlashCommand for TerminalSlashCommand {
} }
fn description(&self) -> String { fn description(&self) -> String {
"insert terminal output".into() "Insert terminal output".into()
} }
fn menu_text(&self) -> String { fn menu_text(&self) -> String {
"Insert Terminal Output".into() self.description()
} }
fn requires_argument(&self) -> bool { fn requires_argument(&self) -> bool {

View file

@ -29,11 +29,11 @@ impl SlashCommand for WorkflowSlashCommand {
} }
fn description(&self) -> String { fn description(&self) -> String {
"insert a prompt that opts into the edit workflow".into() "Insert prompt to opt into the edit workflow".into()
} }
fn menu_text(&self) -> String { fn menu_text(&self) -> String {
"Insert Workflow Prompt".into() self.description()
} }
fn requires_argument(&self) -> bool { fn requires_argument(&self) -> bool {

View file

@ -184,7 +184,7 @@ impl PickerDelegate for SlashCommandDelegate {
h_flex() h_flex()
.group(format!("command-entry-label-{ix}")) .group(format!("command-entry-label-{ix}"))
.w_full() .w_full()
.min_w(px(220.)) .min_w(px(250.))
.child( .child(
v_flex() v_flex()
.child( .child(
@ -203,7 +203,9 @@ impl PickerDelegate for SlashCommandDelegate {
div() div()
.font_buffer(cx) .font_buffer(cx)
.child( .child(
Label::new(args).size(LabelSize::Small), Label::new(args)
.size(LabelSize::Small)
.color(Color::Muted),
) )
.visible_on_hover(format!( .visible_on_hover(format!(
"command-entry-label-{ix}" "command-entry-label-{ix}"