fix(billing): Fix category display names in pending changes#109612
fix(billing): Fix category display names in pending changes#109612
Conversation
Improve getPlanCategoryName fallback to use human-readable titleName instead of raw camelCase keys (e.g. "sizeAnalyses"). Add unit suffix handling for emerge categories so size analysis displays as "Reserved size analysis change to 100 builds".
Keep the full category display name (e.g. "size analysis builds") instead of stripping the unit and re-appending it to the quantity.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| : displayNames | ||
| ? displayNames.plural | ||
| : category; | ||
| : (getCategoryInfoFromPlural(category)?.titleName?.toLowerCase() ?? category); |
There was a problem hiding this comment.
Singular/plural fallbacks use inconsistent naming fields
Low Severity
The plural fallback in getPlanCategoryName uses titleName?.toLowerCase() while the singular fallback in getSingularCategoryName uses displayName. For some categories these fields don't follow the same naming convention. For example, replays has displayName: 'replay' but titleName: t('Session Replays'), so the fallback produces singular "replay" vs plural "session replays". This inconsistency surfaces in formatCategoryQuantityWithDisplayName where quantity=1 would show "1 Replay" but quantity=2 would show "2 Session replays". A similar mismatch exists for logBytes (displayName: 'log byte' vs titleName: t('Logs')).
Additional Locations (1)
…ept-encoding * origin/master: (63 commits) fix(api): Add missing cursor query parameter to paginated endpoint OpenAPI schemas (#109642) docs(sentry-apps): Add sentryAppId to sentry-app-installations API schema (#109628) feat(occurrences on eap): Implement double reads from EAP in organization events trace API endpoint (#109391) feat(occurrences on eap): Implement double reads from EAP for reprocessing2 flow (#109345) feat(ci): report backend test fails (#109543) feat(seer): Add signed viewer context header to Seer API requests (#109626) devenv: cleanup devenv-managed uv (#109617) feat(seer): Iterate on the instructions at the top of seer settings pages (#109586) ref(seer): Add typed wrappers for remaining Seer API callsites (#109607) feat(preprod): Make snapshots endpoint org scoped (#109575) chore: capture exception (#109620) fix(formatting): run ruff format (#109618) feat(preprod): Create admin gated recompare snapshots endpoint (#109546) feat(cells): expand locality/cell distinction (#109538) feat(cells): add db migration for synapse (#109615) feat(preprod): Add public install-details endpoint and shared utilities (#109583) fix(tests): Fix flaky test_cross_trace_query_with_spans_and_logs (#109572) fix(grouping): Resolve mypy possibly-undefined errors in grouphash caching (#109602) fix(dashboards): Default axisRange to auto for existing widgets in builder (#109598) fix(billing): Fix category display names in pending changes (#109612) ...


Summary
getPlanCategoryNameandgetSingularCategoryNamefallback to use human-readabletitleName/displayNamefromDATA_CATEGORY_INFOinstead of raw camelCase category keys (e.g.sizeAnalyses) whencategoryDisplayNamesis missing from the plan/settings/billing/overview/and_adminshowing raw keys like "Reserved sizeAnalyses change to 100" instead of "Reserved size analysis builds change to 100"categoryDisplayNamesdoesn't include a category, e.g. due to feature flag gating (organizations:expose-category-size-analysis)Test plan
pendingChanges.spec.tsx— 22 tests pass)gsAdmin/pendingChanges.spec.tsx— 13 tests pass)spansIndexed→stored spans,replays→session replays)