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.

git_ui: Add missing tooltips to Git Graph commit details (#66016)

Manoj sk08104dc649e2
diff --git a/crates/git_ui/src/git_graph.rs b/crates/git_ui/src/git_graph.rs
index 96f63f189f4..07644fc41fb 100644
--- a/crates/git_ui/src/git_graph.rs
+++ b/crates/git_ui/src/git_graph.rs
@@ -3146,6 +3146,17 @@ impl GitGraph {
.child(
div().absolute().top_2().right_2().child(
IconButton::new("close-detail", IconName::Close)
+ .tooltip({
+ let focus_handle = self.focus_handle.clone();
+ move |_window, cx: &mut App| {
+ Tooltip::for_action_in(
+ "Close Details Panel",
+ &Cancel,
+ &focus_handle,
+ cx,
+ )
+ }
+ })
.icon_size(IconSize::Small)
.on_click(cx.listener(move |this, _, _, cx| {
this.selected_entry_idx = None;
@@ -3357,6 +3368,11 @@ impl GitGraph {
"view-on-provider",
format!("View on {}", provider_name),
)
+ .tooltip({
+ move |_window, cx: &mut App| {
+ Tooltip::simple("Open In Browser", cx)
+ }
+ })
.start_icon(
Icon::new(icon)
.size(IconSize::Small)
@@ -4246,13 +4262,21 @@ impl GitGraph {
.w_full()
.gap_1()
.child(
- Disclosure::new("toggle-commit-message", !collapsed).on_click(cx.listener(
- |this, _, _, cx| {
+ Disclosure::new("toggle-commit-message", !collapsed)
+ .on_click(cx.listener(|this, _, _, cx| {
this.commit_details_message_collapsed =
!this.commit_details_message_collapsed;
cx.notify();
- },
- )),
+ }))
+ .tooltip({
+ let label = if !collapsed {
+ "Hide Commit Message"
+ } else {
+ "Show Commit Message"
+ };
+
+ move |_window, cx: &mut App| Tooltip::simple(label, cx)
+ }),
)
.child(
Label::new("Message")