From 8a18c94f33fc36c89016c8f606a20632ce63b472 Mon Sep 17 00:00:00 2001
From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Date: Wed, 2 Oct 2024 15:35:50 +0200
Subject: [PATCH] Make slash command descriptions consistent (#18595)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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!
---
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers
---
crates/assistant/src/slash_command/auto_command.rs | 4 ++--
crates/assistant/src/slash_command/delta_command.rs | 4 ++--
crates/assistant/src/slash_command/diagnostics_command.rs | 2 +-
crates/assistant/src/slash_command/fetch_command.rs | 4 ++--
crates/assistant/src/slash_command/file_command.rs | 4 ++--
crates/assistant/src/slash_command/now_command.rs | 4 ++--
crates/assistant/src/slash_command/project_command.rs | 4 ++--
crates/assistant/src/slash_command/prompt_command.rs | 4 ++--
crates/assistant/src/slash_command/search_command.rs | 4 ++--
crates/assistant/src/slash_command/symbols_command.rs | 4 ++--
crates/assistant/src/slash_command/tab_command.rs | 4 ++--
crates/assistant/src/slash_command/terminal_command.rs | 4 ++--
crates/assistant/src/slash_command/workflow_command.rs | 4 ++--
crates/assistant/src/slash_command_picker.rs | 6 ++++--
14 files changed, 29 insertions(+), 27 deletions(-)
diff --git a/crates/assistant/src/slash_command/auto_command.rs b/crates/assistant/src/slash_command/auto_command.rs
index 14cee296820989d4afacc8eec2ed4231ec591408..14bbb7c8412b411975003f74dd70c15ddb7f8ea7 100644
--- a/crates/assistant/src/slash_command/auto_command.rs
+++ b/crates/assistant/src/slash_command/auto_command.rs
@@ -31,11 +31,11 @@ impl SlashCommand for AutoCommand {
}
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 {
- "Automatically Infer Context".into()
+ self.description()
}
fn label(&self, cx: &AppContext) -> CodeLabel {
diff --git a/crates/assistant/src/slash_command/delta_command.rs b/crates/assistant/src/slash_command/delta_command.rs
index 6a66ad3f09aa9afc16f50beb7b389aef61f0ab1d..6f697ecbb9bcba2d72657ba79a88610836eff1dc 100644
--- a/crates/assistant/src/slash_command/delta_command.rs
+++ b/crates/assistant/src/slash_command/delta_command.rs
@@ -19,11 +19,11 @@ impl SlashCommand for DeltaSlashCommand {
}
fn description(&self) -> String {
- "re-insert changed files".into()
+ "Re-insert changed files".into()
}
fn menu_text(&self) -> String {
- "Re-insert Changed Files".into()
+ self.description()
}
fn requires_argument(&self) -> bool {
diff --git a/crates/assistant/src/slash_command/diagnostics_command.rs b/crates/assistant/src/slash_command/diagnostics_command.rs
index 3f79c01675031874aee39dab40a1661abbfbebdd..146a4e5d366dd36cf58544f94f50cfee7da1b32c 100644
--- a/crates/assistant/src/slash_command/diagnostics_command.rs
+++ b/crates/assistant/src/slash_command/diagnostics_command.rs
@@ -95,7 +95,7 @@ impl SlashCommand for DiagnosticsSlashCommand {
}
fn menu_text(&self) -> String {
- "Insert Diagnostics".into()
+ self.description()
}
fn requires_argument(&self) -> bool {
diff --git a/crates/assistant/src/slash_command/fetch_command.rs b/crates/assistant/src/slash_command/fetch_command.rs
index 23d3c884a8ec2843812ee8d6969d08aa3e669a21..3a01bb645a36bb21428a662874ca41c04cda3481 100644
--- a/crates/assistant/src/slash_command/fetch_command.rs
+++ b/crates/assistant/src/slash_command/fetch_command.rs
@@ -104,11 +104,11 @@ impl SlashCommand for FetchSlashCommand {
}
fn description(&self) -> String {
- "insert URL contents".into()
+ "Insert fetched URL contents".into()
}
fn menu_text(&self) -> String {
- "Insert fetched URL contents".into()
+ self.description()
}
fn requires_argument(&self) -> bool {
diff --git a/crates/assistant/src/slash_command/file_command.rs b/crates/assistant/src/slash_command/file_command.rs
index 260c6b0e2a0840c41ca6a6f88dcca169d09bb99e..6da56d064178adcad9e9cfb6960660667bef5e9d 100644
--- a/crates/assistant/src/slash_command/file_command.rs
+++ b/crates/assistant/src/slash_command/file_command.rs
@@ -110,11 +110,11 @@ impl SlashCommand for FileSlashCommand {
}
fn description(&self) -> String {
- "insert file".into()
+ "Insert file".into()
}
fn menu_text(&self) -> String {
- "Insert File".into()
+ self.description()
}
fn requires_argument(&self) -> bool {
diff --git a/crates/assistant/src/slash_command/now_command.rs b/crates/assistant/src/slash_command/now_command.rs
index eb0ca926f015b61568ce90e85a8608f32aa12cde..221ba05cafc6238c2eb84566f057dcb146805c4e 100644
--- a/crates/assistant/src/slash_command/now_command.rs
+++ b/crates/assistant/src/slash_command/now_command.rs
@@ -19,11 +19,11 @@ impl SlashCommand for NowSlashCommand {
}
fn description(&self) -> String {
- "insert the current date and time".into()
+ "Insert current date and time".into()
}
fn menu_text(&self) -> String {
- "Insert Current Date and Time".into()
+ self.description()
}
fn requires_argument(&self) -> bool {
diff --git a/crates/assistant/src/slash_command/project_command.rs b/crates/assistant/src/slash_command/project_command.rs
index 197e91d91addacdf167f06493d8b4c541d16f792..58fef8f338771dbc2ad9dc5d24cbdcfc1aa0df78 100644
--- a/crates/assistant/src/slash_command/project_command.rs
+++ b/crates/assistant/src/slash_command/project_command.rs
@@ -47,11 +47,11 @@ impl SlashCommand for ProjectSlashCommand {
}
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 {
- "Project Context".into()
+ self.description()
}
fn requires_argument(&self) -> bool {
diff --git a/crates/assistant/src/slash_command/prompt_command.rs b/crates/assistant/src/slash_command/prompt_command.rs
index effbcc0f90ce87e52912346bdda79674b1611840..978c6d7504caeb66ccb9729de9b65a4a6762b1f5 100644
--- a/crates/assistant/src/slash_command/prompt_command.rs
+++ b/crates/assistant/src/slash_command/prompt_command.rs
@@ -16,11 +16,11 @@ impl SlashCommand for PromptSlashCommand {
}
fn description(&self) -> String {
- "insert prompt from library".into()
+ "Insert prompt from library".into()
}
fn menu_text(&self) -> String {
- "Insert Prompt from Library".into()
+ self.description()
}
fn requires_argument(&self) -> bool {
diff --git a/crates/assistant/src/slash_command/search_command.rs b/crates/assistant/src/slash_command/search_command.rs
index f0f3ee3d25c6604b1851e1e44d83f3e6025269d8..c7183e95bbc8537b1560e1f165efcc099a02b709 100644
--- a/crates/assistant/src/slash_command/search_command.rs
+++ b/crates/assistant/src/slash_command/search_command.rs
@@ -34,11 +34,11 @@ impl SlashCommand for SearchSlashCommand {
}
fn description(&self) -> String {
- "semantic search".into()
+ "Search your project semantically".into()
}
fn menu_text(&self) -> String {
- "Semantic Search".into()
+ self.description()
}
fn requires_argument(&self) -> bool {
diff --git a/crates/assistant/src/slash_command/symbols_command.rs b/crates/assistant/src/slash_command/symbols_command.rs
index 1cf8536c0dbfe7f9e846cfa1fc1574c4db9548d9..887b57ba9956c72ff1b148907b1b6a7710250514 100644
--- a/crates/assistant/src/slash_command/symbols_command.rs
+++ b/crates/assistant/src/slash_command/symbols_command.rs
@@ -17,11 +17,11 @@ impl SlashCommand for OutlineSlashCommand {
}
fn description(&self) -> String {
- "insert symbols for active tab".into()
+ "Insert symbols for active tab".into()
}
fn menu_text(&self) -> String {
- "Insert Symbols for Active Tab".into()
+ self.description()
}
fn complete_argument(
diff --git a/crates/assistant/src/slash_command/tab_command.rs b/crates/assistant/src/slash_command/tab_command.rs
index bdf8450d43be819deffc3d6c04e0571d003c29d9..0bff4730d8e5c8c21bcf8c5ba37b670e876429d8 100644
--- a/crates/assistant/src/slash_command/tab_command.rs
+++ b/crates/assistant/src/slash_command/tab_command.rs
@@ -24,11 +24,11 @@ impl SlashCommand for TabSlashCommand {
}
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 {
- "Insert Open Tabs".to_owned()
+ self.description()
}
fn requires_argument(&self) -> bool {
diff --git a/crates/assistant/src/slash_command/terminal_command.rs b/crates/assistant/src/slash_command/terminal_command.rs
index 1d0293c235d4424d91d032577baee191633c14cb..1d4959fb1995720b939bb93f8121466f6ba4a58d 100644
--- a/crates/assistant/src/slash_command/terminal_command.rs
+++ b/crates/assistant/src/slash_command/terminal_command.rs
@@ -29,11 +29,11 @@ impl SlashCommand for TerminalSlashCommand {
}
fn description(&self) -> String {
- "insert terminal output".into()
+ "Insert terminal output".into()
}
fn menu_text(&self) -> String {
- "Insert Terminal Output".into()
+ self.description()
}
fn requires_argument(&self) -> bool {
diff --git a/crates/assistant/src/slash_command/workflow_command.rs b/crates/assistant/src/slash_command/workflow_command.rs
index c66dd9bebff144da2f12a4751d9a5e8e504cb9f1..071b4feaf436e342fe35ab410241e9b36f2832da 100644
--- a/crates/assistant/src/slash_command/workflow_command.rs
+++ b/crates/assistant/src/slash_command/workflow_command.rs
@@ -29,11 +29,11 @@ impl SlashCommand for WorkflowSlashCommand {
}
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 {
- "Insert Workflow Prompt".into()
+ self.description()
}
fn requires_argument(&self) -> bool {
diff --git a/crates/assistant/src/slash_command_picker.rs b/crates/assistant/src/slash_command_picker.rs
index 4b57dcfb3306c5cc676f8064af0108782d7886a8..58023848b0e508eb63ccbe626cddad34cebe5c1f 100644
--- a/crates/assistant/src/slash_command_picker.rs
+++ b/crates/assistant/src/slash_command_picker.rs
@@ -184,7 +184,7 @@ impl PickerDelegate for SlashCommandDelegate {
h_flex()
.group(format!("command-entry-label-{ix}"))
.w_full()
- .min_w(px(220.))
+ .min_w(px(250.))
.child(
v_flex()
.child(
@@ -203,7 +203,9 @@ impl PickerDelegate for SlashCommandDelegate {
div()
.font_buffer(cx)
.child(
- Label::new(args).size(LabelSize::Small),
+ Label::new(args)
+ .size(LabelSize::Small)
+ .color(Color::Muted),
)
.visible_on_hover(format!(
"command-entry-label-{ix}"