Skip to content

Comments

Staging#937

Merged
MrgSub merged 14 commits intomainfrom
staging
May 11, 2025
Merged

Staging#937
MrgSub merged 14 commits intomainfrom
staging

Conversation

@MrgSub
Copy link
Collaborator

@MrgSub MrgSub commented May 11, 2025

Summary by CodeRabbit

  • New Features

    • Introduced real-time notifications via a new notification provider.
    • Added an Enterprise pricing plan with expanded features and a "Contact us" action.
    • Implemented a dialog for managing autolabeling labels and enhanced autolabeling controls in the mail panel.
    • Added new user actions in the empty thread view, including AI chat and compose options.
  • Improvements

    • Unified and clarified pricing page layout, styling, and feature descriptions.
    • Enhanced onboarding with simplified, static steps and updated video content.
    • Refined mail list text truncation for better responsiveness.
    • Improved category selection and search query handling for more accurate filtering.
  • Bug Fixes

    • Prevented multiple simultaneous email sends in the composer.
  • Chores

    • Added new dependencies for real-time communication and party socket support.
    • Updated server and environment configuration for durable objects and resource limits.
  • Refactor

    • Modularized authentication and server logic for maintainability.
    • Streamlined onboarding and navigation user components by removing obsolete upgrade and autolabeling controls.

MrgSub and others added 14 commits May 10, 2025 13:25
…ain functionality, and clean up NavUser component
… component, and improve error handling in server utilities
…ayout, add getLabels and updateLabels procedures in brain router, and update dependencies in package.json
…tyles in AutoLabelingSettings, and enhance ThreadDisplay with new action buttons
…and update button label in ThreadDisplay to include AI
…in MailLayout, update package dependencies, and configure DurableMailbox for session management
@vercel
Copy link

vercel bot commented May 11, 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 11, 2025 6:09pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 11, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces a range of enhancements and new features across both the mail and server applications. Major changes include a complete redesign of the pricing page with an added Enterprise plan, the implementation of a real-time notification system using durable objects and party sockets, the introduction of autolabeling settings and management, and several backend improvements for authentication, connection handling, and category search logic.

Changes

Files/Paths Change Summary
apps/mail/app/(full-width)/pricing/page.tsx Major UI overhaul of the pricing page: layout, styling, new Enterprise plan, clarified features, and simplified call-to-action buttons.
apps/mail/app/(routes)/mail/layout.tsx Converted MailLayout to async, added (commented-out) NotificationProvider integration, and header fetching logic.
apps/mail/components/create/ai-chat.tsx Added logging to refetchAll callback and updated effect dependencies for status monitoring.
apps/mail/components/create/email-composer.tsx Added guard in handleSend to prevent concurrent sends; reordered CSS classes for visibility control.
apps/mail/components/home/pixelated-bg.tsx Removed the <title> element from the SVG component for accessibility/metadata.
apps/mail/components/mail/mail-list.tsx Updated responsive max-width classes for subject text to improve truncation and layout.
apps/mail/components/mail/mail.tsx Introduced AutoLabelingSettings dialog, autolabeling toggle with toast notifications, and refined category filter logic.
apps/mail/components/mail/thread-display.tsx Added compose/AI chat/labeling buttons to empty thread view and corresponding state management.
apps/mail/components/onboarding.tsx Simplified onboarding steps, removed dynamic Pro upgrade logic, and made all steps static.
apps/mail/components/party.tsx Added NotificationProvider component integrating party socket for real-time messaging.
apps/mail/components/ui/nav-user.tsx Removed all logic and UI for enabling/disabling the "Brain" feature from the user menu.
apps/mail/lib/utils.ts Added categorySearchValues and updated cleanSearchValue to remove these values from queries.
apps/mail/package.json Added dependencies: emblor and partysocket.
apps/server/package.json Added dependencies: hono-party and partyserver.
apps/server/src/lib/auth.ts Refactored auth config into helper, added sign-up hook for default settings, exported createSimpleAuth, and updated session plugin usage.
apps/server/src/lib/brain.ts Replaced manual fetch calls with direct environment method calls for brain subscription management.
apps/server/src/lib/driver/google.ts Improved search normalization for drafts and archives, ensuring correct query formatting.
apps/server/src/lib/driver/utils.ts Refactored argument structure for createDriver in getActiveDriver for consistency.
apps/server/src/lib/filter.ts Added a new filter suggestion for drafts to the filter suggestions array.
apps/server/src/lib/party.ts Introduced DurableMailbox class for party socket integration and session management.
apps/server/src/lib/server-utils.ts Enhanced getActiveConnection to fallback to any user connection if none is active, with improved error handling.
apps/server/src/lib/utils.ts Added categorySearchValues and updated cleanSearchValue to target these values.
apps/server/src/main.ts Refactored server entrypoint to use WorkerEntrypoint, added partykit routing, exported DurableMailbox, and added a notifyUser method.
apps/server/src/trpc/routes/brain.ts Added getLabels and updateLabels procedures for autolabeling; removed redundant brain server checks.
apps/server/src/trpc/routes/mail.ts Added a blank line for code clarity after driver extraction.
apps/server/src/trpc/trpc.ts Refactored activeConnectionProcedure to use try-catch for error handling and sign-out on failure.
apps/server/wrangler.jsonc Added durable object, migration, service binding, and CPU limit to the staging environment configuration.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant MailUI
    participant NotificationProvider
    participant PartySocket
    participant DurableMailbox (Server)
    participant Auth
    participant DB

    User->>MailUI: Loads mail layout
    MailUI->>NotificationProvider: Mounts with headers
    NotificationProvider->>PartySocket: Connects to room (active email)
    PartySocket->>DurableMailbox (Server): onConnect with token
    DurableMailbox (Server)->>Auth: getSession(token)
    Auth->>DB: Fetch session data
    Auth-->>DurableMailbox (Server): Session info
    DurableMailbox (Server)->>DurableMailbox (Server): Store email in durable storage
    DurableMailbox (Server)-->>PartySocket: Connection established
    PartySocket-->>NotificationProvider: Receives real-time messages
    NotificationProvider-->>MailUI: (Potential UI updates)
