Skip to content

feat: show internal team members note in meeting briefing emails#1199

Merged
elie222 merged 2 commits intomainfrom
feat/meeting-brief-internal-team-note
Jan 5, 2026
Merged

feat: show internal team members note in meeting briefing emails#1199
elie222 merged 2 commits intomainfrom
feat/meeting-brief-internal-team-note

Conversation

@elie222
Copy link
Owner

@elie222 elie222 commented Jan 5, 2026

User description

Summary

Adds a note to meeting briefing emails that lists internal team members who are also attending the meeting, clarifying that briefings are only generated for external guests.

  • Added InternalTeamMember type and getInternalTeamMembers() function to identify attendees from the same domain
  • Updated MeetingBriefingData to include internalTeamMembers
  • Added a note at the bottom of guest briefings: "Also attending: Alice, Bob (internal team members - no briefing included)"
  • Passed internal team members through the flow from gather-context → process → send-briefing → email template

Test plan

  • Existing meeting briefing tests pass
  • Verify email preview shows internal team member note with pnpm email

🤖 Generated with Claude Code


Generated description

Below is a concise technical summary of the changes proposed in this PR:

graph LR
    subgraph "inbox-zero-ai" ["inbox-zero-ai"]
    gatherContextForEvent_("gatherContextForEvent"):::modified
    getInternalTeamMembers_("getInternalTeamMembers"):::added
    MeetingBriefingData_("MeetingBriefingData"):::modified
    InternalTeamMember_("InternalTeamMember"):::added
    runMeetingBrief_("runMeetingBrief"):::modified
    sendBriefingEmail_("sendBriefingEmail"):::modified
    RESEND_EMAILS_MEETING_BRIEFING_("RESEND_EMAILS_MEETING_BRIEFING"):::modified
    gatherContextForEvent_ -- "Adds call to obtain internal team members filtering by domain." --> getInternalTeamMembers_
    gatherContextForEvent_ -- "Includes internalTeamMembers in returned briefing payload." --> MeetingBriefingData_
    gatherContextForEvent_ -- "Introduces InternalTeamMember type shaping internal entries." --> InternalTeamMember_
    runMeetingBrief_ -- "Now receives internalTeamMembers when gathering briefing context." --> gatherContextForEvent_
    runMeetingBrief_ -- "Propagates internalTeamMembers through MeetingBriefingData downstream." --> MeetingBriefingData_
    runMeetingBrief_ -- "Passes gathered internalTeamMembers to sendBriefingEmail." --> sendBriefingEmail_
    sendBriefingEmail_ -- "Merges InternalTeamMember entries into briefingContent before sending." --> InternalTeamMember_
    sendBriefingEmail_ -- "Sends briefing API payload now including internalTeamMembers." --> RESEND_EMAILS_MEETING_BRIEFING_
    classDef added stroke:#15AA7A
    classDef removed stroke:#CD5270
    classDef modified stroke:#EDAC4C
    linkStyle default stroke:#CBD5E1,font-size:13px
    end
    subgraph "@inboxzero/resend" ["@inboxzero/resend"]
    MeetingBriefingEmail_("MeetingBriefingEmail"):::modified
    renderGuestBriefings_("renderGuestBriefings"):::modified
    renderInternalTeamNote_("renderInternalTeamNote"):::added
    BriefingContent_("BriefingContent"):::modified
    InternalTeamMember_("InternalTeamMember"):::added
    MeetingBriefingEmail_ -- "Unchanged: renders guest briefings from briefingContent.guests" --> renderGuestBriefings_
    MeetingBriefingEmail_ -- "Appends internal team note listing names/emails" --> renderInternalTeamNote_
    MeetingBriefingEmail_ -- "Now includes optional internalTeamMembers array of InternalTeamMember" --> BriefingContent_
    renderInternalTeamNote_ -- "Displays member.name or member.email when rendering attendees" --> InternalTeamMember_
    BriefingContent_ -- "Defines optional internalTeamMembers array containing InternalTeamMember entries" --> InternalTeamMember_
    classDef added stroke:#15AA7A
    classDef removed stroke:#CD5270
    classDef modified stroke:#EDAC4C
    linkStyle default stroke:#CBD5E1,font-size:13px
    end
Loading

Enhances meeting briefing emails by identifying and listing internal team members who are also attending, ensuring that briefings are only generated for external guests. This involves updating data structures across the meeting-briefs utility functions to propagate internal attendee information and integrating a new rendering component within the MeetingBriefingEmail template.

TopicDetails
AI Tooling Config Update or add configuration files for the Claude AI assistant, which are used for managing PR comments, creation, and review processes. These changes are related to the development workflow and automation rather than the application's core features.
Modified files (6)
  • .claude/commands/address-pr-comments.md
  • .claude/commands/create-pr.md
  • .claude/commands/next-step.md
  • .claude/commands/polish.md
  • .claude/commands/review.md
  • .claude/commands/step-by-step.md
Latest Contributors(0)
UserCommitDate
Internal Team Note Implement the end-to-end functionality for identifying internal team members attending a meeting, passing this data through the briefing generation process, and rendering a concise note within the meeting briefing email. This includes defining the InternalTeamMember type, creating getInternalTeamMembers to filter attendees by domain, updating MeetingBriefingData and BriefingContent interfaces, and integrating the renderInternalTeamNote component into the email template.
Modified files (5)
  • apps/web/utils/meeting-briefs/send-briefing.ts
  • apps/web/__tests__/ai-meeting-briefing.test.ts
  • apps/web/utils/meeting-briefs/gather-context.ts
  • apps/web/utils/meeting-briefs/process.ts
  • packages/resend/emails/meeting-briefing.tsx
Latest Contributors(1)
UserCommitDate
elie222fixesJanuary 01, 2026
This pull request is reviewed by Baz. Review like a pro on (Baz).

Add a note at the bottom of meeting briefing emails listing internal
team members who are also attending the meeting, clarifying that
briefings are only generated for external guests.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
inbox-zero Ready Ready Preview Jan 5, 2026 1:47pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 5, 2026

📝 Walkthrough

Walkthrough

Adds detection and propagation of internal team members into meeting briefing data and email content: introduces InternalTeamMember, collects internal attendees in gathering logic, threads them through processing to the email sender, and renders an internal-team note in the briefing email.

Changes

