fix(billing): use addon name from API instead of hardcoded label map#3059
Conversation
The plan summary table used a hardcoded `addon_<key> -> label` lookup to render addon line items, with a fallback that called every unknown addon an "overage". Switch to reading `addon.name` from the API response, which the aggregation endpoint now populates from the addon catalog. The hardcoded map stays as a fallback for older cloud builds that don't yet send `addon.name`, and a plain resourceId is the final fallback in place of the misleading "overage (N)" string. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR fixes the billing plan summary to display addon names from the API response (
Confidence Score: 5/5Safe to merge — the change is a single-file, three-line label-resolution update with a well-structured fallback chain that preserves existing behaviour before the cloud rollout lands. The fallback chain (addon.name → hardcoded map → raw resourceId) is correct at every rollout stage: before the cloud change ships, addon.name is absent so the hardcoded map keeps HIPAA BAA rendering correctly; after it ships, the API name takes over. The switch from ?? to || is appropriate since an empty-string name from the API should fall through rather than render a blank label. No logic outside the label ternary is touched, and planSummaryOld.svelte does not have a parallel addon-naming path that would need the same fix. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "fix(billing): use addon name from API in..." | Re-trigger Greptile |
Summary
The plan summary table on the billing page used a hardcoded
addon_<key> → labelmap to render addon line items, with a fallback that labelled every unknown addon as an "overage" — e.g.addon_baa overage (1)for any addon not in the map, which was both wrong terminology (addons are not overages) and missing the friendly name.Switch to reading
addon.namefrom the API response. The aggregation endpoint now populates this field from the cloud's addon catalog, so the console no longer needs to maintain a parallel name registry.The hardcoded map is kept as a fallback for older cloud builds during the rollout window; a plain
resourceIdis the final fallback in place of the misleadingoverage (N)string.Related cloud change
The companion cloud change populates
name,rate,descon eachaddon_*entry in the aggregationresourcesmap. This console PR should ship after that cloud change reaches production; before then, the fallback map keeps the existing addons rendering correctly.Test plan
backup_recovery) renders its catalog name instead ofaddon_<key> overage (N)resourceId(no "overage")🤖 Generated with Claude Code