Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe changes introduce support for selecting a "From" email address in the email composer by adding an aliases dropdown. The Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CreateEmail
participant EmailComposer
User->>CreateEmail: Open compose email
CreateEmail->>EmailComposer: Render with aliases prop
User->>EmailComposer: Select "From" email alias
EmailComposer->>EmailComposer: Update form state (fromEmail)
User->>EmailComposer: Compose and send email
EmailComposer->>CreateEmail: Call onSendEmail with fromEmail and other data
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/mail/components/create/email-composer.tsx (1)
928-928: Verify styling consistency.The addition of
border-bclass to the subject container should be consistent with the overall design. Ensure this doesn't create visual inconsistencies.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.gitignore(1 hunks)apps/mail/components/create/create-email.tsx(1 hunks)apps/mail/components/create/email-composer.tsx(8 hunks)apps/mail/components/mail/reply-composer.tsx(1 hunks)
🔇 Additional comments (8)
.gitignore (1)
60-62: LGTM!Adding
tools.jsonto.gitignoreis appropriate for excluding development tool configurations from version control.apps/mail/components/create/email-composer.tsx (6)
10-16: LGTM!The import statements for the Select components are properly structured and follow the existing import patterns in the file.
57-62: LGTM!The new props are well-defined with appropriate TypeScript interfaces. The
aliasesprop structure withname, andprimaryfields provides good flexibility for displaying alias information.Also applies to: 70-70
108-110: LGTM!The destructuring of the new props with appropriate default values is correctly implemented.
181-181: LGTM!The default value logic for
fromEmailcorrectly prioritizes the primary alias first, then falls back to the first alias, providing a sensible user experience.
265-265: LGTM!The form field watching and data passing to the
onSendEmailcallback are correctly implemented.Also applies to: 323-323
952-980: LGTM! Well-implemented alias selection UI.The conditional rendering logic is correct - the "From" selector only appears when:
- Aliases are available (
aliases.length > 0)- Not in reply mode (
!replyingTo)The Select component implementation properly handles:
- Value binding to form state
- Change handling with form updates
- Display formatting with name and email
- Primary alias indication
apps/mail/components/mail/reply-composer.tsx (1)
238-238: LGTM!Correctly passing the
replyingToprop to disable alias selection during reply composition, which provides the appropriate UX behavior.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/mail/components/create/create-email.tsx (1)
106-106: Consider validating that a valid sender email is available.The fallback logic is well-structured, but there's a potential edge case where all email sources could be unavailable, resulting in an empty
fromEmail. Consider adding validation to ensure a valid sender email exists before proceeding with the send operation.const fromEmail = data.fromEmail || aliases?.[0]?.email || userEmail; + +if (!fromEmail) { + throw new Error('No valid sender email available'); +}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/mail/components/create/create-email.tsx(2 hunks)
🔇 Additional comments (2)
apps/mail/components/create/create-email.tsx (2)
104-104: Good addition of optional fromEmail parameter.The optional
fromEmailparameter correctly extends the function signature to support alias selection functionality.
185-185: Excellent - dynamic aliases prop now properly used.This correctly resolves the previous issue with hardcoded test data and properly passes the dynamic aliases to the EmailComposer component.

Add email alias selection to the email composer
Description
This PR adds the ability for users to select which email alias to send from in the email composer. It displays a dropdown of available email aliases when composing a new email, allowing users to choose their sending identity. The feature is only shown when creating new emails, not when replying to existing messages.
Type of Change
Areas Affected
Summary by CodeRabbit
New Features
Style