Cohort / File(s) Summary
Type Definitions & Email Template
packages/resend/emails/meeting-briefing.tsx
Exported InternalTeamMember type; extended BriefingContent to optionally include internalTeamMembers; added renderInternalTeamNote and updated preview to include sample internal members.
Context Gathering
apps/web/utils/meeting-briefs/gather-context.ts
Added InternalTeamMember internal type; extended MeetingBriefingData to include internalTeamMembers; implemented getInternalTeamMembers to filter attendees by user domain and integrated retrieval/logging into gatherContextForEvent.
Processing Pipeline
apps/web/utils/meeting-briefs/process.ts
runMeetingBrief now passes briefingData.internalTeamMembers into sendBriefingEmail.
Email Sending
apps/web/utils/meeting-briefs/send-briefing.ts
sendBriefingEmail signature extended to accept internalTeamMembers; merges them into the briefing content sent to the email renderer.
Tests
apps/web/__tests__/ai-meeting-briefing.test.ts
Test helper MeetingBriefingData updated to include internalTeamMembers (initialized as []).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Job as Briefing Job
  participant Gather as gatherContextForEvent
  participant Processor as runMeetingBrief
  participant Sender as sendBriefingEmail
  participant Template as MeetingBriefingEmail

  Note over Job,Gather: Start briefing generation
  Job->>Gather: request meeting context (attendees, user)
  Gather-->>Job: MeetingBriefingData (includes internalTeamMembers)
  Job->>Processor: runMeetingBrief(with briefingData)
  Processor->>Sender: sendBriefingEmail(briefingContent, internalTeamMembers, ...)
  Sender->>Template: render email with briefingContent + internalTeamMembers
  Template-->>Sender: rendered HTML/email payload
  Sender-->>Processor: email sent / result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • anakarentorosserrano-star
  • baz-reviewer

Poem

🐰 A hop through headers, fields aligned,
Internal friends now easy to find,
From gather to send, they travel with care,
A brief with colleagues — all listed there! 🥕📧

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main feature: adding a note to show internal team members in meeting briefing emails.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 70123a0 and 36a3cc7.

📒 Files selected for processing (3)
  • apps/web/utils/meeting-briefs/gather-context.ts
  • apps/web/utils/meeting-briefs/send-briefing.ts
  • packages/resend/emails/meeting-briefing.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/utils/meeting-briefs/send-briefing.ts
🧰 Additional context used
📓 Path-based instructions (15)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/data-fetching.mdc)

**/*.{ts,tsx}: For API GET requests to server, use the swr package
Use result?.serverError with toastError from @/components/Toast for error handling in async operations

**/*.{ts,tsx}: Use wrapper functions for Gmail message operations (get, list, batch, etc.) from @/utils/gmail/message.ts instead of direct API calls
Use wrapper functions for Gmail thread operations from @/utils/gmail/thread.ts instead of direct API calls
Use wrapper functions for Gmail label operations from @/utils/gmail/label.ts instead of direct API calls

**/*.{ts,tsx}: For early access feature flags, create hooks using the naming convention use[FeatureName]Enabled that return a boolean from useFeatureFlagEnabled("flag-key")
For A/B test variant flags, create hooks using the naming convention use[FeatureName]Variant that define variant types, use useFeatureFlagVariantKey() with type casting, and provide a default "control" fallback
Use kebab-case for PostHog feature flag keys (e.g., inbox-cleaner, pricing-options-2)
Always define types for A/B test variant flags (e.g., type PricingVariant = "control" | "variant-a" | "variant-b") and provide type safety through type casting

**/*.{ts,tsx}: Don't use primitive type aliases or misleading types
Don't use empty type parameters in type aliases and interfaces
Don't use this and super in static contexts
Don't use any or unknown as type constraints
Don't use the TypeScript directive @ts-ignore
Don't use TypeScript enums
Don't export imported variables
Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions
Don't use TypeScript namespaces
Don't use non-null assertions with the ! postfix operator
Don't use parameter properties in class constructors
Don't use user-defined types
Use as const instead of literal types and type annotations
Use either T[] or Array<T> consistently
Initialize each enum member value explicitly
Use export type for types
Use `impo...

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • packages/resend/emails/meeting-briefing.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/prisma-enum-imports.mdc)

Always import Prisma enums from @/generated/prisma/enums instead of @/generated/prisma/client to avoid Next.js bundling errors in client components

Import Prisma using the project's centralized utility: import prisma from '@/utils/prisma'

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • packages/resend/emails/meeting-briefing.tsx
apps/web/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

Import specific lodash functions rather than entire lodash library to minimize bundle size (e.g., import groupBy from 'lodash/groupBy')

apps/web/**/*.{ts,tsx}: Use TypeScript with strict null checks
Do not export types/interfaces that are only used within the same file. Export later if needed

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/security.mdc)

**/*.ts: ALL database queries MUST be scoped to the authenticated user/account by including user/account filtering in WHERE clauses to prevent unauthorized data access
Always validate that resources belong to the authenticated user before performing operations, using ownership checks in WHERE clauses or relationships
Always validate all input parameters for type, format, and length before using them in database queries
Use SafeError for error responses to prevent information disclosure. Generic error messages should not reveal internal IDs, logic, or resource ownership details
Only return necessary fields in API responses using Prisma's select option. Never expose sensitive data such as password hashes, private keys, or system flags
Prevent Insecure Direct Object References (IDOR) by validating resource ownership before operations. All findUnique/findFirst calls MUST include ownership filters
Prevent mass assignment vulnerabilities by explicitly whitelisting allowed fields in update operations instead of accepting all user-provided data
Prevent privilege escalation by never allowing users to modify system fields, ownership fields, or admin-only attributes through user input
All findMany queries MUST be scoped to the user's data by including appropriate WHERE filters to prevent returning data from other users
Use Prisma relationships for access control by leveraging nested where clauses (e.g., emailAccount: { id: emailAccountId }) to validate ownership

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)

**/*.{tsx,ts}: Use Shadcn UI and Tailwind for components and styling
Use next/image package for images
For API GET requests to server, use the swr package with hooks like useSWR to fetch data
For text inputs, use the Input component with registerProps for form integration and error handling

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • packages/resend/emails/meeting-briefing.tsx
**/*.{tsx,ts,css}

📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)

Implement responsive design with Tailwind CSS using a mobile-first approach

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • packages/resend/emails/meeting-briefing.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

**/*.{js,jsx,ts,tsx}: Don't use accessKey attribute on any HTML element
Don't set aria-hidden="true" on focusable elements
Don't add ARIA roles, states, and properties to elements that don't support them
Don't use distracting elements like <marquee> or <blink>
Only use the scope prop on <th> elements
Don't assign non-interactive ARIA roles to interactive HTML elements
Make sure label elements have text content and are associated with an input
Don't assign interactive ARIA roles to non-interactive HTML elements
Don't assign tabIndex to non-interactive HTML elements
Don't use positive integers for tabIndex property
Don't include "image", "picture", or "photo" in img alt prop
Don't use explicit role property that's the same as the implicit/default role
Make static elements with click handlers use a valid role attribute
Always include a title element for SVG elements
Give all elements requiring alt text meaningful information for screen readers
Make sure anchors have content that's accessible to screen readers
Assign tabIndex to non-interactive HTML elements with aria-activedescendant
Include all required ARIA attributes for elements with ARIA roles
Make sure ARIA properties are valid for the element's supported roles
Always include a type attribute for button elements
Make elements with interactive roles and handlers focusable
Give heading elements content that's accessible to screen readers (not hidden with aria-hidden)
Always include a lang attribute on the html element
Always include a title attribute for iframe elements
Accompany onClick with at least one of: onKeyUp, onKeyDown, or onKeyPress
Accompany onMouseOver/onMouseOut with onFocus/onBlur
Include caption tracks for audio and video elements
Use semantic elements instead of role attributes in JSX
Make sure all anchors are valid and navigable
Ensure all ARIA properties (aria-*) are valid
Use valid, non-abstract ARIA roles for elements with ARIA roles
Use valid AR...

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • packages/resend/emails/meeting-briefing.tsx
!(pages/_document).{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

Don't use the next/head module in pages/_document.js on Next.js projects

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • packages/resend/emails/meeting-briefing.tsx
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)

**/*.{js,ts,jsx,tsx}: Use lodash utilities for common operations (arrays, objects, strings)
Import specific lodash functions to minimize bundle size (e.g., import groupBy from 'lodash/groupBy')

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • packages/resend/emails/meeting-briefing.tsx
**/{utils,helpers,lib}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/logging.mdc)

Logger should be passed as a parameter to helper functions instead of creating their own logger instances

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
apps/web/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

apps/web/**/*.{ts,tsx,js,jsx}: Use @/ path aliases for imports from project root
Prefer self-documenting code over comments; use descriptive variable and function names instead of explaining intent with comments
Add helper functions to the bottom of files, not the top
All imports go at the top of files, no mid-file dynamic imports

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
apps/web/**/*.{ts,tsx,js,jsx,json,css}

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

Format code with Prettier

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
apps/web/**/*.{example,ts,json}

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

Add environment variables to .env.example, env.ts, and turbo.json

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)

**/*.tsx: Use the LoadingContent component to handle loading states instead of manual loading state management
For text areas, use the Input component with type='text', autosizeTextarea prop set to true, and registerProps for form integration

Files:

  • packages/resend/emails/meeting-briefing.tsx
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

**/*.{jsx,tsx}: Don't use unnecessary fragments
Don't pass children as props
Don't use the return value of React.render
Make sure all dependencies are correctly specified in React hooks
Make sure all React hooks are called from the top level of component functions
Don't forget key props in iterators and collection literals
Don't define React components inside other components
Don't use event handlers on non-interactive elements
Don't assign to React component props
Don't use both children and dangerouslySetInnerHTML props on the same element
Don't use dangerous JSX props
Don't use Array index in keys
Don't insert comments as text nodes
Don't assign JSX properties multiple times
Don't add extra closing tags for components without children
Use <>...</> instead of <Fragment>...</Fragment>
Watch out for possible "wrong" semicolons inside JSX elements
Make sure void (self-closing) elements don't have children
Don't use target="_blank" without rel="noopener"
Don't use <img> elements in Next.js projects
Don't use <head> elements in Next.js projects

Files:

  • packages/resend/emails/meeting-briefing.tsx
🧠 Learnings (4)
📓 Common learnings
Learnt from: elie222
Repo: elie222/inbox-zero PR: 1199
File: apps/web/utils/meeting-briefs/send-briefing.ts:0-0
Timestamp: 2026-01-05T13:44:53.648Z
Learning: In apps/web/utils/meeting-briefs/, the Zod schema in generate-briefing.ts intentionally only includes `{guests: GuestBriefing[]}` because the AI only generates guest briefings. The `internalTeamMembers` field comes from domain-based filtering in gather-context.ts (not AI-researched) and is merged into the BriefingContent in send-briefing.ts before sending the email. This separation keeps the Zod schema focused on what the AI actually generates.
<!-- [add_learning]
In the meeting briefing feature (apps/web/utils/meeting-briefs/), there's an intentional type separation: the Zod schema BriefingContent type from generate-briefing.ts differs from the email package BriefingContent type in packages/resend/emails/meeting-briefing.tsx. The AI-generated content uses a narrower type while the email content includes additional domain-filtered data merged in send-briefing.ts.
📚 Learning: 2026-01-05T13:44:53.648Z
Learnt from: elie222
Repo: elie222/inbox-zero PR: 1199
File: apps/web/utils/meeting-briefs/send-briefing.ts:0-0
Timestamp: 2026-01-05T13:44:53.648Z
Learning: Maintain clear separation between AI-generated content types and downstream email/content packaging. In apps/web/utils/meeting-briefs, ensure Zod schemas (e.g., generate-briefing.ts) reflect only the fields produced by AI (e.g., guests: GuestBriefing[]) and do not include domain-filtered data. Merge additional fields (like internalTeamMembers from gather-context.ts) during downstream steps (e.g., send-briefing.ts) before composing the final email, and keep the email package types (e.g., packages/resend/emails/meeting-briefing.tsx) aligned with the merged content. This minimizes coupling and clarifies data provenance between AI generation and email sending.

Applied to files:

  • apps/web/utils/meeting-briefs/gather-context.ts
📚 Learning: 2026-01-05T13:44:53.648Z
Learnt from: elie222
Repo: elie222/inbox-zero PR: 1199
File: apps/web/utils/meeting-briefs/send-briefing.ts:0-0
Timestamp: 2026-01-05T13:44:53.648Z
Learning: In apps/web/utils/meeting-briefs/, the Zod schema in generate-briefing.ts intentionally only includes `{guests: GuestBriefing[]}` because the AI only generates guest briefings. The `internalTeamMembers` field comes from domain-based filtering in gather-context.ts (not AI-researched) and is merged into the BriefingContent in send-briefing.ts before sending the email. This separation keeps the Zod schema focused on what the AI actually generates.
<!-- [add_learning]
In the meeting briefing feature (apps/web/utils/meeting-briefs/), there's an intentional type separation: the Zod schema BriefingContent type from generate-briefing.ts differs from the email package BriefingContent type in packages/resend/emails/meeting-briefing.tsx. The AI-generated content uses a narrower type while the email content includes additional domain-filtered data merged in send-briefing.ts.

Applied to files:

  • packages/resend/emails/meeting-briefing.tsx
📚 Learning: 2025-07-17T04:19:57.099Z
Learnt from: edulelis
Repo: elie222/inbox-zero PR: 576
File: packages/resend/emails/digest.tsx:78-83
Timestamp: 2025-07-17T04:19:57.099Z
Learning: In packages/resend/emails/digest.tsx, the DigestEmailProps type uses `[key: string]: DigestItem[] | undefined | string | Date | undefined` instead of intersection types like `& Record<string, DigestItem[] | undefined>` due to implementation constraints. This was the initial implementation approach and cannot be changed to more restrictive typing.

Applied to files:

  • packages/resend/emails/meeting-briefing.tsx
🧬 Code graph analysis (2)
apps/web/utils/meeting-briefs/gather-context.ts (3)
packages/resend/emails/meeting-briefing.tsx (1)
  • InternalTeamMember (19-22)
apps/web/utils/calendar/event-types.ts (2)
  • CalendarEvent (6-16)
  • CalendarEventAttendee (1-4)
apps/web/utils/email.ts (1)
  • extractDomainFromEmail (86-104)
packages/resend/emails/meeting-briefing.tsx (2)
apps/web/utils/meeting-briefs/gather-context.ts (1)
  • InternalTeamMember (26-29)
apps/web/utils/ai/meeting-briefs/generate-briefing.ts (1)
  • BriefingContent (41-41)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: test
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
apps/web/utils/meeting-briefs/gather-context.ts (1)

26-29: LGTM! Clean implementation of internal team member detection.

The implementation correctly identifies internal team members by filtering attendees who share the user's domain while excluding the user themselves. The logic properly handles edge cases (domain extraction can return empty string) and follows the established patterns in the codebase. The addition of internalTeamCount to logging provides good observability.

Also applies to: 34-34, 55-59, 64-64, 106-109, 184-203

packages/resend/emails/meeting-briefing.tsx (1)

19-22: LGTM! Email rendering implementation is well-structured.

The renderInternalTeamNote helper cleanly handles the display of internal team members, correctly falling back from name to email and returning null for empty arrays. The unconditional invocation at lines 122-124 (with ?? [] fallback) is the right approach, as confirmed by past review feedback. The addition to PreviewProps enables visual verification of the feature.

Based on learnings, the intentional type separation between AI-generated content and email content is maintained correctly here.

Also applies to: 26-26, 60-72, 122-124, 188-191


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@macroscopeapp
Copy link
Contributor

macroscopeapp bot commented Jan 5, 2026

Add internal team member note to meeting briefing emails by passing apps/web/utils/meeting-briefs/gather-context.ts:gatherContextForEvent internal attendees to apps/web/utils/meeting-briefs/send-briefing.ts:sendBriefingEmail and rendering in packages/resend/emails/meeting-briefing.tsx:MeetingBriefingEmail

Introduce internalTeamMembers in briefing data, derive attendees sharing the user’s domain, forward to email composition, and render an "Also attending" note in the meeting briefing template.

📍Where to Start

Start with gatherContextForEvent in gather-context.ts, then follow its internalTeamMembers through runMeetingBrief in process.ts to sendBriefingEmail in send-briefing.ts and finally the rendering in packages/resend/emails/meeting-briefing.tsx.


Macroscope summarized 36a3cc7.

Comment on lines +120 to +123
<Section className="px-8 pb-4">
{renderGuestBriefings(briefingContent.guests)}
{briefingContent.internalTeamMembers &&
renderInternalTeamNote(briefingContent.internalTeamMembers)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to call renderInternalTeamNote(briefingContent.internalTeamMembers ?? []) unconditionally here? The helper already returns null for empty arrays, so the extra guard just adds noise without changing the rendered output.

Suggested change
<Section className="px-8 pb-4">
{renderGuestBriefings(briefingContent.guests)}
{briefingContent.internalTeamMembers &&
renderInternalTeamNote(briefingContent.internalTeamMembers)}
<Section className="px-8 pb-4">
{renderGuestBriefings(briefingContent.guests)}
{renderInternalTeamNote(briefingContent.internalTeamMembers ?? [])}

Finding type: Conciseness

Copy link
Owner Author

Choose a reason for hiding this comment

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

Good suggestion! Applied the change - now calling renderInternalTeamNote(briefingContent.internalTeamMembers ?? []) unconditionally since the helper already returns null for empty arrays.

Copy link
Contributor

Choose a reason for hiding this comment

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

Commit 36a3cc7 addressed this comment. The conditional guard briefingContent.internalTeamMembers && was removed, and the function is now called unconditionally with renderInternalTeamNote(briefingContent.internalTeamMembers ?? []), exactly as suggested. This improves code conciseness while maintaining the same rendered output.

Comment on lines +192 to +202
return event.attendees.filter((attendee) => {
const normalizedAttendeeEmail = attendee.email.trim().toLowerCase();
const attendeeDomain = extractDomainFromEmail(normalizedAttendeeEmail);

if (!attendeeDomain) return false;

// Internal team members share the same domain but are not the user themselves
return (
attendeeDomain === normalizedUserDomain &&
normalizedAttendeeEmail !== normalizedUserEmail
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Since extractDomainFromEmail can return undefined, the guard (if (!attendeeDomain) return false;) seems redundant—could we just return the boolean expression directly and flatten the function?

Suggested change
return event.attendees.filter((attendee) => {
const normalizedAttendeeEmail = attendee.email.trim().toLowerCase();
const attendeeDomain = extractDomainFromEmail(normalizedAttendeeEmail);
if (!attendeeDomain) return false;
// Internal team members share the same domain but are not the user themselves
return (
attendeeDomain === normalizedUserDomain &&
normalizedAttendeeEmail !== normalizedUserEmail
);
return event.attendees.filter((attendee) => {
const normalizedAttendeeEmail = attendee.email.trim().toLowerCase();
const attendeeDomain = extractDomainFromEmail(normalizedAttendeeEmail);
// Internal team members share the same domain but are not the user themselves
return (
attendeeDomain &&
attendeeDomain === normalizedUserDomain &&
normalizedAttendeeEmail !== normalizedUserEmail
);

Finding type: Conciseness

Copy link
Owner Author

Choose a reason for hiding this comment

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

Applied! Flattened the filter to include attendeeDomain && in the return expression rather than using a separate guard clause.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Fix all issues with AI Agents 🤖
In @apps/web/utils/meeting-briefs/send-briefing.ts:
- Around line 41-45: The returned Zod type from generate-briefing.ts (used by
aiGenerateMeetingBriefing) only defines BriefingContent as { guests:
GuestBriefing[] } while sendBriefingEmail expects the email package
BriefingContent which includes optional internalTeamMembers; fix by either
updating the Zod schema in generate-briefing.ts to include internalTeamMembers?:
InternalTeamMember[] so the generated BriefingContent matches the email package,
or if the separation is intentional, explicitly cast the value when calling
sendBriefingEmail (e.g., assert/convert the Zod result to the email package
BriefingContent) and keep the merge of internalTeamMembers in send-briefing.ts
to satisfy the parameter type.
🧹 Nitpick comments (4)
packages/resend/emails/meeting-briefing.tsx (1)

19-22: Type duplication: InternalTeamMember defined in multiple locations.

The InternalTeamMember type is defined here and also in apps/web/utils/meeting-briefs/gather-context.ts (lines 26-29). While the definitions currently match, maintaining identical types in multiple locations risks drift over time.

Consider keeping a single source of truth for this type. Since send-briefing.ts already imports it from this email package, you could remove the duplicate definition from gather-context.ts and import from here instead.

🔎 Recommended approach

Keep the type definition here in the email package and import it in gather-context.ts:

+import type { InternalTeamMember } from "@inboxzero/resend/emails/meeting-briefing";
+
-export interface InternalTeamMember {
-  email: string;
-  name?: string;
-}
apps/web/__tests__/ai-meeting-briefing.test.ts (1)

40-51: LGTM: Test fixture properly initialized with new field.

The internalTeamMembers: [] initialization is appropriate for the test fixture, providing a valid default value.

Consider adding a test case that verifies the internal team members flow (e.g., ensuring they're properly excluded from briefing generation but included in the email context). However, this can be deferred as the existing tests cover the core briefing functionality.

apps/web/utils/meeting-briefs/gather-context.ts (2)

26-29: Type duplication: See comment in packages/resend/emails/meeting-briefing.tsx.

This InternalTeamMember interface duplicates the type defined in packages/resend/emails/meeting-briefing.tsx. Please see the review comment on lines 19-22 of that file for the recommended approach.


184-204: LGTM: Logic correctly identifies internal team members.

The function properly:

  • Normalizes email addresses for comparison
  • Filters attendees by matching domain
  • Excludes the user themselves from the internal team list

getInternalTeamMembers and getExternalAttendees (lines 163-182) share significant logic: email normalization, domain extraction, and filtering patterns. Consider extracting common logic into a shared helper function to reduce duplication:

function filterAttendeesByDomain(
  event: CalendarEvent,
  userEmail: string,
  userDomain: string,
  includeSameDomain: boolean
): CalendarEventAttendee[] {
  // Shared normalization and filtering logic
}

This is a maintainability improvement that can be deferred.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e594854 and 70123a0.

📒 Files selected for processing (11)
  • .claude/commands/address-pr-comments.md
  • .claude/commands/create-pr.md
  • .claude/commands/next-step.md
  • .claude/commands/polish.md
  • .claude/commands/review.md
  • .claude/commands/step-by-step.md
  • apps/web/__tests__/ai-meeting-briefing.test.ts
  • apps/web/utils/meeting-briefs/gather-context.ts
  • apps/web/utils/meeting-briefs/process.ts
  • apps/web/utils/meeting-briefs/send-briefing.ts
  • packages/resend/emails/meeting-briefing.tsx
🧰 Additional context used
📓 Path-based instructions (23)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/data-fetching.mdc)

**/*.{ts,tsx}: For API GET requests to server, use the swr package
Use result?.serverError with toastError from @/components/Toast for error handling in async operations

**/*.{ts,tsx}: Use wrapper functions for Gmail message operations (get, list, batch, etc.) from @/utils/gmail/message.ts instead of direct API calls
Use wrapper functions for Gmail thread operations from @/utils/gmail/thread.ts instead of direct API calls
Use wrapper functions for Gmail label operations from @/utils/gmail/label.ts instead of direct API calls

**/*.{ts,tsx}: For early access feature flags, create hooks using the naming convention use[FeatureName]Enabled that return a boolean from useFeatureFlagEnabled("flag-key")
For A/B test variant flags, create hooks using the naming convention use[FeatureName]Variant that define variant types, use useFeatureFlagVariantKey() with type casting, and provide a default "control" fallback
Use kebab-case for PostHog feature flag keys (e.g., inbox-cleaner, pricing-options-2)
Always define types for A/B test variant flags (e.g., type PricingVariant = "control" | "variant-a" | "variant-b") and provide type safety through type casting

**/*.{ts,tsx}: Don't use primitive type aliases or misleading types
Don't use empty type parameters in type aliases and interfaces
Don't use this and super in static contexts
Don't use any or unknown as type constraints
Don't use the TypeScript directive @ts-ignore
Don't use TypeScript enums
Don't export imported variables
Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions
Don't use TypeScript namespaces
Don't use non-null assertions with the ! postfix operator
Don't use parameter properties in class constructors
Don't use user-defined types
Use as const instead of literal types and type annotations
Use either T[] or Array<T> consistently
Initialize each enum member value explicitly
Use export type for types
Use `impo...

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • apps/web/__tests__/ai-meeting-briefing.test.ts
  • packages/resend/emails/meeting-briefing.tsx
  • apps/web/utils/meeting-briefs/send-briefing.ts
  • apps/web/utils/meeting-briefs/process.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/prisma-enum-imports.mdc)

Always import Prisma enums from @/generated/prisma/enums instead of @/generated/prisma/client to avoid Next.js bundling errors in client components

Import Prisma using the project's centralized utility: import prisma from '@/utils/prisma'

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • apps/web/__tests__/ai-meeting-briefing.test.ts
  • packages/resend/emails/meeting-briefing.tsx
  • apps/web/utils/meeting-briefs/send-briefing.ts
  • apps/web/utils/meeting-briefs/process.ts
apps/web/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

Import specific lodash functions rather than entire lodash library to minimize bundle size (e.g., import groupBy from 'lodash/groupBy')

apps/web/**/*.{ts,tsx}: Use TypeScript with strict null checks
Do not export types/interfaces that are only used within the same file. Export later if needed

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • apps/web/__tests__/ai-meeting-briefing.test.ts
  • apps/web/utils/meeting-briefs/send-briefing.ts
  • apps/web/utils/meeting-briefs/process.ts
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/security.mdc)

**/*.ts: ALL database queries MUST be scoped to the authenticated user/account by including user/account filtering in WHERE clauses to prevent unauthorized data access
Always validate that resources belong to the authenticated user before performing operations, using ownership checks in WHERE clauses or relationships
Always validate all input parameters for type, format, and length before using them in database queries
Use SafeError for error responses to prevent information disclosure. Generic error messages should not reveal internal IDs, logic, or resource ownership details
Only return necessary fields in API responses using Prisma's select option. Never expose sensitive data such as password hashes, private keys, or system flags
Prevent Insecure Direct Object References (IDOR) by validating resource ownership before operations. All findUnique/findFirst calls MUST include ownership filters
Prevent mass assignment vulnerabilities by explicitly whitelisting allowed fields in update operations instead of accepting all user-provided data
Prevent privilege escalation by never allowing users to modify system fields, ownership fields, or admin-only attributes through user input
All findMany queries MUST be scoped to the user's data by including appropriate WHERE filters to prevent returning data from other users
Use Prisma relationships for access control by leveraging nested where clauses (e.g., emailAccount: { id: emailAccountId }) to validate ownership

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • apps/web/__tests__/ai-meeting-briefing.test.ts
  • apps/web/utils/meeting-briefs/send-briefing.ts
  • apps/web/utils/meeting-briefs/process.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)

**/*.{tsx,ts}: Use Shadcn UI and Tailwind for components and styling
Use next/image package for images
For API GET requests to server, use the swr package with hooks like useSWR to fetch data
For text inputs, use the Input component with registerProps for form integration and error handling

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • apps/web/__tests__/ai-meeting-briefing.test.ts
  • packages/resend/emails/meeting-briefing.tsx
  • apps/web/utils/meeting-briefs/send-briefing.ts
  • apps/web/utils/meeting-briefs/process.ts
**/*.{tsx,ts,css}

📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)

Implement responsive design with Tailwind CSS using a mobile-first approach

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • apps/web/__tests__/ai-meeting-briefing.test.ts
  • packages/resend/emails/meeting-briefing.tsx
  • apps/web/utils/meeting-briefs/send-briefing.ts
  • apps/web/utils/meeting-briefs/process.ts
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

**/*.{js,jsx,ts,tsx}: Don't use accessKey attribute on any HTML element
Don't set aria-hidden="true" on focusable elements
Don't add ARIA roles, states, and properties to elements that don't support them
Don't use distracting elements like <marquee> or <blink>
Only use the scope prop on <th> elements
Don't assign non-interactive ARIA roles to interactive HTML elements
Make sure label elements have text content and are associated with an input
Don't assign interactive ARIA roles to non-interactive HTML elements
Don't assign tabIndex to non-interactive HTML elements
Don't use positive integers for tabIndex property
Don't include "image", "picture", or "photo" in img alt prop
Don't use explicit role property that's the same as the implicit/default role
Make static elements with click handlers use a valid role attribute
Always include a title element for SVG elements
Give all elements requiring alt text meaningful information for screen readers
Make sure anchors have content that's accessible to screen readers
Assign tabIndex to non-interactive HTML elements with aria-activedescendant
Include all required ARIA attributes for elements with ARIA roles
Make sure ARIA properties are valid for the element's supported roles
Always include a type attribute for button elements
Make elements with interactive roles and handlers focusable
Give heading elements content that's accessible to screen readers (not hidden with aria-hidden)
Always include a lang attribute on the html element
Always include a title attribute for iframe elements
Accompany onClick with at least one of: onKeyUp, onKeyDown, or onKeyPress
Accompany onMouseOver/onMouseOut with onFocus/onBlur
Include caption tracks for audio and video elements
Use semantic elements instead of role attributes in JSX
Make sure all anchors are valid and navigable
Ensure all ARIA properties (aria-*) are valid
Use valid, non-abstract ARIA roles for elements with ARIA roles
Use valid AR...

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • apps/web/__tests__/ai-meeting-briefing.test.ts
  • packages/resend/emails/meeting-briefing.tsx
  • apps/web/utils/meeting-briefs/send-briefing.ts
  • apps/web/utils/meeting-briefs/process.ts
!(pages/_document).{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

Don't use the next/head module in pages/_document.js on Next.js projects

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • apps/web/__tests__/ai-meeting-briefing.test.ts
  • packages/resend/emails/meeting-briefing.tsx
  • apps/web/utils/meeting-briefs/send-briefing.ts
  • apps/web/utils/meeting-briefs/process.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)

**/*.{js,ts,jsx,tsx}: Use lodash utilities for common operations (arrays, objects, strings)
Import specific lodash functions to minimize bundle size (e.g., import groupBy from 'lodash/groupBy')

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • apps/web/__tests__/ai-meeting-briefing.test.ts
  • packages/resend/emails/meeting-briefing.tsx
  • apps/web/utils/meeting-briefs/send-briefing.ts
  • apps/web/utils/meeting-briefs/process.ts
**/{utils,helpers,lib}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/logging.mdc)

Logger should be passed as a parameter to helper functions instead of creating their own logger instances

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • apps/web/utils/meeting-briefs/send-briefing.ts
  • apps/web/utils/meeting-briefs/process.ts
apps/web/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

apps/web/**/*.{ts,tsx,js,jsx}: Use @/ path aliases for imports from project root
Prefer self-documenting code over comments; use descriptive variable and function names instead of explaining intent with comments
Add helper functions to the bottom of files, not the top
All imports go at the top of files, no mid-file dynamic imports

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • apps/web/__tests__/ai-meeting-briefing.test.ts
  • apps/web/utils/meeting-briefs/send-briefing.ts
  • apps/web/utils/meeting-briefs/process.ts
apps/web/**/*.{ts,tsx,js,jsx,json,css}

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

Format code with Prettier

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • apps/web/__tests__/ai-meeting-briefing.test.ts
  • apps/web/utils/meeting-briefs/send-briefing.ts
  • apps/web/utils/meeting-briefs/process.ts
apps/web/**/*.{example,ts,json}

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

Add environment variables to .env.example, env.ts, and turbo.json

Files:

  • apps/web/utils/meeting-briefs/gather-context.ts
  • apps/web/__tests__/ai-meeting-briefing.test.ts
  • apps/web/utils/meeting-briefs/send-briefing.ts
  • apps/web/utils/meeting-briefs/process.ts
apps/web/__tests__/**/*.test.ts

📄 CodeRabbit inference engine (.cursor/rules/llm-test.mdc)

apps/web/__tests__/**/*.test.ts: Place all LLM-related tests in apps/web/__tests__/ directory
Use vitest imports (describe, expect, test, vi, beforeEach) in LLM test files
Mock 'server-only' module with empty object in LLM test files: vi.mock("server-only", () => ({}))
Set timeout constant const TIMEOUT = 15_000; for LLM tests
Use describe.runIf(isAiTest) with environment variable RUN_AI_TESTS === "true" to conditionally run LLM tests
Use console.debug() for outputting generated LLM content in tests, e.g., console.debug("Generated content:\n", result.content);
Prefer using existing helpers from @/__tests__/helpers.ts (getEmailAccount, getEmail, getRule, getMockMessage, getMockExecutedRule) instead of creating custom test data helpers

Files:

  • apps/web/__tests__/ai-meeting-briefing.test.ts
apps/web/{utils/ai,utils/llms,__tests__}/**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/llm.mdc)

LLM-related code must be organized in specific directories: apps/web/utils/ai/ for main implementations, apps/web/utils/llms/ for core utilities and configurations, and apps/web/__tests__/ for LLM-specific tests

Files:

  • apps/web/__tests__/ai-meeting-briefing.test.ts
**/*.{test,spec}.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

**/*.{test,spec}.{js,jsx,ts,tsx}: Don't nest describe() blocks too deeply in test files
Don't use callbacks in asynchronous tests and hooks
Don't have duplicate hooks in describe blocks
Don't use export or module.exports in test files
Don't use focused tests
Make sure the assertion function, like expect, is placed inside an it() function call
Don't use disabled tests

Files:

  • apps/web/__tests__/ai-meeting-briefing.test.ts
**/{scripts,tests,__tests__}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/logging.mdc)

Use createScopedLogger only for code that doesn't run within a middleware chain, such as standalone scripts or tests

Files:

  • apps/web/__tests__/ai-meeting-briefing.test.ts
apps/web/**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

Co-locate test files next to source files (e.g., utils/example.test.ts). Only E2E and AI tests go in __tests__/

Files:

  • apps/web/__tests__/ai-meeting-briefing.test.ts
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/testing.mdc)

**/*.test.{ts,tsx}: Use vitest as the testing framework
Colocate test files next to the tested file with .test.ts or .test.tsx naming convention (e.g., dir/format.ts and dir/format.test.ts)
Mock server-only using vi.mock("server-only", () => ({}))
Mock Prisma using vi.mock("@/utils/prisma") and the provided mock from @/utils/__mocks__/prisma
Use test helper functions getEmail, getEmailAccount, and getRule from @/__tests__/helpers for creating mock data
Clear all mocks between tests using beforeEach(() => { vi.clearAllMocks(); })
Use descriptive test names that clearly indicate what is being tested
Do not mock the Logger in tests

Files:

  • apps/web/__tests__/ai-meeting-briefing.test.ts
**/__tests__/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/testing.mdc)

Place AI tests in the __tests__ directory and do not run them by default as they use a real LLM

Files:

  • apps/web/__tests__/ai-meeting-briefing.test.ts
**/*.test.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/notes.mdc)

Co-locate test files next to source files (e.g., utils/example.test.ts). Only E2E and AI tests go in __tests__/

Files:

  • apps/web/__tests__/ai-meeting-briefing.test.ts
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)

**/*.tsx: Use the LoadingContent component to handle loading states instead of manual loading state management
For text areas, use the Input component with type='text', autosizeTextarea prop set to true, and registerProps for form integration

Files:

  • packages/resend/emails/meeting-briefing.tsx
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

**/*.{jsx,tsx}: Don't use unnecessary fragments
Don't pass children as props
Don't use the return value of React.render
Make sure all dependencies are correctly specified in React hooks
Make sure all React hooks are called from the top level of component functions
Don't forget key props in iterators and collection literals
Don't define React components inside other components
Don't use event handlers on non-interactive elements
Don't assign to React component props
Don't use both children and dangerouslySetInnerHTML props on the same element
Don't use dangerous JSX props
Don't use Array index in keys
Don't insert comments as text nodes
Don't assign JSX properties multiple times
Don't add extra closing tags for components without children
Use <>...</> instead of <Fragment>...</Fragment>
Watch out for possible "wrong" semicolons inside JSX elements
Make sure void (self-closing) elements don't have children
Don't use target="_blank" without rel="noopener"
Don't use <img> elements in Next.js projects
Don't use <head> elements in Next.js projects

Files:

  • packages/resend/emails/meeting-briefing.tsx
🧠 Learnings (1)
📚 Learning: 2025-07-17T04:19:57.099Z
Learnt from: edulelis
Repo: elie222/inbox-zero PR: 576
File: packages/resend/emails/digest.tsx:78-83
Timestamp: 2025-07-17T04:19:57.099Z
Learning: In packages/resend/emails/digest.tsx, the DigestEmailProps type uses `[key: string]: DigestItem[] | undefined | string | Date | undefined` instead of intersection types like `& Record<string, DigestItem[] | undefined>` due to implementation constraints. This was the initial implementation approach and cannot be changed to more restrictive typing.

Applied to files:

  • packages/resend/emails/meeting-briefing.tsx
  • apps/web/utils/meeting-briefs/send-briefing.ts
🧬 Code graph analysis (2)
apps/web/utils/meeting-briefs/gather-context.ts (3)
packages/resend/emails/meeting-briefing.tsx (1)
  • InternalTeamMember (19-22)
apps/web/utils/calendar/event-types.ts (2)
  • CalendarEvent (6-16)
  • CalendarEventAttendee (1-4)
apps/web/utils/email.ts (1)
  • extractDomainFromEmail (86-104)
packages/resend/emails/meeting-briefing.tsx (2)
apps/web/utils/meeting-briefs/gather-context.ts (1)
  • InternalTeamMember (26-29)
apps/web/utils/ai/meeting-briefs/generate-briefing.ts (1)
  • BriefingContent (41-41)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Baz Reviewer
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: test
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (5)
packages/resend/emails/meeting-briefing.tsx (2)

60-72: LGTM: Clean implementation of internal team note rendering.

The renderInternalTeamNote function properly handles the empty case, uses appropriate fallback logic (member.name || member.email), and renders a clear, visually distinct note.


122-123: LGTM: Conditional rendering correctly guards against missing data.

apps/web/utils/meeting-briefs/process.ts (1)

209-218: LGTM: Properly forwards internal team members through the pipeline.

The change correctly passes briefingData.internalTeamMembers to sendBriefingEmail, maintaining the data flow from context gathering to email sending.

apps/web/utils/meeting-briefs/gather-context.ts (1)

55-59: LGTM: Internal team members correctly identified and included.

The logic properly retrieves internal attendees using domain matching and excludes the user themselves. The mapping to the expected interface shape is correct.

Also applies to: 106-109

apps/web/utils/meeting-briefs/send-briefing.ts (1)

16-34: LGTM: Function signature correctly extended with internal team members.

The parameter addition is properly typed and documented through the function signature.

Comment on lines +41 to +45
// Merge internal team members into briefing content for the email
const briefingContentWithTeam: BriefingContent = {
...briefingContent,
internalTeamMembers,
};
Copy link
Contributor

@coderabbitai coderabbitai bot Jan 5, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify that the Zod schema in generate-briefing.ts includes internalTeamMembers

echo "=== Checking briefingSchema definition in generate-briefing.ts ==="
rg -A 20 "briefingSchema\s*=" --type ts apps/web/utils/ai/meeting-briefs/generate-briefing.ts

echo -e "\n=== Checking BriefingContent type export ==="
rg "export type BriefingContent" --type ts apps/web/utils/ai/meeting-briefs/

echo -e "\n=== Checking send-briefing.ts imports ==="
rg -A 5 "^import" --type ts apps/web/utils/meeting-briefs/send-briefing.ts | head -20

Repository: elie222/inbox-zero

Length of output: 2054


🏁 Script executed:

#!/bin/bash
# Check the sendBriefingEmail function signature
echo "=== Function signature and briefingContent source ==="
rg -B 5 "briefingContentWithTeam" --type ts apps/web/utils/meeting-briefs/send-briefing.ts

echo -e "\n=== Check if aiGenerateMeetingBriefing is called in this file ==="
rg "aiGenerateMeetingBriefing" --type ts apps/web/utils/meeting-briefs/

echo -e "\n=== Check email package BriefingContent definition ==="
rg "type BriefingContent" --type ts --type tsx

Repository: elie222/inbox-zero

Length of output: 1011


🏁 Script executed:

#!/bin/bash
# Get the full function signature with parameter types
echo "=== Full sendBriefingEmail function signature ==="
rg -B 2 "export async function sendBriefingEmail" --type ts apps/web/utils/meeting-briefs/send-briefing.ts

echo -e "\n=== Where sendBriefingEmail is called from ==="
rg "sendBriefingEmail" --type ts apps/web/utils/meeting-briefs/process.ts -B 2 -A 2

echo -e "\n=== Check BriefingContent in email package (search broader) ==="
find . -name "*.ts" -o -name "*.tsx" | xargs grep -l "type BriefingContent" 2>/dev/null | head -10

Repository: elie222/inbox-zero

Length of output: 915


🏁 Script executed:

#!/bin/bash
# Get full function signature with parameter types
echo "=== Full sendBriefingEmail function with all parameters ==="
rg -A 15 "export async function sendBriefingEmail" --type ts apps/web/utils/meeting-briefs/send-briefing.ts

echo -e "\n=== BriefingContent definition in email package ==="
cat packages/resend/emails/meeting-briefing.tsx | head -100

echo -e "\n=== Full process.ts flow with briefingContent ==="
rg -A 10 "const briefingContent = await aiGenerateMeetingBriefing" --type ts apps/web/utils/meeting-briefs/process.ts

Repository: elie222/inbox-zero

Length of output: 3430


Clarify BriefingContent type mismatch between Zod schema and email package.

The code is functionally correct, but there's a type annotation issue to address:

  • aiGenerateMeetingBriefing (process.ts) returns BriefingContent from the Zod schema in generate-briefing.ts, which only includes { guests: GuestBriefing[] }
  • sendBriefingEmail expects briefingContent: BriefingContent from the email package, which is { guests: GuestBriefing[]; internalTeamMembers?: InternalTeamMember[] }

The spread merge at lines 41-45 correctly produces the email package shape by explicitly adding internalTeamMembers. However, the mismatch between the Zod schema type and the function parameter type should be resolved—either by:

  1. Updating the Zod schema in generate-briefing.ts to include the optional internalTeamMembers field, or
  2. Explicitly casting the type if the separation is intentional for architectural reasons
🤖 Prompt for AI Agents
In @apps/web/utils/meeting-briefs/send-briefing.ts around lines 41-45, The
returned Zod type from generate-briefing.ts (used by aiGenerateMeetingBriefing)
only defines BriefingContent as { guests: GuestBriefing[] } while
sendBriefingEmail expects the email package BriefingContent which includes
optional internalTeamMembers; fix by either updating the Zod schema in
generate-briefing.ts to include internalTeamMembers?: InternalTeamMember[] so
the generated BriefingContent matches the email package, or if the separation is
intentional, explicitly cast the value when calling sendBriefingEmail (e.g.,
assert/convert the Zod result to the email package BriefingContent) and keep the
merge of internalTeamMembers in send-briefing.ts to satisfy the parameter type.

Copy link
Contributor

Choose a reason for hiding this comment

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

Commit 36a3cc7 addressed this comment by adding an expanded explanatory comment that clarifies the intentional architectural separation: the AI generates only {guests} while internalTeamMembers comes from gather-context.ts via domain-based filtering. This documentation addresses the "clarify" request in the comment title by explaining why the type mismatch exists and that the separation is by design.

Copy link
Contributor

Choose a reason for hiding this comment

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

Skipped: comment is from another GitHub bot.

Copy link
Owner Author

Choose a reason for hiding this comment

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

The type separation is intentional by design:

  • The Zod schema in generate-briefing.ts only has {guests} because the AI only generates guest briefings
  • internalTeamMembers comes from domain-based filtering in gather-context.ts (not AI-researched)
  • The merge at lines 41-45 correctly combines them for the email

Added a clarifying comment explaining this separation. Keeping the Zod schema focused on what the AI actually generates seems cleaner than having it include a field the AI doesn't populate.

Copy link
Contributor

Choose a reason for hiding this comment

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

@elie222, thank you for the clarification! That makes perfect sense. Keeping the Zod schema focused strictly on what the AI generates (guest briefings) and handling the domain-filtered data (internalTeamMembers) separately is a clean architectural separation. The merge in send-briefing.ts correctly combines both data sources for the email template.

The added comment in the code will help future reviewers understand this intentional design choice. Appreciate the explanation!

🐰💭
Architectural clarity
is a gift—
thank you!


✏️ Learnings added
Learnt from: elie222
Repo: elie222/inbox-zero PR: 1199
File: apps/web/utils/meeting-briefs/send-briefing.ts:0-0
Timestamp: 2026-01-05T13:44:53.648Z
Learning: In apps/web/utils/meeting-briefs/, the Zod schema in generate-briefing.ts intentionally only includes `{guests: GuestBriefing[]}` because the AI only generates guest briefings. The `internalTeamMembers` field comes from domain-based filtering in gather-context.ts (not AI-researched) and is merged into the BriefingContent in send-briefing.ts before sending the email. This separation keeps the Zod schema focused on what the AI actually generates.
<!-- [add_learning]
In the meeting briefing feature (apps/web/utils/meeting-briefs/), there's an intentional type separation: the Zod schema BriefingContent type from generate-briefing.ts differs from the email package BriefingContent type in packages/resend/emails/meeting-briefing.tsx. The AI-generated content uses a narrower type while the email content includes additional domain-filtered data merged in send-briefing.ts.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: edulelis
Repo: elie222/inbox-zero PR: 576
File: packages/resend/emails/digest.tsx:78-83
Timestamp: 2025-07-17T04:19:57.099Z
Learning: In packages/resend/emails/digest.tsx, the DigestEmailProps type uses `[key: string]: DigestItem[] | undefined | string | Date | undefined` instead of intersection types like `& Record<string, DigestItem[] | undefined>` due to implementation constraints. This was the initial implementation approach and cannot be changed to more restrictive typing.

Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/llm.mdc:0-0
Timestamp: 2025-11-25T14:38:07.606Z
Learning: Applies to apps/web/utils/ai/**/*.ts : LLM feature functions must import from `zod` for schema validation, use `createScopedLogger` from `@/utils/logger`, `chatCompletionObject` and `createGenerateObject` from `@/utils/llms`, and import `EmailAccountWithAI` type from `@/utils/llms/types`

Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/llm.mdc:0-0
Timestamp: 2025-11-25T14:38:07.606Z
Learning: Applies to apps/web/utils/ai/**/*.ts : Always define a Zod schema for LLM response validation and make schemas as specific as possible to guide the LLM output

- Simplify renderInternalTeamNote call by removing redundant guard
- Flatten getInternalTeamMembers filter logic
- Add clarifying comment about BriefingContent type separation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 11 files

@elie222 elie222 merged commit d037dc4 into main Jan 5, 2026
37 checks passed
@elie222 elie222 deleted the feat/meeting-brief-internal-team-note branch January 5, 2026 14:07
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.

1 participant