-
Notifications
You must be signed in to change notification settings - Fork 11.2k
feat: add custom calendar event description #25486 #25668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@jadhavharshh is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 16 files
Prompt for AI agents (all 1 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.tsx">
<violation number="1" location="packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.tsx:251">
P2: Consider using `t()` for the aria-label to ensure proper localization. While this follows the existing pattern for the 'edit custom name' button, accessibility text should ideally be localized for screen reader users in different locales.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements a custom calendar event description feature that allows users to personalize the description text in calendar events created upon booking. The feature enables dynamic variable substitution (e.g., {Scheduler}, {Location}, {Event type title}) and provides a user-friendly modal interface for configuration.
Key Changes
- Database Schema: Added
calendarEventDescriptionnullable string field toEventTypemodel - Frontend UI: Implemented
CustomCalendarDescriptionModalcomponent with variable selector, real-time preview, and validation in the Event Type Advanced tab - Backend Processing: Variable substitution logic integrated in
CalendarManager,getCalendarLinks,BookingEmailSmsHandler, and email ICS generation to replace template variables with actual booking data
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
packages/prisma/schema.prisma |
Added calendarEventDescription field to EventType model |
packages/prisma/migrations/20251206092554_add_calendar_event_description/migration.sql |
Database migration for new field |
packages/types/Calendar.d.ts |
Added calendarEventDescription to CalendarEvent type |
packages/lib/server/eventTypeSelect.ts |
Included new field in event type selection queries |
packages/features/eventtypes/repositories/eventTypeRepository.ts |
Added field to repository select queries |
packages/features/eventtypes/lib/types.ts |
Added field to FormValues type definition |
packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.tsx |
Added UI control and modal trigger for custom calendar descriptions |
packages/features/eventtypes/components/tabs/advanced/CustomCalendarDescriptionModal.tsx |
New modal component for editing calendar descriptions with variable support and preview |
packages/features/calendars/lib/CalendarManager.ts |
Variable substitution logic for calendar event creation |
packages/features/bookings/repositories/BookingRepository.ts |
Added field to booking repository queries |
packages/features/bookings/lib/getCalendarLinks.ts |
Variable substitution for calendar download links |
packages/features/bookings/lib/BookingEmailSmsHandler.ts |
Variable substitution for confirmed booking emails |
packages/features/CalendarEventBuilder.ts |
Added field to event builder |
packages/emails/lib/generateIcsString.ts |
Uses custom description in ICS file generation |
apps/web/lib/booking.ts |
Added field to booking data queries |
apps/web/public/static/locales/en/common.json |
Added localization strings for new feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (eventType.calendarEventDescription) { | ||
| eventDescription = getEventName( | ||
| { ...eventNameObject, eventName: eventType.calendarEventDescription }, | ||
| true | ||
| ); | ||
| } |
Copilot
AI
Dec 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new custom calendar event description feature lacks test coverage. Since getCalendarLinks.test.ts exists with comprehensive tests for this function, consider adding tests to verify:
- That custom calendar descriptions are properly substituted with variables
- That the function falls back to the regular description when
calendarEventDescriptionis not set - That variable substitution works correctly with various booking field combinations
Example test case:
it("should use custom calendar description with variable substitution", () => {
const eventType = {
...baseMockEventType,
calendarEventDescription: "Meeting with {Scheduler} about {Event type title}",
};
const booking = {
...baseMockBooking,
responses: { name: "John Doe" },
};
const result = getCalendarLinks({ booking, eventType, t: mockT });
// Verify that the description contains "Meeting with John Doe about Test Title"
});| productId: "calcom/ics", | ||
| title: event.title, | ||
| description: getRichDescription(event, t), | ||
| description: event.calendarEventDescription || getRichDescription(event, t), |
Copilot
AI
Dec 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The custom calendar event description feature lacks test coverage. Since generateIcsString.test.ts exists with comprehensive tests for this function, consider adding a test to verify that calendarEventDescription is used correctly when present.
Example test case:
test("should use custom calendar description when provided", () => {
const customDescription = "Custom meeting description with details";
const event = buildCalendarEvent({
iCalSequence: 0,
attendees: [buildPerson()],
calendarEventDescription: customDescription,
});
const icsString = generateIcsString({
event: event,
status: "CONFIRMED",
});
expect(icsString).toContain(customDescription);
// Verify it doesn't contain the rich description
});
packages/features/eventtypes/components/tabs/advanced/CustomCalendarDescriptionModal.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (all 1 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/features/calendars/lib/CalendarManager.ts">
<violation number="1" location="packages/features/calendars/lib/CalendarManager.ts:527">
P2: Reordering the `seatsPerTimeSlot` nullification to after `getRichDescription` changes behavior for seated events in the fallback case (no custom description). Previously, `getRichDescription` received nullified `additionalNotes` and `userFieldsResponses` for seated events - now it receives the actual values, potentially exposing information in calendar descriptions that was previously hidden.
If this is intentional, consider adding a comment explaining the behavior change. If not, consider keeping the nullification before `getRichDescription` for the fallback case while still preserving `responses` for custom description variable substitution.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| calendarDescription = getEventName(eventNameObject, true); | ||
| } | ||
|
|
||
| if (calEvent.seatsPerTimeSlot) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Reordering the seatsPerTimeSlot nullification to after getRichDescription changes behavior for seated events in the fallback case (no custom description). Previously, getRichDescription received nullified additionalNotes and userFieldsResponses for seated events - now it receives the actual values, potentially exposing information in calendar descriptions that was previously hidden.
If this is intentional, consider adding a comment explaining the behavior change. If not, consider keeping the nullification before getRichDescription for the fallback case while still preserving responses for custom description variable substitution.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/features/calendars/lib/CalendarManager.ts, line 527:
<comment>Reordering the `seatsPerTimeSlot` nullification to after `getRichDescription` changes behavior for seated events in the fallback case (no custom description). Previously, `getRichDescription` received nullified `additionalNotes` and `userFieldsResponses` for seated events - now it receives the actual values, potentially exposing information in calendar descriptions that was previously hidden.
If this is intentional, consider adding a comment explaining the behavior change. If not, consider keeping the nullification before `getRichDescription` for the fallback case while still preserving `responses` for custom description variable substitution.</comment>
<file context>
@@ -522,13 +516,21 @@ const processEvent = (calEvent: CalendarEvent): CalendarServiceEvent => {
calendarDescription = getEventName(eventNameObject, true);
}
+ if (calEvent.seatsPerTimeSlot) {
+ calEvent.responses = null;
+ calEvent.userFieldsResponses = null;
</file context>
✅ Addressed in f5edce1
What does this PR do?
This PR implements the "Custom calendar event description" feature, allowing users to customize the description text that appears in calendar events created upon booking.
Key Changes:
Database: Added
calendarEventDescriptionfield to theEventTypemodel.Frontend:
CustomCalendarDescriptionModalwhich provides a UI to draft the description with support for dynamic variables (e.g.,{Scheduler},{Organiser},{Location}) and real-time preview.Backend:
CalendarManagerandCalEventParserto prioritize the custom description template (if set) over the default auto-generated rich description.getEventNamelogic.Fixes Customize the title and description of the calendar events that the client can add to their calendar #25486 (GitHub issue number)
Fixes CAL-6839 (Linear issue number - should be visible at the bottom of the GitHub issue description)
Visual Demo (For contributors especially)
A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).
Image Demo (if applicable):
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?