Skip to content

fix(content): filter selects show the raw value instead of the label after selecting #364

Closed

Description

@gkhngyk

Problem

On the Content Optimization page (/dashboard/content), the filter dropdowns — Status, Impact, and Type — show the raw value (e.g. in_progress, high, owned) instead of the human-readable label (e.g. "In Progress", "High", "Owned") once an option is selected. The label shows correctly inside the open dropdown, but the closed trigger falls back to the value.

This is the same class of bug already fixed on the Citations page's competitor selector (#328 / #344).

Root cause (from the code)

In web/src/app/[locale]/(dashboard)/dashboard/content/page.tsx, all three filter selects render a bare <SelectValue /> with no render function, so the trigger displays the selected value rather than the matching SelectItem label:

<Select value={statusFilter} onValueChange={(v) => v && setStatusFilter(v)}>
  <SelectTrigger className="h-8 w-[130px] text-xs">
    <SelectValue />            {/* ← shows the raw value, e.g. "in_progress" */}
  </SelectTrigger>
  <SelectContent>
    <SelectItem value="all">{t('filters.allStatuses')}</SelectItem>
    <SelectItem value="new">{t('status.new')}</SelectItem>
    ...

The Impact and Type selects have the same <SelectValue /> (values high/medium/low and owned/earned).

Proposed change

Give each <SelectValue> a render function that maps the selected value to its label — the same pattern the Citations page already uses for its Topics/Platforms selects (see citations/page.tsx, where <SelectValue placeholder="…">{(value) => …}</SelectValue>).

For each filter, map the value to the same t(...) label used by the SelectItem, e.g.:

<SelectValue>
  {(v) =>
    v === 'all' ? t('filters.allStatuses') : t(`status.${v}`)
  }
</SelectValue>

(and analogously t('filters.allImpacts') / t(\impact.${v}`), t('filters.allTypes')/t(`type.${v}`)`).

How to test

  1. /dashboard/content → pick a Status (e.g. "In Progress") → the trigger shows "In Progress", not in_progress.
  2. Same for Impact ("High", not high) and Type ("Owned", not owned).
  3. The "All …" default option still shows its label.

Notes

Activity

  1. added
    bug
    good first issue
    help wanted
    on Jul 7, 2026
  2. Sam-syntax35 commented on Jul 7, 2026

    @Sam-syntax35
    Contributor

    i really read all the documentation ! and so far i am enjoying contributing on this project. could you please assign this to me

  3. gkhngyk commented on Jul 7, 2026

    @gkhngyk
    ContributorAuthor

    Thanks @Sam-syntax35 — assigned to you (you've already got PR #368 open for it). The select fix itself looks great; it just needs the stray web/diff.txt removed per the review, then it's good to merge. 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggood first issuehelp wanted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions