Skip to content

Validate reduced report seat counts#102

Merged
asizikov merged 3 commits into
mainfrom
asizikov/seat-validation
May 15, 2026
Merged

Validate reduced report seat counts#102
asizikov merged 3 commits into
mainfrom
asizikov/seat-validation

Conversation

@asizikov

@asizikov asizikov commented May 15, 2026

Copy link
Copy Markdown
Member

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

Commit Change
feat: add validation popover Adds a reusable portal-based validation popover with danger styling for inline form feedback.
fix: validate reduced report seat counts Highlights invalid seat count fields, shows the historical-data explanation automatically, disables Save, and simplifies the helper copy.
fix: share popover positioning logic Addresses review feedback by sharing popover positioning and listener setup between InfoTip and validation popovers.

Validation

  • npm run lint
  • npm run test
  • npm run build

asizikov and others added 2 commits May 15, 2026 21:29
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 15, 2026 19:30

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 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 ValidationPopover component (danger tone) and extend InfoTip with 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 updatePosition as an event handler but omits it from the dependency list. To avoid react-hooks/exhaustive-deps warnings and ensure the handler is always up-to-date, make updatePosition stable (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

Comment thread src/components/InfoTip.tsx Outdated
Comment thread src/components/InfoTip.tsx Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@asizikov asizikov merged commit cb856d9 into main May 15, 2026
9 checks passed
@asizikov asizikov deleted the asizikov/seat-validation branch May 15, 2026 19:38
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.

2 participants