Skip to content

fix: hide cal branding for orgs/teams#27643

Draft
Ryukemeister wants to merge 5 commits intomainfrom
disable-cal-branding-for-teams
Draft

fix: hide cal branding for orgs/teams#27643
Ryukemeister wants to merge 5 commits intomainfrom
disable-cal-branding-for-teams

Conversation

@Ryukemeister
Copy link
Contributor

@Ryukemeister Ryukemeister commented Feb 5, 2026

What does this PR do?

Ensures Cal branding is correctly hidden for orgs and team bookings. Branding preference is computed per event and applied across emails, workflows, and verification flows for consistent behavior.

Bug Fixes

  • Compute hideBranding at build time using team/owner/organization profile and attach it to CalendarEvent.
  • Use evt.hideBranding in workflow scheduling and email generation instead of owner-only checks.
  • Hide logo in scheduled emails and email verification templates when branding is disabled.
  • Pass eventTypeId through booker verify email hooks and TRPC to determine branding for verification emails.
  • Expand data selects to include team/parent and organization hideBranding flags where needed.

Updates since last revision

  • Addressed Cubic AI review feedback: removed unused organizationId and username fields from profiles select in getBooking.ts (confidence 9/10)
  • Skipped BookingRepository.ts suggestion (confidence 7/10, below threshold)

Visual Demo (For contributors especially)

N/A - Logic changes only, no UI modifications.

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A - no documentation changes needed.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Create a team or organization with hideBranding: true
  2. Create an event type under that team/org
  3. Book the event and verify:
    • Confirmation emails do not show Cal.com branding/logo
    • Email verification emails (if enabled) do not show Cal.com branding
    • Workflow-triggered emails respect the hideBranding setting

Human Review Checklist

  • Verify shouldHideBrandingForEventUsingProfile utility correctly handles all cases (team events, user events, org overrides)
  • Check that hideBranding is consistently computed across all booking handlers
  • Confirm email templates properly conditionally render based on hideBranding

Link to Devin run: https://app.devin.ai/sessions/247bb7d6deff45bba56915ce8cc9f42d
Requested by: unknown ()

@Ryukemeister Ryukemeister requested review from a team as code owners February 5, 2026 07:51
@paragon-review
Copy link

paragon-review bot commented Feb 5, 2026

Paragon Review Unavailable

Hi @Ryukemeister! You are not toggled active by your team. Reach out to your admin.

@graphite-app graphite-app bot added consumer core area: core, team members only labels Feb 5, 2026
@Ryukemeister Ryukemeister requested a review from hbjORbj February 5, 2026 07:52
@paragon-review
Copy link

paragon-review bot commented Feb 5, 2026

Paragon: tests updated

2 updated tests generated for this PR.

Updated Tests

  • CalendarEventBuilder withHideBranding tests — Adding new test to existing file
  • handlePaymentSuccess hideBranding from evt test — Adding new test to existing file

Accept Changes Open in Paragon

Details

Updated Tests

  • CalendarEventBuilder withHideBranding tests (unit)
  • handlePaymentSuccess hideBranding from evt test (unit)

@Ryukemeister Ryukemeister changed the title fix: hide cal branding for teams fix: hide cal branding for orgs/teams Feb 5, 2026
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.

2 issues found across 28 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/features/bookings/repositories/BookingRepository.ts">

<violation number="1" location="packages/features/bookings/repositories/BookingRepository.ts:1615">
P2: Prisma `include` returns all columns for `eventType`, which violates the guideline to select only needed fields. Use `select` with explicit fields for `eventType` instead of `include` to avoid unnecessary data exposure and overhead.</violation>
</file>

<file name="packages/features/bookings/lib/payment/getBooking.ts">

<violation number="1" location="packages/features/bookings/lib/payment/getBooking.ts:120">
P2: Select only the profile fields that are actually used here. `organizationId` and `username` are fetched but never referenced in this function; drop them to avoid unnecessary data exposure and overhead.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

attendees: true,
eventType: true,
eventType: {
include: {
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 5, 2026

Choose a reason for hiding this comment

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

P2: Prisma include returns all columns for eventType, which violates the guideline to select only needed fields. Use select with explicit fields for eventType instead of include to avoid unnecessary data exposure and overhead.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/features/bookings/repositories/BookingRepository.ts, line 1615:

<comment>Prisma `include` returns all columns for `eventType`, which violates the guideline to select only needed fields. Use `select` with explicit fields for `eventType` instead of `include` to avoid unnecessary data exposure and overhead.</comment>

<file context>
@@ -1595,7 +1611,18 @@ async updateMany({ where, data }: { where: BookingWhereInput; data: BookingUpdat
         attendees: true,
-        eventType: true,
+        eventType: {
+          include: {
+            team: {
+              select: {
</file context>
Fix with Cubic

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Devin AI is addressing Cubic AI's review feedback

A Devin session has been created to address the issues identified by Cubic AI.

View Devin Session

devin-ai-integration bot and others added 2 commits February 5, 2026 08:04
…elect

Addresses Cubic AI review feedback (confidence 9/10) to select only
the profile fields that are actually used. The organizationId and
username fields were fetched but never referenced in this function.

Co-Authored-By: unknown <>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

E2E results are ready!

Copy link
Contributor

@hbjORbj hbjORbj left a comment

Choose a reason for hiding this comment

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

Can you add some tests?

@github-actions github-actions bot marked this pull request as draft February 5, 2026 08:32
Co-Authored-By: rajiv@cal.com <sahalrajiv6900@gmail.com>
@Ryukemeister
Copy link
Contributor Author

@paragon-evolve

@paragon-review
Copy link

paragon-review bot commented Feb 5, 2026

Paragon: tests updated

1 updated test generated for this PR.

Updated Tests

  • hideBranding.test.ts — Unit tests for the hideBranding module that handles Cal.com branding visibility for orgs/teams. Tests cover: 1) Team events with org inheritance - verifies parent org hideBranding takes precedence, 2) User events with profile - verifies organization hideBranding takes precedence over user setting, 3) Edge cases for null values and missing entities. The core fix being tested is that organizations' hideBranding setting should cascade down to their teams and users.

Accept Changes Open in Paragon

Details

Updated Tests

  • hideBranding.test.ts (unit)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consumer core area: core, team members only size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants