Skip to content

fix(shopping): display labels instead of raw select values - #397

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
Sam-syntax35:fix/shopping-select-display-labels
Jul 10, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
Sam-syntax35:fix/shopping-select-display-labels

Conversation

@Sam-syntax35

Copy link
Copy Markdown
Contributor

Summary

Fixes the Shopping filter selects so the closed trigger displays the human-readable label instead of the raw value.

Changes

  • Updated the Date range select to display labels such as:

    • All time instead of all
    • Last 30d instead of 30d
  • Updated the Platform select to display All platforms instead of all.

  • Updated the Region select to display All regions instead of all.

  • Kept the existing dropdown options and behavior unchanged.

Testing

  • Verified the Shopping page (/dashboard/shopping).
  • Confirmed that selecting different values updates the closed trigger with the correct display label.
  • Confirmed the dropdown items continue to render and function as expected.

Closes #396.

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clean fix — and welcome! This goes a step beyond the issue's suggestion in a good way: reusing the canonical PLATFORM_LABELS map and the formatRegionDisplay helper keeps the trigger and the dropdown items consistent with the rest of the app.

One small, non-blocking suggestion: the value→label logic is now duplicated between each trigger's SelectValue children function and the corresponding SelectItem rendering (e.g. PLATFORM_LABELS[p] ?? p appears in both). If one side changes later, the other is easy to miss. Extracting tiny local helpers in FilterBar would remove that drift risk:

const dateLabel = (v: string) => (v === 'all' ? 'All time' : `Last ${v}`);
const platformLabel = (v: string) => (v === 'all' ? 'All platforms' : (PLATFORM_LABELS[v] ?? v));
const regionOptionLabel = (v: string) => (v === 'all' ? 'All regions' : formatRegionDisplay(v));

…and using them in both the trigger and the items. Feel free to do it here or leave it as-is — approving either way.

@gkhngyk
gkhngyk merged commit 18a231a into ansvisor:main Jul 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: shopping filter selects show raw value instead of display label (e.g. "30d" instead of "Last 30d")

2 participants