Skip to content

i18n & hardcoded strings cleanup for Dashboard components #2313

@Abhishek-Punhani

Description

@Abhishek-Punhani

Summary

The Dashboard and StatCard implementations contain multiple hardcoded strings and title-based logic that prevent reuse and break internationalisation. This parent issue tracks the extraction of components, removal of hardcoded string checks, and migration of UI text to the app's i18n system.

Impact

  • StatCard uses title string comparisons to choose decorative indicators (e.g., "Total Clusters", "Active Clusters"), which is brittle and not i18n-safe.
  • User-facing strings like increase / decrease / change are hardcoded in English.
  • Reuse of StatCard in PluginManager and elsewhere fails to display indicators or translations.

Files of interest

  • frontend/src/components/dashboard/StatCard.tsx
  • frontend/src/pages/Dashboard.tsx
  • frontend/src/pages/PluginManager.tsx

Goals

  1. Extract reusable subcomponents in Dashboard.tsx into dedicated modules where appropriate (e.g., indicators, sparkline/trend visuals, context badge).
  2. Remove hardcoded title-based behaviour; provide explicit props (indicator, indicatorKey, titleKey) instead.
  3. Internationalise all user-facing strings used by StatCard and related Dashboard components.
  4. Add unit and integration tests to prevent regressions.

cc @btwshivam

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions