Skip to content

feat: add neutral trend state and reusable trend metric component (NSOC'26) #147

Description

@SrashtiChauhan

NSOC'26

Description

The Sprint Comparison section currently calculates and displays percentage changes for Completed Tasks and Reviews. However:

  • Trend display logic is duplicated across multiple metric cards.
  • Neutral trends (0% change) are not visually distinguished beyond the icon.
  • The comparison card is not reusable for future analytics metrics.

Proposed Improvements

1. Create a Reusable Component

Create:

frontend/app/components/analytics-comp/TrendMetricCard.tsx

Props:

type TrendMetricCardProps = {
  label: string;
  current: number;
  previous: number;
};

2. Move Trend Logic Into Component

Calculate:

  • Difference
  • Percentage
  • Trend Icon
  • Color State

inside the component.

3. Improve Neutral State

Display:

● 0 (0.0%)

using a neutral gray color instead of green.

4. Replace Existing Cards

Replace:

Completed Tasks
Reviews

with reusable TrendMetricCard instances.

Expected Outcome

  • Cleaner code
  • Reduced duplication
  • Easier future expansion
  • Better maintainability

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions