Skip to content

Billing aggregate tiles lack tooltips and use an inconsistent "credits" definition vs. the per-user column #421

Description

@muminkoykiran

Describe the bug

Two related problems on the Billing (per-user credits) view:

  1. No tooltips / no source explanation. The three aggregate tiles — "Total credits", "Gross cost (USD)", "Net cost (USD)" — carry only a plain caption with no explanation of source, gross-vs-net meaning, or time window. This is inconsistent with the My Usage page, which documents the exact same concepts carefully with mdi-information-outline tooltips and a tab-level info alert.

  2. "Credits" is computed two different ways on the same screen. The "Total credits" tile sums grossQuantity, whereas the per-user "Credits" column sums netQuantity + discountQuantity. On discounted plans these two definitions diverge, so the tile total and the sum of the per-user column disagree, with nothing in the UI explaining why.

Environment

  • copilot-metrics-viewer v3.11.3
  • Enterprise scope, per-user billing (CSV export ingested), admin-gated Billing tab
  • Reproducible on plans with per-credit discounts (gross ≠ net)

Steps to reproduce

  1. Open the Billing tab as an admin on an enterprise with discounted credit pricing.
  2. Note the "Total credits" tile value.
  3. Load per-user rows and sum the "Credits" column.
  4. Observe the two totals do not reconcile; hover the tiles and note there is no tooltip explaining the difference.

Expected behavior

  • Each aggregate tile explains its source, gross/net meaning, and time window (mirroring My Usage).
  • "Credits" means the same thing in the tile and in the per-user column, or the two are relabeled so the difference is explicit.

Actual behavior

  • Tiles have no tooltips or explanatory text.
  • The tile "credits" (gross quantity) and the per-user "credits" (net + discount quantity) silently disagree on discounted plans.

Root cause (code references)

  • app/components/BillingCreditsViewer.vue:114-135 — the three tiles are plain v-card captions with no tooltip.
  • app/components/BillingCreditsViewer.vue:511-512 — "Total credits" tile is SUM(grossQuantity):
const totalGrossQty = computed(() =>
  items.value.reduce((s, i) => s + (i.grossQuantity || 0), 0)
);
  • app/components/BillingCreditsViewer.vue:455-456 — per-user "Credits" column is netQuantity + discountQuantity:
prev.credits += Number.isFinite(it.netQuantity) ? it.netQuantity : 0;
prev.credits += Number.isFinite(it.discountQuantity) ? it.discountQuantity : 0;
  • app/components/MyUsageViewer.vue:73-88 (tab-level "two sources" info alert) and :131-141 (per-tile mdi-information-outline tooltip) — the well-documented pattern this view should mirror.

Suggested fix

  • Add info tooltips to the three billing tiles describing source (Billing API / CSV export), gross-vs-net, and the applicable time window, mirroring MyUsageViewer.vue.
  • Reconcile the two "credits" definitions, or relabel them explicitly (e.g. "Gross credits" on the tile vs. "Net credits" on the per-user column) so tile and table no longer appear contradictory on discounted plans.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions