Skip to content

Comments

Fix: Prevent duplicate email display in header popover#722

Merged
ahmetskilinc merged 3 commits intoMail-0:stagingfrom
theabhayprajapati:bug-721
Apr 19, 2025
Merged

Fix: Prevent duplicate email display in header popover#722
ahmetskilinc merged 3 commits intoMail-0:stagingfrom
theabhayprajapati:bug-721

Conversation

@theabhayprajapati
Copy link

@theabhayprajapati theabhayprajapati commented Apr 19, 2025

Fixes #721

This PR fixes an issue where the sender's email address was displayed twice in the "From:" line of the header details popover when the sender's display name was identical to their email address. This duplication often caused text to overflow the popover container.

The MailDisplay component now checks if the sender's name and email are the same. If they are, it only displays the name/email once, preventing the duplication and resolving the overflow.


Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • 🎨 UI/UX improvement

Areas Affected

  • UI -> Email -> View Details

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the project's style guidelines
  • I have performed a self-review of my code

Additional Notes

This addresses the specific visual bug reported in issue #721 for a cleaner header details display.

Screenshots/Recordings

Before:
image

After:
Screenshot 2025-04-19 at 4 43 33 PM

Summary by CodeRabbit

  • Refactor
    • Improved the display of sender information in mail details by only showing the sender's email address when it differs from the sender's name, reducing redundant information.

MrgSub and others added 2 commits April 19, 2025 00:41
* improved search

* dates working

* migrate over to utils

* Add email input component for composing emails

* Refactor email input handling and send email functionality

* Remove unused filteredContacts useState variables

* Remove unnecessary contact index state management and effects

* Refactor key validation logic in EmailInput component

* Add CC and BCC buttons with functionality

* Refactor email composer button text and icons

* keyboard open and close email

* uneeded file

* Enhance search functionality by appending query terms to folder-specific searches, improving search bar state management, and refining search value handling across components.

* ui fix

* ui fix

* Refactor search form initialization and reset logic

* reply fix (Mail-0#720)

---------

Co-authored-by: Nizzy <nizabizaher@gmail.com>
Co-authored-by: nizzy <140507264+nizzyabi@users.noreply.github.com>
@vercel
Copy link

vercel bot commented Apr 19, 2025

Someone is attempting to deploy a commit to the Zero Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 19, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This change updates the mail display component to improve how the sender's information is shown in the details popover. Specifically, the sender's email address is now only displayed if it is different from the sender's name. This prevents redundant display of the same email address when the sender's name is identical to their email, streamlining the information presented in the UI. No other logic or exported entities are affected.

Changes

File(s) Change Summary
apps/mail/components/mail/mail-display.tsx Updated conditional rendering so the sender's email address is only shown if it differs from name.

Assessment against linked issues

Objective Addressed Explanation
Prevent duplicate display of sender's email when name equals email (#721)
Ensure "From:" line in popover only shows email once if name and email are identical (#721)
Avoid text overflow in the mail details popover caused by redundant sender email (#721)

Possibly related PRs

Suggested reviewers

  • MrgSub

Poem

A hop and a skip, a redundant email's gone,
The sender now shines with their name alone.
No more overflow, no double display,
The popover's tidy—hip hip hooray!
With a twitch of my nose and a satisfied sigh,
This rabbit approves—give it a try!
🐇✉️


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

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 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.

@ahmetskilinc ahmetskilinc changed the base branch from main to staging April 19, 2025 15:01
Copy link
Contributor

@ahmetskilinc ahmetskilinc left a comment

Choose a reason for hiding this comment

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

lgtm

@ahmetskilinc ahmetskilinc merged commit 248c94f into Mail-0:staging Apr 19, 2025
1 of 2 checks passed
@theabhayprajapati theabhayprajapati deleted the bug-721 branch April 20, 2025 02:15
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.

Redundant Duplicate Sender Email in Header Popover Causes Text Overflow

3 participants