Skip to content

Conversation

@yashmehrotra
Copy link
Member

@yashmehrotra yashmehrotra commented Dec 6, 2025

Summary by CodeRabbit

  • Refactor

    • Unified status visuals across the app by replacing varied health/indicator UIs with the Status component for consistent badge/dot displays and icon placement in tables, cards, lists, and detail views.
    • Simplified DOM structure for status cells.
  • New Features

    • Status supports a compact "dot" variant and an optional numeric count on badges.
    • Status used broadly for linked/status aggregates and tooltips.
  • Style

    • Minor typography tweak: reduced badge font weight and adjusted column widths for status columns.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
aws-preview Ready Ready Preview Dec 29, 2025 8:20pm
flanksource-ui Ready Ready Preview Dec 29, 2025 8:20pm

@coderabbitai
Copy link

coderabbitai bot commented Dec 6, 2025

Walkthrough

Replaces single-string status color with a structured StatusColorConfig ({ badge, dot }), adds Status props variant?: "badge" | "dot" and count?, and updates many UI components to render statuses via the new Status API and adjusted icon/wrapping logic.

Changes

Cohort / File(s) Change Summary
Status component
src/components/Status/index.tsx
Introduces StatusColorConfig = { badge: string; dot: string }; replaces getStatusColor with getStatusColorConfig(status, good, mixed) returning badge/dot classes; adds `variant?: "badge"
Audit-report & view rendering
src/pages/audit-report/components/DynamicDataTable.tsx, src/pages/audit-report/components/View/ViewCard.tsx
Swap plain text/status icons for <Status />; DynamicDataTable simplifies cell wrappers; ViewCard adds isHealthIcon logic, computes an iconElement (health dot vs Icon) and injects it into Badge or inline content; skip health icon when column type is "status".
Canary components
src/components/Canary/CanaryStatsCard.tsx, src/components/Canary/CanaryTableColumns.tsx, src/components/Canary/Columns/index.tsx, src/components/Canary/renderers.tsx
Replace StatCard/count visuals with Status components; pass variant="dot" for compact health dots; CanaryStatsCard props now include passing: { checks: number; filtered: number }.
Config summaries & lists
src/components/Configs/ConfigSummary/Cells/ConfigSummaryHealthCells.tsx, src/components/Configs/ConfigSummary/ConfigSummaryList.tsx
Replace Count/CountBar visuals and color-mapping with per-item linked Status components; add deterministic healthOrder/orderByHealth sorting; remove exported getConfigStatusColor.
Notifications
src/components/Notifications/NotificationSendHistorySummary.tsx, src/components/Notifications/NotificationsStatusCell.tsx, src/components/Notifications/NotificationSendHistory/NotificationDetails.tsx, src/components/Notifications/NotificationSendHistory.tsx, src/components/Notifications/Rules/notificationsRulesTableColumns.tsx
Consolidate various Icon/CountBar/HealthIndicator UIs into Status components; update notificationSendHistoryStatus entries to use status strings and <Status variant="dot" /> icons; adjust column maxSizes and layout (Sent/Failed/Pending).
StatusLine & HealthBadge
src/components/StatusLine/StatusLine.tsx, src/pages/audit-report/components/HealthBadge.tsx
Replace Chip/inline health markup with Status; add mapping from legacy color values to Status.status; HealthBadge retains a printView branch using precomputed color maps.
UI tweaks (badges/styles)
src/ui/Badge/Badge.tsx, pages/application.css
Removed font-medium from badge class; minor CSS/class adjustments affecting badge font-weight only.

Sequence Diagram(s)

(omitted)

Possibly related PRs

Suggested reviewers

  • moshloop
  • adityathebe

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: improve status badge ui' directly aligns with the main objective of the PR, which refactors and enhances the Status component rendering with new variants (dot, count) and updates badge styling across multiple components.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch status-badge

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 423ad44 and 5bd9802.

📒 Files selected for processing (5)
  • src/components/Configs/ConfigSummary/Cells/ConfigSummaryHealthCells.tsx
  • src/components/Notifications/NotificationSendHistory.tsx
  • src/components/Notifications/NotificationSendHistorySummary.tsx
  • src/components/Notifications/NotificationsStatusCell.tsx
  • src/components/Notifications/Rules/notificationsRulesTableColumns.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/Configs/ConfigSummary/Cells/ConfigSummaryHealthCells.tsx
🧰 Additional context used
🧬 Code graph analysis (4)
src/components/Notifications/NotificationsStatusCell.tsx (1)
src/components/Status/index.tsx (1)
  • Status (95-154)
src/components/Notifications/NotificationSendHistory.tsx (4)
src/api/types/health.ts (1)
  • HealthCheck (14-50)
src/api/types/configs.ts (1)
  • ConfigItem (49-91)
src/api/types/topology.ts (1)
  • Topology (39-72)
src/components/Notifications/NotificationsStatusCell.tsx (1)
  • NotificationStatusCell (85-106)
src/components/Notifications/Rules/notificationsRulesTableColumns.tsx (1)
src/components/ui/tooltip.tsx (1)
  • Tooltip (30-30)
src/components/Notifications/NotificationSendHistorySummary.tsx (1)
src/components/Status/index.tsx (1)
  • Status (95-154)
🔇 Additional comments (16)
src/components/Notifications/Rules/notificationsRulesTableColumns.tsx (6)

9-9: LGTM! Imports support the refactoring.

The addition of useId and the Status component import are appropriate for the changes below.

Also applies to: 13-13


164-164: LGTM! Width increase aligns with layout expansion.

The column width increase from 150 to 200 makes sense given the expanded flex-wrap layout for the status badges.


178-178: LGTM! Good UX improvement with flex-wrap.

The layout change to flex-wrap ensures the status badges can wrap to multiple lines when needed, preventing overflow issues when multiple statuses with counts are displayed. The gap-1 provides consistent spacing.


171-171: LGTM! Proper use of useId for unique tooltip IDs.

Using useId() ensures each table row has a unique tooltip ID, preventing collisions when multiple rows display the failed count tooltip.


152-157: The Status component correctly accepts both status and statusText props. No issues found with the prop usage in lines 152-157.


178-197: Status component props are correctly used; verify the z-index necessity.

The Status component accepts both status and statusText props as used here (with status values like "healthy", "unhealthy", "warning"), and the tooltip wrapper pattern matches existing patterns in the codebase (e.g., CanaryStatsCard.tsx), where a div with inline-flex wraps the Status component to maintain compact layout.

However, the z-[999999] value is notably high. Standard tooltips in the codebase use z-50 (Avatar, Button), while only error modals use z-[9999999999]. Verify whether this notification tooltip requires such a high z-index or if z-50 would suffice for its use case.

src/components/Notifications/NotificationSendHistory.tsx (5)

15-15: LGTM!

The Status component import is correctly added to support the new status rendering approach.


81-87: LGTM!

The status transition rendering correctly uses healthAtEvent for the health indicator and statusAtEvent for the descriptive status text.


89-107: LGTM - Status rendering is consistent with resource types.

The rendering correctly handles different resource types:

  • Check resources use the status field for both status indicator and display text
  • Config and Component resources use health for the status indicator and status for display text, with "Unknown" fallback

This aligns with the type definitions where checks have a simple status field, while configs and components have separate health and status fields.


112-124: LGTM - Simplified notification status rendering.

The removal of the extra wrapping div makes the structure cleaner while maintaining the same functionality with FilterByCellValue and NotificationStatusCell.


81-87: Fix incorrect prop in Status component - displays wrong text for status transitions.

Line 84 passes healthAtEvent to the statusText prop, but it should pass statusAtEvent. This bug causes the status transition to display the health value instead of the descriptive status text.

🔎 Proposed fix
-                <Status status={healthAtEvent} statusText={statusAtEvent} />
+                <Status status={healthAtEvent} statusText={statusAtEvent} />

Wait, looking at this more carefully - the current code has statusText={statusAtEvent} but I need to verify what the actual code shows. Let me re-examine...

Actually, reviewing the annotated code again, line 84 shows:

                <Status status={healthAtEvent} statusText={statusAtEvent} />

Hmm, this appears correct in the shown code. But let me check if there's a typo in the original. The issue is that statusAtEvent should be the status text (the descriptive string) and healthAtEvent should be the health indicator. So this looks correct as-is.

Let me re-read the code... Line 84 shows statusText={statusAtEvent} which is correct. I was mistaken in my analysis. This segment is actually correct.

[done]
No issue found - the code is correct
[scratchpad_end] -->

Likely an incorrect or invalid review comment.

src/components/Notifications/NotificationsStatusCell.tsx (2)

85-106: LGTM - Simplified status cell rendering with Status component.

The refactoring cleanly replaces the previous rendering logic with the new Status component, properly mapping statusConfig.status to the status indicator and statusConfig.label to the display text.


5-83: The icon property in notificationSendHistoryStatus is not consumed anywhere in the codebase. A search across NotificationStatusDropdown.tsx, NotificationDetails.tsx, and NotificationsStatusCell.tsx shows that only the value, status, and label properties are accessed. The change from an Icon component to a Status component for the icon property has no impact on any consumers and is not a concern.

Likely an incorrect or invalid review comment.

src/components/Notifications/NotificationSendHistorySummary.tsx (3)

20-30: LGTM - Correct Status component usage for resource health/status.

The component properly maps the resource's health field to the status indicator and the status field to the display text, with appropriate handling for deleted resources.


100-128: LGTM - Clear status badge rendering with proper sizing.

The refactoring from CountBar to individual Status components improves readability and explicitly shows sent, failed, and suppressed counts with appropriate health status indicators. The column size increase to 250 appropriately accommodates multiple status badges.


131-175: LGTM - Props and component structure properly maintained.

The component structure, navigation logic, and modal handling remain intact while properly accepting the updated props for pagination and loading state.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/pages/audit-report/components/View/ViewCard.tsx (1)

357-377: Health badge renders with empty children.

The Badge for health type has no text content—only classes are set but children is empty. This appears to be an incomplete implementation or accidental removal.

Consider adding the health value as badge content:

         cellContent = (
           <Badge
             variant={
               healthValue === "healthy"
                 ? "secondary"
                 : healthValue === "warning"
                   ? "default"
                   : "destructive"
             }
             className={
               healthValue === "healthy"
                 ? "bg-green-100 text-green-800 hover:bg-green-100/80"
                 : healthValue === "warning"
                   ? "bg-yellow-100 text-yellow-800 hover:bg-yellow-100/80"
                   : ""
             }
-          ></Badge>
+          >
+            {healthValue}
+          </Badge>
         );
🧹 Nitpick comments (1)
src/pages/audit-report/components/View/ViewCard.tsx (1)

463-522: Well-structured icon handling with appropriate status column detection.

The logic correctly skips adding a redundant health dot for status columns since the Status component already renders one. The cloneElement approach for injecting icons into existing Badge components is reasonable.

One minor observation: the health icon colors here (green-500, yellow-500, red-500) differ slightly from those in getStatusColor (green-400, light-orange, red-400). If visual consistency across all status indicators is desired, consider extracting these color mappings to a shared location.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6394ca6 and 6203164.

📒 Files selected for processing (3)
  • src/components/Status/index.tsx (2 hunks)
  • src/pages/audit-report/components/DynamicDataTable.tsx (1 hunks)
  • src/pages/audit-report/components/View/ViewCard.tsx (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/pages/audit-report/components/View/ViewCard.tsx (2)
src/components/Status/index.tsx (1)
  • Status (44-70)
src/components/ui/badge.tsx (1)
  • Badge (36-36)
src/pages/audit-report/components/DynamicDataTable.tsx (1)
src/components/Status/index.tsx (1)
  • Status (44-70)
🔇 Additional comments (3)
src/pages/audit-report/components/DynamicDataTable.tsx (1)

440-445: Clean integration with the updated Status component.

Using statusText to pass the original cell content while status controls the color is the correct approach. This removes the need for a wrapper span and leverages the Status component's Badge-based rendering.

src/components/Status/index.tsx (1)

3-33: Good addition of mixed state handling.

The priority order in getStatusColor is sensible: explicit negative statuses take precedence, followed by unknown/warning, then the mixed boolean flag, defaulting to green. Using the same color as warning (bg-light-orange) for mixed states provides visual consistency.

src/pages/audit-report/components/View/ViewCard.tsx (1)

379-381: Consistent use of Status component for status columns.

This aligns with the changes in DynamicDataTable.tsx and properly delegates status rendering to the unified Status component.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/pages/audit-report/components/View/ViewCard.tsx (2)

471-522: Empty if block is a code smell—consider inverting the condition.

The empty block at lines 472-474 is harder to read. Inverting the condition eliminates the empty branch and improves clarity.

🔎 Suggested refactor
-        // Skip adding health icon for status columns since Status component already has the dot
-        if (isHealthIcon && column.type === "status") {
-          // Status component already handles the colored dot, skip adding another
-        } else {
+        // Skip adding health icon for status columns since Status component already has the dot
+        if (!(isHealthIcon && column.type === "status")) {
           const isBadge =
             React.isValidElement(cellContent) && cellContent.type === Badge;
           // ... rest of the logic
-        }
+        }

478-498: Minor style inconsistency: span vs. SVG for dots.

The Status component uses an SVG with fill-* classes for dots, while this code uses a <span> with bg-* classes. Both work, but using the same approach would improve visual consistency and maintainability.

🔎 Optional: Use SVG for consistency with Status component
           if (isHealthIcon) {
             const iconColor =
               iconStr === "healthy"
-                ? "bg-green-500"
+                ? "fill-green-500"
                 : iconStr === "warning"
-                  ? "bg-yellow-500"
+                  ? "fill-yellow-500"
                   : iconStr === "unhealthy"
-                    ? "bg-red-500"
-                    : "bg-gray-400";
+                    ? "fill-red-500"
+                    : "fill-gray-400";
             iconElement = (
-              <span className={`h-2 w-2 rounded-full ${iconColor}`} />
+              <svg
+                viewBox="0 0 6 6"
+                aria-hidden="true"
+                className={`size-2 ${iconColor}`}
+              >
+                <circle r={3} cx={3} cy={3} />
+              </svg>
             );
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6203164 and a7f6e65.

📒 Files selected for processing (3)
  • src/components/Status/index.tsx
  • src/pages/audit-report/components/DynamicDataTable.tsx
  • src/pages/audit-report/components/View/ViewCard.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/pages/audit-report/components/DynamicDataTable.tsx
🧰 Additional context used
🧬 Code graph analysis (1)
src/pages/audit-report/components/View/ViewCard.tsx (1)
src/components/Status/index.tsx (1)
  • Status (69-97)
🔇 Additional comments (6)
src/components/Status/index.tsx (2)

1-58: Well-structured color configuration approach.

The StatusColorConfig type and getStatusColorConfig function provide a clean, maintainable way to handle status colors with proper dark mode support. The separation of badge and dot colors allows for flexible styling.


83-96: Clean implementation with past feedback addressed.

The className is now correctly applied only to the outer <span> container (line 85), not the dot element. The SVG-based dot with fill-* classes is a good choice for consistent rendering.

src/pages/audit-report/components/View/ViewCard.tsx (4)

23-23: Import added correctly.


357-377: Badge is rendered without any content.

The Badge component has no children, resulting in an empty badge with just background color. If this is intentional (icon-only display), consider adding a comment. Otherwise, the health status text should be displayed.

🔎 If content should be displayed, consider this fix
           className={
             healthValue === "healthy"
               ? "bg-green-100 text-green-800 hover:bg-green-100/80"
               : healthValue === "warning"
                 ? "bg-yellow-100 text-yellow-800 hover:bg-yellow-100/80"
                 : ""
           }
-        ></Badge>
+        >
+          <span className="capitalize">{healthValue}</span>
+        </Badge>

Alternatively, consider using the Status component here for consistency with the "status" type rendering.


379-381: Good use of the Status component.

Clean integration with the refactored Status component for consistent status badge rendering.


500-512: cloneElement approach is functional but fragile.

Injecting children via React.cloneElement works but is tightly coupled to Badge's internal structure. If Badge's implementation changes, this could break silently. This is acceptable for now but worth noting for future maintenance.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/ui/Badge/Badge.tsx (1)

47-53: Critical: Fix SVG syntax error.

Line 49 has a malformed className string with a misplaced quote that terminates the template literal prematurely. The fill and viewBox attributes are incorrectly embedded in the className string rather than being separate SVG attributes.

🔎 Proposed fix
       {dot != null && (
         <svg
-          className={`${svgClassName} text-blue-400" fill="${dot}" viewBox="0 0 8 8"`}
+          className={`${svgClassName} text-blue-400`}
+          fill={dot}
+          viewBox="0 0 8 8"
         >
           <circle cx={4} cy={4} r={3} />
         </svg>
