Skip to content

fix(insights): CSV export writes platform slugs instead of display names #187

Closed

Description

@gkhngyk

Summary

On the Answer Engine Insights page (/dashboard/insights), the Export CSV
button produces a file whose platform column contains raw platform slugs
(e.g. chatgpt, gemini, google-ai-mode) instead of the human-readable
display names that the UI already shows everywhere else (e.g. ChatGPT,
Gemini, Google AI Mode).

Steps to reproduce

  1. Open /dashboard/insights for any brand with results.
  2. Click Export CSV.
  3. Open the downloaded file and look at the platform column.

Expected: display names (e.g. ChatGPT).
Actual: slugs (e.g. chatgpt).

Root cause

A platform-label map already exists, but it lives locally inside the charts
component and is not shared, so the CSV export can't reach it:

Suggested fix

Move PLATFORM_LABELS to a shared module (e.g. under web/src/config/) and
use it in both places, so the chart labels and the CSV stay in sync:

platform: PLATFORM_LABELS[r.platform] ?? r.platform,

Falling back to the raw slug when a label is missing keeps unknown platforms
from disappearing. Please keep the existing labels intact and just centralize
the map rather than duplicating it.

Activity

  1. added
    bug
    good first issue
    on Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions