Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: threads with unread messages where wrongly flagged on mail list #480

Merged
merged 2 commits into from
Mar 19, 2025

Conversation

sergio-jva
Copy link
Contributor

@sergio-jva sergio-jva commented Mar 19, 2025

Description

We are getting only the labels of the last email, so if the last email is
read we would get it as read on mail-list, even if all the new ones are unread

chages:
now we return all the labels for all the messages on a thread to verify if any
is unread


Type of Change

Please delete options that are not relevant.

  • 🐛 Bug fix (non-breaking change which fixes an issue)

Areas Affected

Please check all that apply:

  • Email Integration (Gmail, IMAP, etc.)
  • User Interface/Experience

Testing Done

Describe the tests you've done:

  • Manual testing performed
  • Cross-browser testing (if UI changes)

Security Considerations

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in complex areas
  • I have updated the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix/feature works
  • All tests pass locally
  • Any dependent changes are merged and published

Screenshots/Recordings

Before:
image

After:
image


By submitting this pull request, I confirm that my contribution is made under the terms of the project's license.

Summary by CodeRabbit

  • New Features

    • Enhanced mail processing now integrates distinct label information to support more accurate organization and improved filtering of messages.
  • Refactor

    • Streamlined utility imports to optimize interactive feature integration and overall code maintainability.
    • Improved readability of the MailList component's rendering logic while maintaining existing functionality.

These improvements contribute to a significantly more efficient and reliable mail experience and lay the groundwork for exciting future enhancements.

Copy link

vercel bot commented Mar 19, 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.

Copy link
Contributor

coderabbitai bot commented Mar 19, 2025

Walkthrough

This pull request modifies two files. In the Gmail API driver, unique label IDs from messages are extracted and passed into the parse function. In the mail list component, the import statement is updated to include useKeyState along with useHotKey from the custom hooks. No changes were made to public or exported entities.

Changes

File(s) Change Summary
apps/mail/app/api/driver/google.ts Extracts unique label IDs from Gmail API messages and includes them in the parse function call.
apps/mail/components/mail/mail-list.tsx Updates the import statement to combine useHotKey and useKeyState from the custom hooks module; modifies rendering logic for clarity.

Sequence Diagram(s)

sequenceDiagram
    participant GmailAPI as Gmail API
    participant Driver as Google Driver
    participant Parser as Parse Function
    participant Logger as Console Logger

    GmailAPI->>Driver: Return messages with labelIds
    Driver->>Driver: Extract unique label IDs
    Driver->>Parser: Call parse with message & labelIds
    Parser-->>Driver: Return parsed message
    Driver->>Logger: Log parsed output
Loading

Suggested reviewers

  • nizzyabi
  • MrgSub

Poem

I hopped through lines of code so neat,
Finding labels hidden in the beat.
Parsing messages with a joyful cheer,
Logging wonders for all to hear.
A rabbit’s dance in changes clear!
🐇💻


📜 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 58737a5 and 7ff6bba.

📒 Files selected for processing (2)
  • apps/mail/app/api/driver/google.ts (1 hunks)
  • apps/mail/components/mail/mail-list.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/mail/app/api/driver/google.ts
  • apps/mail/components/mail/mail-list.tsx

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

@sergio-jva sergio-jva force-pushed the fix/wrongly-flagged-unread branch from a9a4947 to 911c53d Compare March 19, 2025 04:38
@sergio-jva
Copy link
Contributor Author

fix: #456

@sergio-jva sergio-jva force-pushed the fix/wrongly-flagged-unread branch 2 times, most recently from ee3e14d to f6ce043 Compare March 19, 2025 04:51
@sergio-jva sergio-jva force-pushed the fix/wrongly-flagged-unread branch from 58737a5 to 455a615 Compare March 19, 2025 05:05
Copy link
Collaborator

@MrgSub MrgSub left a comment

Choose a reason for hiding this comment

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

LGTM

@MrgSub MrgSub merged commit 3bb3dd2 into Mail-0:staging Mar 19, 2025
2 of 3 checks passed
@sergio-jva sergio-jva deleted the fix/wrongly-flagged-unread branch March 19, 2025 21:51
This was referenced Apr 5, 2025
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