Skip to content

Conversation

@mfts
Copy link
Owner

@mfts mfts commented Nov 26, 2025

Summary by CodeRabbit

Release Notes

  • New Features

    • Two-column layout for invitation modal with live email preview on larger screens.
    • Recipient preview displays first two names with "+N more" indicator for concise viewing.
    • Character count indicator added for custom message field.
  • Improvements

    • Send button now displays exact invitation count (e.g., "Send 2 invitations").
    • Enhanced form validation with error notifications for invalid email addresses.
    • Improved recipient messaging to reflect user edits versus default recipients.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Nov 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
papermark Ready Ready Preview Comment Nov 26, 2025 6:10pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 26, 2025

Walkthrough

The InviteViewersModal component was restructured to implement a two-column layout with improved recipient handling and email preview logic. Key changes include derived recipient state management, enhanced form validation, updated Send button behavior with dynamic labeling, and reorganized UI layout separating input controls from email preview. The public API signature remains unchanged.

Changes

Cohort / File(s) Summary
Recipient Handling and Layout Redesign
ee/features/dataroom-invitations/components/invite-viewers-modal.tsx
Added derived recipient state (currentRecipients) that resolves based on manual edits vs. defaults; implemented two-column responsive grid layout with left panel for inputs and right panel for email preview. Recipient count and display logic now shows first two recipients with "+N more" indicator. Expanded email preview with compact recipient display. Updated Send button to disable when loading or recipientCount is 0, and label now shows exact invitation count (e.g., "Send 2 invitations"). Enhanced form validation to detect invalid emails in parsedEmails and trigger toast errors. Updated invitation payload construction and improved contextual messaging based on default vs. user-edited state.

Pre-merge checks

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'feat: update email sending' is vague and overly broad. While email sending is involved, the actual changes center on restructuring the invite viewers modal UI (two-column layout), enhancing recipient handling logic, and improving the invitation preview experience—not just email sending. Consider a more specific title like 'feat: redesign invite viewers modal with two-column layout and enhanced recipient handling' to accurately reflect the substantial structural and logic changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
ee/features/dataroom-invitations/components/invite-viewers-modal.tsx (1)

280-447: Approve the layout restructure with an optional accessibility suggestion.

The two-column layout with live email preview is a significant UX improvement. The responsive design properly hides the preview on small screens, and the character count indicator (line 326) provides helpful feedback.

Optional: Consider using label elements for better accessibility.

Lines 290, 313, and 331 use <span> for field labels. While the current implementation works, using proper <label> elements would improve accessibility:

For example, at line 313-314:

-              <span className="text-sm font-medium text-muted-foreground">
-                Custom message
-              </span>
+              <label htmlFor="custom-message" className="text-sm font-medium text-muted-foreground">
+                Custom message
+              </label>
               <Textarea
+                id="custom-message"
                 value={customMessage}

Similar changes could be applied to the other form fields.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f13e8d and 7e32de2.

📒 Files selected for processing (1)
  • ee/features/dataroom-invitations/components/invite-viewers-modal.tsx (5 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
ee/features/dataroom-invitations/components/invite-viewers-modal.tsx (2)
components/ui/dialog.tsx (3)
  • DialogContent (151-151)
  • DialogHeader (152-152)
  • DialogTitle (154-154)
components/ui/select.tsx (5)
  • Select (151-151)
  • SelectTrigger (154-154)
  • SelectValue (153-153)
  • SelectContent (155-155)
  • SelectItem (157-157)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
ee/features/dataroom-invitations/components/invite-viewers-modal.tsx (3)

47-56: LGTM: Clean email parsing logic.

The function correctly handles multiple input formats (comma-separated, newline-separated, or mixed) and deduplicates emails using a Set.


169-178: Good: Clear derived state for recipient handling.

The logic correctly derives recipient state for UI display, with proper handling of edited vs. default recipients. The displayRecipients and remainingCount calculations provide good UX for showing recipient lists.


462-470: Good: Clear button state and dynamic labeling.

The disabled logic properly prevents sending when no recipients are present or (for group invitations) when no link is selected. The dynamic button label provides clear feedback about how many invitations will be sent.

Note: This logic will work correctly once the critical issue in lines 197-199 is resolved.

Comment on lines 197 to +199
const parsedEmails = hasEditedRecipients
? parseRecipientInput(recipientInput)
: [];
: defaultRecipients;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Inconsistent recipient logic between UI and send handler.

Lines 197-199 compute parsedEmails differently than currentRecipients (lines 169-172). The UI checks both hasEditedRecipients && recipientInput.length > 0, but the send handler only checks hasEditedRecipients.

Scenario:

  1. User edits recipients (sets hasEditedRecipients = true)
  2. User clears all input text
  3. UI shows default recipients with "Send N invitations" button enabled
  4. Clicking Send would invoke parseRecipientInput("")[], sending 0 invitations

Apply this diff to align the logic:

-    const parsedEmails = hasEditedRecipients
+    const parsedEmails = hasEditedRecipients && recipientInput.length > 0
       ? parseRecipientInput(recipientInput)
       : defaultRecipients;
🤖 Prompt for AI Agents
In ee/features/dataroom-invitations/components/invite-viewers-modal.tsx around
lines 197-199 (and note currentRecipients logic at 169-172), update the
parsedEmails computation to match the UI check by requiring both
hasEditedRecipients and a non-empty recipientInput (e.g.
recipientInput.trim().length > 0) before calling parseRecipientInput; otherwise
fall back to defaultRecipients — this ensures clearing the input yields
defaultRecipients in both the UI and the send handler and prevents sending zero
invitations.

@mfts mfts merged commit 76d4962 into main Nov 27, 2025
9 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants