Add "Checking" icon for diagnostics

Nate Butler created

Change summary

Cargo.lock                       |  2 +-
assets/icons/arrow_circle.svg    |  1 +
crates/diagnostics/src/items.rs  | 21 ++++++++++++++++-----
crates/ui/src/components/icon.rs |  2 ++
4 files changed, 20 insertions(+), 6 deletions(-)

Detailed changes

Cargo.lock πŸ”—

@@ -9514,7 +9514,7 @@ dependencies = [
 
 [[package]]
 name = "zed"
-version = "0.119.0"
+version = "0.120.0"
 dependencies = [
  "activity_indicator",
  "ai",

assets/icons/arrow_circle.svg πŸ”—

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-refresh-cw"><path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/></svg>

crates/diagnostics/src/items.rs πŸ”—

@@ -23,11 +23,21 @@ pub struct DiagnosticIndicator {
 impl Render for DiagnosticIndicator {
     fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
         let diagnostic_indicator = match (self.summary.error_count, self.summary.warning_count) {
-            (0, 0) => h_stack().child(
-                IconElement::new(Icon::Check)
-                    .size(IconSize::Small)
-                    .color(Color::Success),
-            ),
+            (0, 0) => h_stack().map(|this| {
+                if !self.in_progress_checks.is_empty() {
+                    this.child(
+                        IconElement::new(Icon::ArrowCircle)
+                            .size(IconSize::Small)
+                            .color(Color::Muted),
+                    )
+                } else {
+                    this.child(
+                        IconElement::new(Icon::Check)
+                            .size(IconSize::Small)
+                            .color(Color::Default),
+                    )
+                }
+            }),
             (0, warning_count) => h_stack()
                 .gap_1()
                 .child(
@@ -64,6 +74,7 @@ impl Render for DiagnosticIndicator {
             Some(
                 Label::new("Checking…")
                     .size(LabelSize::Small)
+                    .color(Color::Muted)
                     .into_any_element(),
             )
         } else if let Some(diagnostic) = &self.current_diagnostic {

crates/ui/src/components/icon.rs πŸ”—

@@ -29,6 +29,7 @@ pub enum Icon {
     ArrowRight,
     ArrowUp,
     ArrowUpRight,
+    ArrowCircle,
     AtSign,
     AudioOff,
     AudioOn,
@@ -119,6 +120,7 @@ impl Icon {
             Icon::ArrowRight => "icons/arrow_right.svg",
             Icon::ArrowUp => "icons/arrow_up.svg",
             Icon::ArrowUpRight => "icons/arrow_up_right.svg",
+            Icon::ArrowCircle => "icons/arrow_circle.svg",
             Icon::AtSign => "icons/at_sign.svg",
             Icon::AudioOff => "icons/speaker_off.svg",
             Icon::AudioOn => "icons/speaker_loud.svg",