Zero icon indicating copy to clipboard operation
Zero copied to clipboard

founder mode

Open nizzyabi opened this issue 4 months ago β€’ 1 comments

READ CAREFULLY THEN REMOVE

Remove bullet points that are not relevant.

PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.

  • Pull requests that do not follow these guidelines will be closed without review or comment.
  • If you use AI to write your PR description your pr will be close without review or comment.
  • If you are unsure about anything, feel free to ask for clarification.

Description

Please provide a clear description of your changes.


Type of Change

Please delete options that are not relevant.

  • [ ] πŸ› Bug fix (non-breaking change which fixes an issue)
  • [ ] ✨ New feature (non-breaking change which adds functionality)
  • [ ] πŸ’₯ Breaking change (fix or feature with breaking changes)
  • [ ] πŸ“ Documentation update
  • [ ] 🎨 UI/UX improvement
  • [ ] πŸ”’ Security enhancement
  • [ ] ⚑ Performance improvement

Areas Affected

Please check all that apply:

  • [ ] Email Integration (Gmail, IMAP, etc.)
  • [ ] User Interface/Experience
  • [ ] Authentication/Authorization
  • [ ] Data Storage/Management
  • [ ] API Endpoints
  • [ ] Documentation
  • [ ] Testing Infrastructure
  • [ ] Development Workflow
  • [ ] Deployment/Infrastructure

Testing Done

Describe the tests you've done:

  • [ ] Unit tests added/updated
  • [ ] Integration tests added/updated
  • [ ] Manual testing performed
  • [ ] Cross-browser testing (if UI changes)
  • [ ] Mobile responsiveness verified (if UI changes)

Security Considerations

For changes involving data or authentication:

  • [ ] No sensitive data is exposed
  • [ ] Authentication checks are in place
  • [ ] Input validation is implemented
  • [ ] Rate limiting is considered (if applicable)

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

Additional Notes

Add any other context about the pull request here.

Screenshots/Recordings

Add screenshots or recordings here if applicable.


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


Summary by cubic

Add Founder Mode: a focused triage view to quickly process unread inbox threads with generated draft replies, fast send + archive, and handy shortcuts. This helps reach inbox zero faster.

  • New Features
    • New route at /founder-mode and sidebar item (Zap icon, shortcut g + f).
    • Loads up to 100 unread Inbox threads and refreshes every minute.
    • Skips drafts and messages from yourself; uses the latest message per thread.
    • Creates an editable draft reply with a regenerate option and time received context.
    • One-click Send & Archive or Archive only; marks as read, removes from Inbox, and prevents reprocessing via session cache.
    • Keyboard shortcuts: Tab = generate new draft, Cmd/Ctrl+Enter = send & archive, Cmd/Ctrl+Delete = archive, Arrow keys = navigate.
    • Clear empty states and errors: no connection prompt, inbox zero screen, and a safe fallback draft if generation fails.

Summary by CodeRabbit

  • New Features
    • Added Founder Mode to streamline triage of unread emails.
    • Auto-loads unread threads, lets you navigate between messages, and skips already archived ones.
    • One-click AI draft generation; edit, regenerate, then Send & Archive or Archive only.
    • Keyboard shortcuts: Tab (generate), Cmd/Ctrl+Enter (send & archive), Cmd/Ctrl+Delete (archive), Arrow keys (navigate).
    • Displays sender, subject, content, and relative received time with clear loading and β€œInbox Zero” states.
    • New sidebar link to Founder Mode with shortcut g then f.

nizzyabi avatar Aug 22 '25 16:08 nizzyabi

Walkthrough

Adds a new Founder Mode page that fetches unread inbox threads, generates AI draft replies, lets users edit/send, archives threads, and navigates emails with keyboard shortcuts. Integrates route configuration and navigation entry with icon and shortcut. Persists processed/archived state in sessionStorage and uses TRPC queries/mutations for mail and AI.

Changes

Cohort / File(s) Summary
Founder Mode Page
apps/mail/app/(routes)/founder-mode/page.tsx
New client-side page component to triage unread threads: fetch unread, filter archived via sessionStorage, sequentially process threads, generate AI replies (TRPC), allow edits, send & archive or archive-only, mark-as-read, invalidate/refetch queries, keyboard shortcuts, and UI states.
Routing
apps/mail/app/routes.ts
Adds route entry '/founder-mode' mapped to '(routes)/founder-mode/page.tsx' within the public layout.
Navigation
apps/mail/config/navigation.ts
Adds β€œFounder Mode” nav item with Zap icon and shortcut g + f; imports Zap from lucide-react.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant FM as FounderMode Page
  participant MAIL as TRPC Mail API
  participant AI as TRPC AI Compose
  participant SS as sessionStorage

  U->>FM: Navigate to /founder-mode
  FM->>MAIL: getUnreadThreads(INBOX)
  MAIL-->>FM: unread thread list
  FM->>SS: read founderMode_archivedIds
  FM-->>FM: filter out archived/processed
  loop For each thread
    FM->>MAIL: getThread(threadId)
    MAIL-->>FM: thread data
    FM-->>FM: extract latest incoming message
    U->>FM: Press Tab (generate)
    FM->>AI: composeReply(context)
    alt success
      AI-->>FM: generated reply
      FM-->>FM: set generatedReply, editedReply
    else failure
      AI-->>FM: error
      FM-->>FM: set fallback reply
    end
    U->>FM: Edit reply (optional)
    alt Send & Archive (Cmd/Ctrl+Enter)
      FM->>MAIL: sendReply(threadId, editedReply)
      MAIL-->>FM: ok
      FM->>MAIL: bulkArchive([threadId])
      MAIL-->>FM: ok
      FM->>MAIL: markAsRead([threadId])
      MAIL-->>FM: ok
      FM->>SS: update archivedIds
      FM->>MAIL: invalidate+refetch unread
      FM-->>FM: advance to next email
    else Archive only (Cmd/Ctrl+Delete)
      FM->>MAIL: bulkArchive([threadId])
      MAIL-->>FM: ok
      FM->>SS: update archivedIds
      FM->>MAIL: invalidate+refetch unread
      FM-->>FM: advance to next email
    end
  end

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested labels

high priority

Suggested reviewers

  • ahmetskilinc
  • MrgSub

Poem

New mode engaged, laser focus on the load,
Unread threads align β€” we triage, auto-road.
AI drafts the pitch, humans add the soul,
Send, archive, next β€” achieving inbox control.
Zap to founder flow, keyboard rockets ignite,
Inbox zero orbit β€” clean skies, clear night. πŸš€

[!TIP]

πŸ”Œ Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • [ ] πŸ“ Generate Docstrings
πŸ§ͺ Generate unit tests
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment
  • [ ] Commit unit tests in branch founder

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

coderabbitai[bot] avatar Aug 22 '25 16:08 coderabbitai[bot]