Guide seat count confirmation before showing billing preview#121
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
refactor: share seat count helpersfeat: review licensed seats before estimatesfix: address seat count review feedbackTesting
npm run buildnpm run lintnpm testChecklist
npm run lint)