Skip to content

Staging#820

Merged
MrgSub merged 6 commits intomainfrom
staging
May 1, 2025
Merged

Staging#820
MrgSub merged 6 commits intomainfrom
staging

Conversation

@MrgSub
Copy link
Collaborator

@MrgSub MrgSub commented May 1, 2025

Summary by CodeRabbit

  • New Features

    • Improved the attachments popover in the email composer with a more interactive and accessible interface, including file previews, better styling, and easier removal of attachments.
  • Style

    • Introduced light mode styling for the About page while preserving dark mode appearance.
    • Simplified and updated dark mode visuals for the Privacy Policy and Terms pages, removing overlays and muted colors for a cleaner look.
  • Bug Fixes

    • Enhanced handling of recipient addresses when creating draft emails to ensure correct formatting.

@vercel
Copy link

vercel bot commented May 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
0 ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 1, 2025 8:06pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 1, 2025

Warning

Rate limit exceeded

@MrgSub has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 5 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 7a624e6 and a69b816.

📒 Files selected for processing (1)
  • apps/mail/app/api/driver/google.ts (1 hunks)

Walkthrough

This update introduces significant UI and styling adjustments across several pages to improve light and dark mode compatibility, particularly for the "About", "Privacy Policy", and "Terms" pages. The changes include background and text color refinements, removal of some background overlays and borders, and updates to button and link colors for better visual clarity and consistency. Additionally, the email composer’s attachment popover is enhanced with improved accessibility, interactive UI elements, and a more informative layout. There is also a backend adjustment to how recipient addresses are formatted when creating draft emails, ensuring they are passed as arrays of address objects.

Changes

Files/Group Change Summary
apps/mail/app/(full-width)/about/page.tsx Refactored background, card, text, and link colors for light/dark mode adaptability; improved color handling for back button and card components.
apps/mail/app/(full-width)/privacy/page.tsx,
apps/mail/app/(full-width)/terms/page.tsx
Simplified and lightened dark mode styling: updated background colors, removed overlays/borders, adjusted text, button, and link colors for clarity and consistency.
apps/mail/app/api/driver/google.ts Modified recipient address handling in draft creation to split comma-separated strings into arrays of address objects for setTo, setCc, and setBcc.
apps/mail/components/create/email-composer.tsx Enhanced attachments popover: added modal behavior, improved accessibility, richer UI with file previews, truncation, and interactive removal.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EmailComposer
    participant AttachmentsPopover

    User->>EmailComposer: Click attachments button
    EmailComposer->>AttachmentsPopover: Open modal popover
    AttachmentsPopover->>User: Display list of attachments with previews and remove buttons
    User->>AttachmentsPopover: Click remove on an attachment
    AttachmentsPopover->>EmailComposer: Update attachments state, mark as dirty
    AttachmentsPopover->>User: Updated attachments list shown
Loading
sequenceDiagram
    participant API
    participant GoogleDriver

    API->>GoogleDriver: Create draft with to/cc/bcc as comma-separated strings
    GoogleDriver->>GoogleDriver: Split strings, map to address objects
    GoogleDriver->>GoogleDriver: Call setTo, setCc, setBcc with arrays of address objects
    GoogleDriver->>API: Return draft creation result
Loading

Suggested labels

design

Suggested reviewers

  • ahmetskilinc

Poem

A rabbit hopped through CSS and code,
Painting backgrounds light and dark as it strode.
Attachments now shimmer with icons and flair,
While emails to friends are handled with care.
The popover sparkles, the buttons are bright—
This bunny’s been busy making things right!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🧹 Nitpick comments (2)
apps/mail/app/api/driver/google.ts (1)

1-1107: Consider modularizing this large file in a future update.

While the current changes are appropriate, this file is over 1000 lines long and handles many different responsibilities. Consider breaking it down into smaller, more focused modules in a future update to improve maintainability.

apps/mail/components/create/email-composer.tsx (1)

773-777: Consider confirming removal of larger attachments.

For large files or important documents, users might benefit from a confirmation dialog before removal, especially since the action cannot be undone.

onClick={(e: React.MouseEvent<HTMLButtonElement>) => {
  e.preventDefault(); 
  e.stopPropagation();
+ if (file.size > 5000000) { // 5MB threshold
+   if (!confirm(`Are you sure you want to remove ${file.name}?`)) {
+     return;
+   }
+ }
  const updatedAttachments = attachments.filter((_, i) => i !== index);
  setValue('attachments', updatedAttachments, { shouldDirty: true });
  setHasUnsavedChanges(true);
}}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ac5f15 and 7a624e6.

📒 Files selected for processing (5)
  • apps/mail/app/(full-width)/about/page.tsx (3 hunks)
  • apps/mail/app/(full-width)/privacy/page.tsx (3 hunks)
  • apps/mail/app/(full-width)/terms/page.tsx (3 hunks)
  • apps/mail/app/api/driver/google.ts (1 hunks)
  • apps/mail/components/create/email-composer.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
apps/mail/components/create/email-composer.tsx (1)
apps/mail/lib/utils.ts (1)
  • formatFileSize (153-159)
🔇 Additional comments (22)
apps/mail/app/(full-width)/about/page.tsx (4)

14-14: Good implementation of responsive background styling.

The background is now properly set up to switch between white in light mode and dark gray (#111111) in dark mode, which creates a more adaptive user interface.


20-20: Well-implemented button text color adaptation.

The back button's text and hover colors now properly adapt between light and dark modes, improving visibility and user experience in both themes.


29-29: Good Card styling improvement for light/dark mode.

The Card background is now properly adapted with a subtle light gray in light mode while remaining transparent in dark mode, maintaining visual consistency with the other full-width pages.


32-32: Well-executed text color adaptation across content elements.

The text colors for CardTitle, section headers, and content now properly adapt between dark gray (for light mode) and white (for dark mode), significantly improving readability in both themes.

Also applies to: 41-41, 44-44

apps/mail/app/(full-width)/privacy/page.tsx (5)

25-25: Good implementation of responsive background styling.

The background is now properly set up to switch between white in light mode and a dark gray (#111111) in dark mode, creating a more adaptive user interface consistent with the other full-width pages.


31-31: Well-implemented button text color adaptation.

The back button's text and hover colors now properly adapt between light and dark modes, improving visibility and user experience in both themes.


40-41: Improved Card styling for better theme adaptation.

The Card background and header now properly adapt between light and dark modes, with the removal of unnecessary styling complexity in dark mode. This achieves a cleaner, more consistent look with the other full-width pages.


43-43: Well-executed text color adaptation for titles and metadata.

The text colors for the CardTitle and "Last updated" text now properly adapt between light and dark modes, with appropriate opacity adjustments for the metadata text in dark mode.

Also applies to: 47-47


61-61: Simplified section styling with improved interactive elements.

The section container styling has been appropriately simplified while maintaining proper padding. The copy link button and prose content styling now have better color transitions between modes, with improved link colors that maintain good contrast in both themes.

Also applies to: 69-69, 77-77

apps/mail/app/(full-width)/terms/page.tsx (4)

25-25: Good implementation of responsive background styling.

The background is now properly set up to switch between white in light mode and a dark gray (#111111) in dark mode, creating a more adaptive user interface consistent with the other full-width pages.


32-32: Well-implemented button text color adaptation.

The back button's text and hover colors now properly adapt between light and dark modes, improving visibility and user experience in both themes.


41-42: Improved Card and text styling for better theme adaptation.

The Card background, header styling, title colors, and "Last updated" text now properly adapt between light and dark modes, creating a visually cohesive experience that matches the privacy and about pages.

Also applies to: 44-44, 48-48


62-62: Simplified section styling with improved interactive elements.

The section container styling has been appropriately simplified while maintaining proper padding. The copy link button and prose content styling now have better color transitions between modes, with improved link colors that maintain good contrast in both themes.

Also applies to: 70-70, 78-78

apps/mail/app/api/driver/google.ts (1)

974-976: Fixed recipient address formatting for draft emails.

The code now correctly converts comma-separated strings into arrays of address objects with an addr property before passing them to the setTo, setCc, and setBcc methods. This ensures compatibility with the expected input format for these methods.

apps/mail/components/create/email-composer.tsx (8)

696-696: Improved modal behavior for better user experience.

Adding modal={true} to the Popover component ensures it behaves like a true modal dialog, which improves keyboard navigation and screen reader accessibility by trapping focus within the popover when it's open.


698-704: Enhanced accessibility and visual design of attachment trigger button.

The updated button implementation includes several important improvements:

  • Added proper focus styles with focus-visible:ring-2 for keyboard navigation
  • Included an informative aria-label that indicates the number of attachments
  • Better visual styling with border and consistent padding
  • Clearer information hierarchy with the icon and count

These changes make the attachment feature more discoverable and accessible to all users.


708-711: Improved popover dimensions and positioning.

The popover content container has been refined with:

  • Fixed width of 340px for consistent layout
  • Rounded corners and shadow for better visual hierarchy
  • Proper side offset for better positioning relative to the trigger button

These changes create a more polished and professional appearance while maintaining good usability.


712-724: Better structured attachment interface with proper header and scrollable content.

The new implementation includes:

  • A clear header section with title and file count for better context
  • Properly styled borders that match the application design system
  • A scrollable container with hidden scrollbars for a cleaner interface
  • Maximum height constraint to prevent the popover from growing too large

These improvements make the attachment interface more scalable and user-friendly.


725-739: Smart filename handling with proper truncation.

The new code intelligently handles filenames by:

  • Separating the extension from the filename
  • Applying truncation only to the name portion while preserving the extension
  • Setting a reasonable maximum length (22 chars) for the main filename
  • Using proper title attributes for the full filename on hover

This approach maintains the important information (file extension) while preventing overly long filenames from breaking the layout.


740-755: Enhanced file preview with type-specific visual indicators.

The implementation now includes:

  • Proper image preview thumbnails for image files
  • Type-specific icons for different file types (PDF, Excel, Word, etc.)
  • Consistent sizing and styling for the preview area
  • Proper aria-hidden attributes for decorative elements

This makes it easier for users to quickly identify file types and contents at a glance.


756-767: Improved file information display.

The file information section now:

  • Shows truncated filename with separated extension
  • Displays human-readable file size using the formatFileSize utility
  • Uses appropriate text sizes and colors for hierarchy
  • Includes proper title attribute for full filename on hover

This provides users with more useful information about their attachments in a clean, organized manner.


770-785: Enhanced removal button with proper event handling and accessibility.

The new remove button implementation:

  • Prevents event propagation to avoid unintended side effects
  • Uses proper aria-label for accessibility
  • Includes focus styles for keyboard navigation
  • Updates attachments state with proper dirty flagging for unsaved changes tracking
  • Has appropriate hover states for better user feedback

These improvements make attachment management more robust and accessible.

@MrgSub MrgSub merged commit 1f30dae into main May 1, 2025
4 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