Skip to content

Comments

fix: show primary emails#582

Merged
MrgSub merged 3 commits intoMail-0:stagingfrom
sergioxro:fix/inbox-principal
Apr 5, 2025
Merged

fix: show primary emails#582
MrgSub merged 3 commits intoMail-0:stagingfrom
sergioxro:fix/inbox-principal

Conversation

@sergioxro
Copy link
Contributor

@sergioxro sergioxro commented Apr 5, 2025

Description

Modified the Primary category to 'in:inbox category:primary'
to ensure the Primary view only shows the relevant emails

Previously the empty search value would show all emails regardless of category

Type of Change
[x] 🐛 Bug fix (non-breaking change which fixes an issue)

Areas Affected
[x] User Interface/Experience

Testing Done
[x] Manual testing performed (verified Primary tab now shows only primary inbox emails)

Security Considerations
[x] No sensitive data is exposed
[x] Authentication checks are in place

Checklist
[x] My code follows the project's style guidelines
[x] I have performed a self-review of my code

Additional Notes
This change ensures the Primary category filter works as intended by explicitly filtering for:

Emails in the inbox (in:inbox)
Emails marked as primary (category:primary)

Summary by CodeRabbit

  • New Features
    • Introduced a new "All Mail" category for improved email organization.
    • Added a new filter option to display all emails, enhancing filtering capabilities.

@vercel
Copy link

vercel bot commented Apr 5, 2025

@sergio-jva 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 5, 2025

Walkthrough

This change introduces a new category, "All Mail," to the Categories function in the mail component, along with an update to the searchValue property for the existing "Primary" category. The new category includes an ID, a translated name, an empty search value, an icon, and specific color styling. Additionally, a new filter suggestion for displaying all emails has been added. A corresponding entry for the "All Mail" category has also been included in the localization JSON file.

Changes

File Path Change Summary
apps/mail/.../mail.tsx Added new category "All Mail" with specific properties; updated "Primary" category's searchValue from '' to 'in:inbox category:primary'.
apps/mail/.../filter.ts Added new filter suggestion for "is:all" to display all emails.
apps/mail/.../en.json Added new entry "allMail": "All Mail" in the mailCategories section.

Suggested reviewers

  • MrgSub
  • needleXO

Poem

I'm a bunny with hops so bright,
Coding changes deep into the night,
With a filter tweak that feels just right,
Inbox and primary now align in sight,
Hopping through the mail, pure delight!
🐇✨


📜 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 aa97429 and 9dec540.

📒 Files selected for processing (3)
  • apps/mail/components/mail/mail.tsx (2 hunks)
  • apps/mail/lib/filter.ts (1 hunks)
  • apps/mail/locales/en.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/mail/components/mail/mail.tsx
🔇 Additional comments (2)
apps/mail/locales/en.json (1)

86-86: LGTM! The "All Mail" category has been added correctly.

This addition is consistent with the PR objective of improving email filtering functionality. The new category will allow users to view all their emails, complementing the more specific categories like Primary.

apps/mail/lib/filter.ts (1)

20-25:

Details

❓ Verification inconclusive

New filter suggestion for "All Mail" looks good.

This addition introduces a filter to show all emails, which pairs well with the new "All Mail" category. The implementation follows the existing pattern for filter suggestions and uses appropriate icons.

However, based on the PR objectives, I expected to see updates to the Primary category filter (changing it to "in:inbox category:primary").


🏁 Script executed:

#!/bin/bash
# Check if there are any other changes related to the Primary category filter
echo "Searching for any Primary category filter changes in the codebase..."
rg -i "category:primary" --type ts --type tsx

Length of output: 220


Below is a revised shell script to recheck the Primary category filter updates. The previous search failed (due to an unrecognized file type "tsx"), so please run this script to verify if there are any instances of the expected update ("in:inbox category:primary") across both .ts and .tsx files:

#!/bin/bash
echo "Searching for any Primary category filter changes (in:inbox category:primary) in .ts and .tsx files..."
rg -i "in:inbox category:primary" -g "*.ts" -g "*.tsx"

Rewritten Review Comment

The new filter suggestion for "All Mail" is well implemented following the existing pattern with appropriate icons. However, I expected to see updates for the Primary category filter—specifically, a change to "in:inbox category:primary." Since the initial search encountered a file type issue, please run the above script to manually verify whether those changes exist. Once verified, confirm if further modifications to the Primary filter are needed.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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 plan to trigger planning for file edits and PR creation.
  • @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.

@MrgSub MrgSub merged commit 58271b0 into Mail-0:staging Apr 5, 2025
2 of 3 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Apr 5, 2025
10 tasks
@coderabbitai coderabbitai bot mentioned this pull request Apr 15, 2025
@coderabbitai coderabbitai bot mentioned this pull request Jun 11, 2025
34 tasks
@coderabbitai coderabbitai bot mentioned this pull request Jun 19, 2025
4 tasks
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.

3 participants