Repository navigation
fix(shopping): display labels instead of raw select values - #397
Conversation
gkhngyk
left a comment
There was a problem hiding this comment.
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.
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 timeinstead ofallLast 30dinstead of30dUpdated the Platform select to display
All platformsinstead ofall.Updated the Region select to display
All regionsinstead ofall.Kept the existing dropdown options and behavior unchanged.
Testing
/dashboard/shopping).Closes #396.