Skip to content

Guide seat count confirmation before showing billing preview#121

Merged
asizikov merged 3 commits into
mainfrom
asizikov/import-pr-7-commits
May 21, 2026
Merged

Guide seat count confirmation before showing billing preview#121
asizikov merged 3 commits into
mainfrom
asizikov/import-pr-7-commits

Conversation

@asizikov

@asizikov asizikov commented May 21, 2026

Copy link
Copy Markdown
Member

Summary

Organization usage CSVs can omit licensed users who had no billable activity during the report period, which can make the first billing preview less accurate. This PR adds a guided confirmation step so users can review seat counts before seeing the billing preview.

Changes

Commit Change
refactor: share seat count helpers Extracts reusable seat count normalization and validation helpers, with unit coverage for preserving historical minimum counts.
feat: review licensed seats before estimates Adds an initial seat count confirmation step after organization reports are processed, applies confirmed seat counts to included AI Credits calculations, and links users back to adjust counts later.
fix: address seat count review feedback Handles whitespace-only seat count input consistently and clears stale recalculation errors before retrying.
  • Shows a "Review licensed seat counts" screen before the main report for organization-scoped uploads.
  • Adds an Overview action to adjust seat counts from the Users section.

Testing

  • npm run build
  • npm run lint
  • npm test

Checklist

  • Specs lint passes (npm run lint)
  • Tests updated if applicable
  • Documentation updated if applicable

xrvk and others added 2 commits May 21, 2026 21:20
Co-authored-by: Anton Sizikov <asizikov@github.com>

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Anton Sizikov <asizikov@github.com>

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 21, 2026 19:40

Copilot AI left a comment

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.

Pull request overview

This PR adds a guided “Review licensed seat counts” step for organization-scoped uploads so users can confirm/adjust Copilot Business & Enterprise seat totals before seeing billing estimates, improving included AI Credits calculations when CSVs omit inactive licensed users.

Changes:

  • Introduces shared seat-count parsing/normalization + validation helpers with unit tests.
  • Adds a new SeatCountConfirmation screen gated to organization-scoped reports and wires confirmed counts into recalculation.
  • Adds an Overview CTA to jump to the Users view to adjust seat counts later.
Show a summary per file
File Description
src/App.tsx Adds seat confirmation flow/state, applies confirmed seat overrides, and exposes “adjust seat counts” navigation.
src/components/SeatCountConfirmation.tsx New UI screen to review/confirm licensed seat counts before showing estimates.
src/utils/seatCounts.ts New shared helpers for seat normalization/parsing and reduction validation messaging.
src/utils/seatCounts.test.ts Unit tests for the shared seat-count helpers.
src/views/UsersView.tsx Refactors to use shared seat-count helpers when saving overrides.
src/views/OverviewView.tsx Plumbs optional “adjust seat counts” callback into totals UI.
src/components/ui/BillingTotalsCards.tsx Adds optional “adjust seat counts” action and updates explanatory copy.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (1)

src/utils/seatCounts.test.ts:16

  • Consider adding a regression assertion that whitespace-only input does not trigger a reduction error (e.g. ' '), since Number(' ') becomes 0 and can otherwise incorrectly fail validation.
    expect(getSeatReductionError('', 10)).toBeNull()
    expect(getSeatReductionError('10', 10)).toBeNull()
    expect(getSeatReductionError('12', 10)).toBeNull()
    expect(getSeatReductionError('8', 10)).toBe('Cannot go below 10 because that count comes from historical report data.')
  • Files reviewed: 7/7 changed files
  • Comments generated: 4

Comment thread src/utils/seatCounts.ts
Comment thread src/utils/seatCounts.test.ts
Comment thread src/components/ui/BillingTotalsCards.tsx
Comment thread src/App.tsx
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@asizikov asizikov merged commit 3a96213 into main May 21, 2026
9 checks passed
@asizikov asizikov deleted the asizikov/import-pr-7-commits branch May 21, 2026 19:57
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.

3 participants