Validate reduced report seat counts#102
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.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 inline validation to prevent users from saving Copilot Business/Enterprise seat overrides below the uploaded report counts, and introduces a reusable portal-based popover component to display the resulting validation feedback.
Changes:
- Add a
ValidationPopovercomponent (danger tone) and extendInfoTipwith tone styling. - Validate edited seat counts against report-derived minimums, show inline error popovers, and disable Save when invalid.
- Adjust the seat-count table layout (fixed table + column widths) and simplify helper copy.
Show a summary per file
| File | Description |
|---|---|
src/views/UsersView.tsx |
Adds reduced-seat validation, inline error styling/popovers, and disables Save when edits go below report values. |
src/components/InfoTip.tsx |
Adds tone support to InfoTip and introduces a reusable ValidationPopover using a portal + positioning logic. |
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/components/InfoTip.tsx:168
- This effect registers
updatePositionas an event handler but omits it from the dependency list. To avoidreact-hooks/exhaustive-depswarnings and ensure the handler is always up-to-date, makeupdatePositionstable (e.g.,useCallback) and include it in the deps so listeners are re-bound when needed.
useEffect(() => {
if (!open) return
window.addEventListener('resize', updatePosition)
document.addEventListener('scroll', updatePosition, true)
return () => {
window.removeEventListener('resize', updatePosition)
document.removeEventListener('scroll', updatePosition, true)
}
}, [open])
- Files reviewed: 2/2 changed files
- Comments generated: 2
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.
Users can add missing Business or Enterprise counts for billing estimates, but lowering counts below the uploaded report would imply modifying historical data. This adds immediate validation feedback so those invalid edits are visible and cannot be saved.
Summary
feat: add validation popoverfix: validate reduced report seat countsfix: share popover positioning logicValidation
npm run lintnpm run testnpm run build