Loading
sequenceDiagram
    participant User
    participant MailUI
    participant TRPC
    participant Server
    participant DB

    User->>MailUI: Opens autolabeling settings
    MailUI->>TRPC: getLabels()
    TRPC->>Server: Fetch labels for active connection
    Server->>DB: Read connection_labels
    DB-->>Server: Labels string
    Server-->>TRPC: Labels array
    TRPC-->>MailUI: Labels array

    User->>MailUI: Edits and saves labels
    MailUI->>TRPC: updateLabels(labels)
    TRPC->>Server: Update connection_labels
    Server->>DB: Write labels string
    DB-->>Server: Success
    Server-->>TRPC: { success: true }
    TRPC-->>MailUI: Confirmation
Loading

Possibly related PRs

  • Staging #776: Directly related; this PR removes the "Enable Brain" feature from NavUser, while Staging #776 previously added it.
  • thread action buttons #597: Both PRs modify ThreadDisplay to enhance UI actions when no thread is selected, though with different features.
  • Staging #929: Closely related; Staging #929 initially implemented the PricingPage component, which is now being overhauled in this PR.

Suggested labels

design

Poem

In the warren where code and carrots grow,
A new Enterprise plan steals the show.
Real-time hops with party cheer,
Autolabels managed, inboxes clear!
With sockets and settings, we leap ahead,
This bunny’s proud—let’s ship what’s been bred!

((\
( -.-)
o_(")(")

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 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 7748a35 and bb29d15.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (27)
  • apps/mail/app/(full-width)/pricing/page.tsx (3 hunks)
  • apps/mail/app/(routes)/mail/layout.tsx (1 hunks)
  • apps/mail/components/create/ai-chat.tsx (1 hunks)
  • apps/mail/components/create/email-composer.tsx (4 hunks)
  • apps/mail/components/home/pixelated-bg.tsx (1 hunks)
  • apps/mail/components/mail/mail-list.tsx (1 hunks)
  • apps/mail/components/mail/mail.tsx (7 hunks)
  • apps/mail/components/mail/thread-display.tsx (2 hunks)
  • apps/mail/components/onboarding.tsx (4 hunks)
  • apps/mail/components/party.tsx (1 hunks)
  • apps/mail/components/ui/nav-user.tsx (1 hunks)
  • apps/mail/lib/utils.ts (1 hunks)
  • apps/mail/package.json (2 hunks)
  • apps/server/package.json (1 hunks)
  • apps/server/src/lib/auth.ts (6 hunks)
  • apps/server/src/lib/brain.ts (1 hunks)
  • apps/server/src/lib/driver/google.ts (2 hunks)
  • apps/server/src/lib/driver/utils.ts (1 hunks)
  • apps/server/src/lib/filter.ts (1 hunks)
  • apps/server/src/lib/party.ts (1 hunks)
  • apps/server/src/lib/server-utils.ts (1 hunks)
  • apps/server/src/lib/utils.ts (1 hunks)
  • apps/server/src/main.ts (2 hunks)
  • apps/server/src/trpc/routes/brain.ts (1 hunks)
  • apps/server/src/trpc/routes/mail.ts (1 hunks)
  • apps/server/src/trpc/trpc.ts (1 hunks)
  • apps/server/wrangler.jsonc (1 hunks)
✨ 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.

@MrgSub MrgSub merged commit 35a10b0 into main May 11, 2025
4 of 5 checks passed
This was referenced Jun 17, 2025
@coderabbitai coderabbitai bot mentioned this pull request Jul 16, 2025
34 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.

2 participants