🧹 Nitpick comments (1)
src/components/Status/index.tsx (1)

67-82: The custom Tailwind color is properly configured; consider optimizing for direct lookup.

The bg-light-orange color is properly defined in the Tailwind configuration (#FBBE67). However, getDotBgClass can be optimized from O(n) iteration to O(1) direct lookup:

function getDotBgClass(dotClass: string): string {
-  for (const [fill, bg] of Object.entries(fillToBgMap)) {
-    if (dotClass.includes(fill)) {
-      return bg;
-    }
-  }
-  return "bg-gray-400";
+  const match = dotClass.match(/fill-\w+-\d+/);
+  if (match) {
+    return fillToBgMap[match[0]] ?? "bg-gray-400";
+  }
+  return "bg-gray-400";
}
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a7f6e65 and 6bd21a2.

📒 Files selected for processing (13)
  • pages/application.css
  • src/components/Canary/CanaryStatsCard.tsx
  • src/components/Canary/CanaryTableColumns.tsx
  • src/components/Canary/Columns/index.tsx
  • src/components/Canary/renderers.tsx
  • src/components/Configs/ConfigSummary/Cells/ConfigSummaryHealthCells.tsx
  • src/components/Configs/ConfigSummary/ConfigSummaryList.tsx
  • src/components/Notifications/NotificationSendHistorySummary.tsx
  • src/components/Notifications/NotificationsStatusCell.tsx
  • src/components/Status/index.tsx
  • src/components/StatusLine/StatusLine.tsx
  • src/pages/audit-report/components/HealthBadge.tsx
  • src/ui/Badge/Badge.tsx
🧰 Additional context used
🧬 Code graph analysis (7)
src/components/Configs/ConfigSummary/Cells/ConfigSummaryHealthCells.tsx (1)
src/components/Status/index.tsx (1)
  • Status (95-154)
src/components/Canary/CanaryStatsCard.tsx (1)
src/components/Status/index.tsx (1)
  • Status (95-154)
src/pages/audit-report/components/HealthBadge.tsx (1)
src/components/Status/index.tsx (1)
  • Status (95-154)
src/components/StatusLine/StatusLine.tsx (1)
src/components/Status/index.tsx (1)
  • Status (95-154)
src/components/Canary/renderers.tsx (1)
src/components/Status/index.tsx (1)
  • Status (95-154)
src/components/Canary/Columns/index.tsx (1)
src/components/Status/index.tsx (1)
  • Status (95-154)
src/components/Notifications/NotificationsStatusCell.tsx (1)
src/components/Status/index.tsx (1)
  • Status (95-154)
🔇 Additional comments (20)
src/ui/Badge/Badge.tsx (1)

43-43: Removal of font-medium is intentional.

The removal of font-medium from the badge styling aligns with the PR's objective to improve status badge UI consistency.

pages/application.css (1)

41-43: LGTM!

The removal of font-medium from the .status-badge class is consistent with the Badge component changes and aligns with the PR's UI standardization objectives.

src/components/Configs/ConfigSummary/ConfigSummaryList.tsx (1)

290-290: Whitespace-only change, no functional impact.

src/pages/audit-report/components/HealthBadge.tsx (1)

2-42: Well-structured refactor to Status component.

The bifurcated rendering approach correctly handles both print and non-print views:

  • Print view maintains minimal inline styling for PDF compatibility
  • Standard view delegates to the centralized Status component

The color mappings are consistent across both paths.

src/components/Status/index.tsx (2)

1-65: Solid architectural refactor to centralized color configuration.

The introduction of StatusColorConfig and the refactored getStatusColorConfig function provides a clean, maintainable approach to managing status colors with support for both badge and dot variants, including dark mode.


94-153: Status component correctly implements three rendering modes.

The component cleanly handles:

  • Dot-only variant for simple indicators
  • Count display with dot
  • Full badge with optional text

The conditional logic is clear and the className application to the dot variant (line 116) is appropriate since it's a standalone element without a wrapper.

src/components/StatusLine/StatusLine.tsx (1)

34-71: Clean migration to Status component.

The colorToStatus mapping correctly translates existing color semantics to Status values, and both linked and inline rendering paths are handled consistently.

src/components/Configs/ConfigSummary/Cells/ConfigSummaryHealthCells.tsx (3)

7-19: Good addition of deterministic health ordering.

The healthOrder array and orderByHealth helper ensure health statuses are consistently displayed in severity order (healthy → unhealthy → warning → unknown).


38-64: Effective refactor to Status-based rendering with navigation.

The migration from Count/CountBar to Status components wrapped in Links improves both visual consistency and user experience by making health counts clickable filters.


83-101: Aggregate cell correctly uses same ordering without navigation.

Consistent with the individual cell rendering, using the same orderByHealth logic while appropriately omitting links for aggregate rows.

src/components/Canary/renderers.tsx (1)

20-25: Appropriate use of dot variant for Canary status.

Adding variant="dot" to both status branches provides a compact, consistent visual indicator for Canary health checks.

src/components/Canary/Columns/index.tsx (2)

42-42: LGTM: Consistent adoption of dot variant.

The addition of variant="dot" aligns with the Status component's API and provides a more compact visual representation for the status column.


46-46: LGTM: Dot variant applied consistently.

The variant="dot" addition maintains consistency with the object-value branch above.

src/components/Canary/CanaryTableColumns.tsx (1)

80-80: LGTM: Consistent dot variant usage.

The addition of variant="dot" to the Health column's Status component is consistent with similar changes across Canary components.

src/components/Notifications/NotificationsStatusCell.tsx (2)

93-93: LGTM: Clean Status component integration.

The rendering logic correctly uses the Status component with status and statusText props from the configuration.


5-72: Status component properly supports all status values.

The Status component's getStatusColorConfig function (src/components/Status/index.tsx, lines 6-65) correctly handles all four status values used in the notification status object:

  • "healthy" → Default case returns green colors (line 60)
  • "unhealthy" → Explicitly handled, returns red colors (line 17)
  • "unknown" → Explicitly handled, returns gray colors (line 29)
  • "suppressed" → Explicitly handled, returns gray colors (line 31)

The refactoring is sound with no gaps in status value coverage.

src/components/Canary/CanaryStatsCard.tsx (3)

23-26: Review the failing count computation logic.

The failingCount computation subtracts passing.filtered or passing.checks from the filtered or total checks length. Verify this logic is correct:

  • When filtered: filteredChecksLength - passing.filtered
  • When not filtered: (checks?.length ?? 0) - passing.checks

Ensure that passing.filtered represents the count of passing checks within the filtered set, not a separate unrelated count.


29-47: LGTM: Clean Status component integration with tooltips.

The refactoring from StatCard to Status components is well-executed. The tooltip integration provides good UX, and the Status components are used correctly with the good prop and custom statusText.


6-18: All consumers already updated with new passing prop.

Verification confirms that the only usage of CanaryStatsCards in the codebase (at src/pages/health.tsx:74) already provides the required passing prop. No further updates needed.

src/components/Notifications/NotificationSendHistorySummary.tsx (1)

109-133: The refactoring is clean and correct. The Status component explicitly handles status="suppressed" (returns gray styling), so the conditional rendering at lines 125-129 works as intended. The change from CountBar to individual Status components improves clarity and flexibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants