Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

WIP (#56923)

Joseph T. Lyonsa332a365924b
diff --git a/Cargo.lock b/Cargo.lock
index 17d03c1fb58..fcd7c96fa82 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -7367,6 +7367,7 @@ dependencies = [
"project",
"project_panel",
"rand 0.9.4",
+ "release_channel",
"remote_connection",
"search",
"serde_json",
diff --git a/crates/git_graph/Cargo.toml b/crates/git_graph/Cargo.toml
index 2f3b06220a6..2922453c468 100644
--- a/crates/git_graph/Cargo.toml
+++ b/crates/git_graph/Cargo.toml
@@ -35,6 +35,7 @@ picker.workspace = true
project.workspace = true
project_panel.workspace = true
rand = { workspace = true, optional = true }
+release_channel.workspace = true
search.workspace = true
settings.workspace = true
smallvec.workspace = true
diff --git a/crates/git_graph/src/git_graph.rs b/crates/git_graph/src/git_graph.rs
index 5ff6da5474f..605c5956635 100644
--- a/crates/git_graph/src/git_graph.rs
+++ b/crates/git_graph/src/git_graph.rs
@@ -65,6 +65,7 @@ const LINE_WIDTH: Pixels = px(1.5);
const RESIZE_HANDLE_WIDTH: f32 = 8.0;
const COPIED_STATE_DURATION: Duration = Duration::from_secs(2);
const COMMIT_TAG_LIST_WIDTH_IN_REMS: Rems = rems(10.);
+const CUSTOM_GIT_COMMANDS_DOCS_SLUG: &str = "tasks#custom-git-commands";
// Extra vertical breathing room added to the UI line height when computing
// the git graph's row height, so commit dots and lines have space around them.
const ROW_VERTICAL_PADDING: Pixels = px(4.0);
@@ -2192,8 +2193,24 @@ impl GitGraph {
}),
}
})
- .when(!git_tasks.is_empty(), |mut menu| {
- menu = menu.separator().header("Custom Git Commands");
+ .map(|mut menu| {
+ menu = menu.separator().header("Custom Commands");
+
+ if git_tasks.is_empty() {
+ return menu.item(
+ ContextMenuEntry::new("Learn More")
+ .icon(IconName::ArrowUpRight)
+ .icon_color(Color::Muted)
+ .icon_position(IconPosition::End)
+ .handler(|_window, cx| {
+ let docs_url = release_channel::docs_url(
+ CUSTOM_GIT_COMMANDS_DOCS_SLUG,
+ cx,
+ );
+ cx.open_url(&docs_url);
+ }),
+ );
+ }
for (task_source_kind, resolved_task) in git_tasks {
let label = resolved_task.display_label().to_string();