Skip to content

Conversation

@Brendonovich
Copy link
Contributor

@Brendonovich Brendonovich commented Nov 6, 2025

Summary by CodeRabbit

  • Refactor
    • Streamlined invite dialog code structure for improved maintainability.
    • Enhanced seat quota calculation and management logic.
    • Updated seat purchase button visibility controls based on environment configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 6, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Three component and utility files refactored: removed a helper function indirection in the invite dialog, added a feature-flag gate to conditionally render the "Purchase more seats" button in the members card, and expanded the calculateSeats utility to return additional seat-related metrics based on a feature flag.

Changes

Cohort / File(s) Summary
Invite Dialog Simplification
apps/web/app/(org)/dashboard/settings/organization/components/InviteDialog.tsx
Removed local helper function handleSendInvites and replaced its usage with direct inline call to sendInvites.mutate() in button's onClick handler
Feature-Flagged Purchase Button
apps/web/app/(org)/dashboard/settings/organization/components/MembersCard.tsx
Added buildEnv import; wrapped "Purchase more seats" button UI (Tooltip + Button) in conditional check for buildEnv.NEXT_PUBLIC_IS_CAP to conditionally render the billing action
Expanded Seat Calculation Logic
apps/web/utils/organization.ts
Added buildEnv import; changed remainingSeats calculation to conditionally cap seats based on buildEnv.NEXT_PUBLIC_IS_CAP flag; expanded calculateSeats() return payload to include memberCount, pendingInvitesCount, totalUsedSeats, and remainingSeats

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify that all callers of calculateSeats() handle the expanded return object correctly
  • Confirm feature flag NEXT_PUBLIC_IS_CAP is correctly defined and expected to control seat limitation behavior

Poem

🐰 A helper bid farewell today,
As flags now guard the billing way,
Seats expand their dataset true,
Simpler code, and features too!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove-invite-limits-docker

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b5656b4 and 019fcfd.

📒 Files selected for processing (3)
  • apps/web/app/(org)/dashboard/settings/organization/components/InviteDialog.tsx (1 hunks)
  • apps/web/app/(org)/dashboard/settings/organization/components/MembersCard.tsx (2 hunks)
  • apps/web/utils/organization.ts (2 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Brendonovich Brendonovich merged commit 9bd60ec into main Nov 6, 2025
15 of 16 checks passed
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