Skip to content

Fix StatusChart color mapping for "completed" tasks #34

@dereknex

Description

@dereknex

Description

The StatusChart component incorrectly renders feedback items marked as completed using a fallback gray color, rather than the expected resolved color (green). This visual discrepancy makes the chart appear disconnected from the real data state.

Technical Details

  • File: components/dashboard/status-chart.tsx
  • Root Cause: The normalizeStatus function lacks a mapping for the completed status returned by the database. The STATUS_COLORS object only expects new, in-progress, resolved, or closed.
  • Impact: completed tasks fall through to the default color.

Proposed Fix

Update components/dashboard/status-chart.tsx to map completed to resolved:

const normalizeStatus = (status: string) => {
  if (status === "in_progress") return "in-progress";
  if (status === "completed") return "resolved"; // Added mapping
  return status;
};

Reproduction

  1. Create a feedback item with status completed.
  2. View the Dashboard.
  3. Observe the Status Chart slice for this item is gray instead of the expected color.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions