Skip to content

Conversation

@asithade
Copy link
Contributor

@asithade asithade commented Nov 11, 2025

Summary

Refactors the foundation health component from a table-based layout to a carousel layout with filtering capabilities, displaying aggregate metrics across all foundations.

Changes

  • Convert foundation health component from table to carousel layout with filtering
  • Add aggregate metrics across all foundations (8 metric cards):
    • Total Projects with sparkline trend
    • Total Members with sparkline trend
    • Software Value with top 3 projects by value
    • Company Bus Factor with inline visualization
    • Active Contributors with sparkline trend
    • Maintainers with sparkline trend
    • Events with monthly bar chart
    • Project Health Scores distribution
  • Implement category-based filters (All, Contributors, Projects, Events)
  • Follow organization involvement patterns for data initialization
  • Pre-compute all display values in computed signals
  • Add various visualization types (sparklines, bar charts, bus factor, health scores)
  • Use justify-between for proper card vertical spacing
  • Remove public formatting methods from HTML templates

Technical Implementation

  • Created foundation-metrics.interface.ts with type definitions
  • Updated constants with aggregate metrics and chart configurations
  • Direct ChartComponent integration (no wrapper components)
  • Pre-computed display values in computed signals
  • Added data-testid attributes for E2E testing

JIRA

LFXV2-719

Generated with Claude Code

LFXV2-719

- Convert foundation health component from table to carousel layout with filtering
- Add aggregate metrics across all foundations (8 metric cards)
- Implement category-based filters (All, Contributors, Projects, Events)
- Follow organization involvement patterns for data initialization
- Pre-compute all display values in computed signals
- Add various visualization types (sparklines, bar charts, bus factor, health scores)
- Use justify-between for proper card vertical spacing
- Remove public formatting methods from HTML templates

Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Asitha de Silva <[email protected]>
Copilot AI review requested due to automatic review settings November 11, 2025 21:17
@asithade asithade requested a review from jordane as a code owner November 11, 2025 21:17
@coderabbitai
Copy link

coderabbitai bot commented Nov 11, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Replaces the table-based Foundation Health view with a carousel of metric cards driven by Angular signals, adds filter pills and carousel navigation, and introduces new shared interfaces and aggregate mock constants for sparkline/bar charts, top projects, bus-factor, and health-score distributions.

Changes

Cohort / File(s) Change Summary
Foundation Health Component
apps/lfx-one/src/app/modules/dashboards/components/foundation-health/foundation-health.component.html, apps/lfx-one/src/app/modules/dashboards/components/foundation-health/foundation-health.component.scss, apps/lfx-one/src/app/modules/dashboards/components/foundation-health/foundation-health.component.ts
Replaced static header/table with a carousel-based card layout and filter pills. Template now iterates metricCards() and switches on card.customContentType (sparkline, bar-chart, top-projects, bus-factor, health-scores). Added carousel scroll controls (scrollLeft, scrollRight), filter handling (handleFilterChange), ViewChild carouselScroll, Angular signals (selectedFilter) and computed properties (allMetricCards, metricCards, healthScoreDistribution). Added .hide-scrollbar utility and updated test IDs.
Shared Foundation Metrics Model
packages/shared/src/interfaces/foundation-metrics.interface.ts
New interfaces and types: MetricCategory, FoundationMetricCard, ProjectHealthDistribution, CompanyBusFactor, TopProjectByValue, TopProjectDisplay, and AggregateFoundationMetrics to model card content and aggregate metrics.
Shared Foundation Health Constants
packages/shared/src/constants/foundation-health.constants.ts
Rewrote mocks to provide an aggregate foundation object and added chart config exports (FOUNDATION_SPARKLINE_CHART_OPTIONS, FOUNDATION_BAR_CHART_OPTIONS), utility helpers (calculateAverage, calculateTotal), and new mock data (PROJECT_HEALTH_DISTRIBUTION, COMPANY_BUS_FACTOR, TOP_PROJECTS_BY_VALUE, AGGREGATE_FOUNDATION_METRICS). Updated imports to include new metric types.
Shared API Surface
packages/shared/src/interfaces/index.ts
Added re-export: export * from './foundation-metrics.interface'.

Sequence Diagram

sequenceDiagram
    participant User
    participant FHComponent as FoundationHealthComponent
    participant Signal as selectedFilter (signal)
    participant Computed as metricCards (computed)
    participant Template

    User->>FHComponent: Click filter pill
    FHComponent->>Signal: handleFilterChange(filter)
    Signal->>Computed: trigger recompute
    Computed-->>Template: provide filtered metricCards
    Template->>User: render carousel of metric cards

    User->>FHComponent: Click prev/next
    FHComponent->>FHComponent: scrollLeft()/scrollRight()
    FHComponent->>Template: adjust carousel scroll (carouselScroll)
    Template-->>User: animated scroll
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review focus: foundation-health.component.ts signal/computed logic and ViewChild scroll integration.
  • Verify template switch branches for each customContentType and data shapes (sparkline/bar chart props, top-projects list, bus-factor proportions, health-score distribution).
  • Check new shared interfaces and constants for type alignment with component expectations.

Possibly related PRs

Suggested labels

deploy-preview

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: refactoring the foundation health component from a table-based layout to a carousel layout.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, detailing the refactor from table to carousel layout with aggregate metrics and filtering capabilities.
Linked Issues check ✅ Passed All code changes align with LFXV2-719 objectives: carousel layout implemented, 8 metric cards created, filters added, computed signals used, and all specified files modified.
Out of Scope Changes check ✅ Passed All changes are within scope of LFXV2-719: component refactoring, new interfaces, constants updates, and styling utilities directly support the carousel and metrics display requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 feat/LFXV2-719

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the foundation health component from a table-based layout to a modern carousel layout with category-based filtering, displaying 8 aggregate metric cards across all foundations with various visualization types.

Key changes:

  • Replaced table layout with a horizontally scrollable carousel of metric cards
  • Added filter pills for categorizing metrics (All, Contributors, Projects, Events)
  • Integrated 8 metric cards with different visualizations: sparklines, bar charts, top projects list, bus factor, and health score distribution

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/shared/src/interfaces/index.ts Exports new foundation metrics interfaces
packages/shared/src/interfaces/foundation-metrics.interface.ts Defines TypeScript interfaces for metric cards, categories, and aggregate data
packages/shared/src/constants/foundation-health.constants.ts Adds chart configurations and aggregate metrics constants with mock data
apps/lfx-one/src/app/modules/dashboards/components/foundation-health/foundation-health.component.ts Refactors component to use carousel with filtering, computed signals, and direct chart integration
apps/lfx-one/src/app/modules/dashboards/components/foundation-health/foundation-health.component.scss Adds CSS class to hide scrollbars on carousel
apps/lfx-one/src/app/modules/dashboards/components/foundation-health/foundation-health.component.html Updates template from table to carousel with filter pills and navigation controls
Comments suppressed due to low confidence (1)

packages/shared/src/constants/foundation-health.constants.ts:29

  • The comment states 'mock data for 5 major foundations' but the FOUNDATION_HEALTH_DATA array only contains 1 foundation (CNCF). Either add the remaining 4 foundations or update the comment to reflect the current implementation.
 * Matches the React implementation with mock data for 5 major foundations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 71f93b6 and 07a9612.

📒 Files selected for processing (6)
  • apps/lfx-one/src/app/modules/dashboards/components/foundation-health/foundation-health.component.html (1 hunks)
  • apps/lfx-one/src/app/modules/dashboards/components/foundation-health/foundation-health.component.scss (1 hunks)
  • apps/lfx-one/src/app/modules/dashboards/components/foundation-health/foundation-health.component.ts (3 hunks)
  • packages/shared/src/constants/foundation-health.constants.ts (2 hunks)
  • packages/shared/src/interfaces/foundation-metrics.interface.ts (1 hunks)
  • packages/shared/src/interfaces/index.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
apps/lfx-one/src/app/modules/dashboards/components/foundation-health/foundation-health.component.ts (4)
apps/lfx-one/src/app/modules/dashboards/components/organization-involvement/organization-involvement.component.ts (1)
  • Component (17-416)
apps/lfx-one/src/app/shared/components/filter-pills/filter-pills.component.ts (1)
  • FilterOption (7-10)
packages/shared/src/constants/foundation-health.constants.ts (3)
  • FOUNDATION_SPARKLINE_CHART_OPTIONS (67-75)
  • FOUNDATION_BAR_CHART_OPTIONS (81-97)
  • AGGREGATE_FOUNDATION_METRICS (150-166)
packages/shared/src/interfaces/foundation-metrics.interface.ts (3)
  • FoundationMetricCard (14-48)
  • MetricCategory (8-8)
  • TopProjectDisplay (97-102)
packages/shared/src/constants/foundation-health.constants.ts (1)
packages/shared/src/interfaces/foundation-metrics.interface.ts (4)
  • ProjectHealthDistribution (54-65)
  • CompanyBusFactor (71-80)
  • TopProjectByValue (86-91)
  • AggregateFoundationMetrics (108-139)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Upload results

LFXV2-719

- Change FOUNDATION_HEALTH_DATA from array to single object
- Remove array indexing since only aggregate data is used
- Simplify Tailwind utility classes for better maintainability

Generated with [Claude Code](https://claude.ai/code)

Signed-off-by: Asitha de Silva <[email protected]>
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)
packages/shared/src/constants/foundation-health.constants.ts (1)

31-59: Consider renaming for clarity.

The export name FOUNDATION_HEALTH_DATA (plural) with singular type Foundation may cause confusion. Since this now represents a single aggregate foundation rather than an array, consider renaming to AGGREGATE_FOUNDATION_DATA or changing the type annotation to reflect its aggregate nature.

Example:

-export const FOUNDATION_HEALTH_DATA: Foundation = {
+export const AGGREGATE_FOUNDATION_DATA: Foundation = {
   id: 'aggregate',
apps/lfx-one/src/app/modules/dashboards/components/foundation-health/foundation-health.component.html (1)

73-85: Simplify padding utilities.

The padding classes can be streamlined by removing the redundant m-0 which is immediately overridden by mb-[5px].

-                  <div class="space-y-0.5 p-0 pr-5 pl-[60px] m-0 mb-[5px]">
+                  <div class="space-y-0.5 p-0 pr-5 pl-[60px] mb-[5px]">
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 07a9612 and 3ac7500.

📒 Files selected for processing (2)
  • apps/lfx-one/src/app/modules/dashboards/components/foundation-health/foundation-health.component.html (1 hunks)
  • packages/shared/src/constants/foundation-health.constants.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/shared/src/constants/foundation-health.constants.ts (2)
packages/shared/src/interfaces/dashboard.interface.ts (1)
  • Foundation (193-222)
packages/shared/src/interfaces/foundation-metrics.interface.ts (4)
  • ProjectHealthDistribution (54-65)
  • CompanyBusFactor (71-80)
  • TopProjectByValue (86-91)
  • AggregateFoundationMetrics (108-139)
🔇 Additional comments (15)
packages/shared/src/constants/foundation-health.constants.ts (6)

4-4: LGTM!

The imports are clean and all imported interfaces are appropriately used throughout the file.


13-25: LGTM!

The smooth data generator correctly implements a controlled random walk to create realistic trend data for sparklines.


100-109: LGTM!

The helper functions correctly implement average and sum calculations for metric aggregation.


65-95: LGTM!

The chart configurations are appropriate for embedded sparkline and bar chart visualizations. Disabling legends, tooltips, and axes is correct for compact metric displays.


115-142: LGTM!

The mock data constants are well-structured and the values are internally consistent (e.g., health distribution sums to 1139, bus factor percentages sum to 100%).


148-164: LGTM!

The aggregate metrics are correctly computed:

  • totalProjects properly sums the health distribution (1139)
  • totalProjectsData uses the matching base value
  • All metric calculations align with the new single aggregate foundation approach

The previous review concerns about aggregating from index [0] are now resolved by the structural change from an array to a single aggregate object.

apps/lfx-one/src/app/modules/dashboards/components/foundation-health/foundation-health.component.html (9)

5-15: LGTM!

The header layout correctly integrates the dynamic title signal and filter pills component with appropriate data attributes for testing.


18-35: LGTM!

The carousel navigation buttons are properly implemented with:

  • Explicit type="button" to prevent form submission
  • aria-label attributes for accessibility
  • Test IDs for E2E testing

39-40: LGTM!

The carousel container is well-configured with smooth scrolling, appropriate spacing, and the hide-scrollbar utility class as specified in the PR objectives.


41-48: LGTM!

The card structure correctly implements:

  • Responsive widths (mobile-first with desktop override)
  • justify-between for vertical spacing as specified in objectives
  • Dynamic test IDs and icons from card configuration

51-59: LGTM!

The sparkline chart correctly integrates ChartComponent directly without a wrapper, as specified in the PR objectives.


62-70: LGTM!

The bar chart implementation correctly uses direct ChartComponent integration with appropriate fixed dimensions for consistent metric visualization.


88-108: LGTM!

The bus factor visualization correctly implements a proportional inline bar chart using dynamic width bindings from pre-computed percentages.


111-130: LGTM!

The health score distribution correctly renders a bar chart using pre-computed display values from the healthScoreDistribution() signal, following the PR objective to remove formatting logic from templates.


134-143: LGTM!

The card footer conditionally renders pre-computed display values with appropriate styling and spacing.

@asithade asithade merged commit 58ed2b3 into main Nov 11, 2025
6 checks passed
@asithade asithade deleted the feat/LFXV2-719 branch November 11, 2025 22:48
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.

3 participants