Skip to content

fix(billing): Fix category display names in pending changes#109612

Merged
dashed merged 2 commits intomasterfrom
fix/pending-changes-category-display-names
Feb 27, 2026
Merged

fix(billing): Fix category display names in pending changes#109612
dashed merged 2 commits intomasterfrom
fix/pending-changes-category-display-names

Conversation

@dashed
Copy link
Copy Markdown
Member

@dashed dashed commented Feb 27, 2026

Summary

  • Fix getPlanCategoryName and getSingularCategoryName fallback to use human-readable titleName/displayName from DATA_CATEGORY_INFO instead of raw camelCase category keys (e.g. sizeAnalyses) when categoryDisplayNames is missing from the plan
  • This fixes the pending changes display on both /settings/billing/overview/ and _admin showing raw keys like "Reserved sizeAnalyses change to 100" instead of "Reserved size analysis builds change to 100"
  • The fallback is triggered when categoryDisplayNames doesn't include a category, e.g. due to feature flag gating (organizations:expose-category-size-analysis)

Test plan

  • Added test for size analysis pending changes in billing overview (pendingChanges.spec.tsx — 22 tests pass)
  • Added test for size analysis pending changes in admin view (gsAdmin/pendingChanges.spec.tsx — 13 tests pass)
  • Updated existing admin test assertions that previously expected raw category keys (spansIndexedstored spans, replayssession replays)

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.
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 27, 2026
@dashed dashed marked this pull request as ready for review February 27, 2026 21:04
@dashed dashed requested a review from a team as a code owner February 27, 2026 21:04
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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);
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.

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)

Fix in Cursor Fix in Web

@dashed dashed merged commit 1b2028b into master Feb 27, 2026
61 checks passed
@dashed dashed deleted the fix/pending-changes-category-display-names branch February 27, 2026 21:17
jan-auer added a commit that referenced this pull request Mar 2, 2026
…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)
  ...
@github-actions github-actions bot locked and limited conversation to collaborators Mar 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants