Skip to content

Show all invoices in the history table, paginated#2006

Closed
GregorShear wants to merge 1 commit into
greg/billing-receiptsfrom
greg/billing-history-pagination
Closed

Show all invoices in the history table, paginated#2006
GregorShear wants to merge 1 commit into
greg/billing-receiptsfrom
greg/billing-history-pagination

Conversation

@GregorShear

Copy link
Copy Markdown
Contributor

What

Show all of a tenant's invoices in the Recent History table, paginated, instead of just the 4 most recent (PRD #2).

Why

The table was hard-capped at slice(0, 4) over the rolling six-month window — a placeholder. Users couldn't reach older invoices (or out-of-window finals) at all.

Changes

  • useBillingInvoices now exposes allInvoices (the full newest-first list) alongside invoices (the windowed + manual subset the usage graphs chart). selectedInvoice resolves against the full list, so any row — including out-of-window invoices — is selectable.
  • BillingHistoryTable paginates allInvoices four per page using MUI TablePagination + the shared TablePaginationActions, and resets to the first (newest) page when the tenant changes. Rows no longer slices.
  • The usage graphs and GraphStateWrapper still read the windowed invoices, so they stay a six-month view — the table showing all history doesn't change the charts.

Verification

Locally against a tenant with 5 invoices (final / preview / manual, including two out-of-window): the table paginates 4-per-page (1–4 of 55–5 of 5), surfacing the Oct 2025 final and Sep 2025 manual that the old windowed view hid; first/prev/next/last work; the pager fits the fixed-height card; and the Usage by Month graph is unchanged (Apr/May/Jun only). No console errors.

Note: the fetch is capped at 100 invoices; true cursor pagination beyond that is a later step.

Stacked on greg/billing-invoices-gql (#2004) — independent of the receipts PR (#2005).

@GregorShear GregorShear requested a review from a team as a code owner June 16, 2026 17:22
The Recent History table was hard-capped at the 4 most recent invoices
within the rolling six-month window (a slice(0, 4) placeholder). Show all
of a tenant's invoices instead, paginated four per page (PRD #2).

- useBillingInvoices now exposes allInvoices (the full newest-first list)
  alongside invoices (the windowed+manual subset the usage graphs chart).
  selectedInvoice resolves against the full list, so any row is clickable.
- BillingHistoryTable paginates allInvoices with MUI TablePagination +
  the shared TablePaginationActions, resetting to the first page when the
  tenant changes. Rows no longer slices.

The usage graphs and graph-state wrapper still read the windowed
invoices, so they remain a six-month view. Fetch is capped at 100
invoices; true cursor pagination beyond that is a later step.
@GregorShear GregorShear force-pushed the greg/billing-history-pagination branch from 685358e to 57abd8c Compare June 16, 2026 18:10
@GregorShear GregorShear changed the base branch from greg/billing-invoices-gql to greg/billing-receipts June 16, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant