* feat: improve overlapping events display in weekly calendar view
- Add cascading layout algorithm for overlapping events
- First event at 80% width, subsequent events offset by 8%
- Implement hover behavior to bring events to front (z-index 100)
- Extract overlap logic into reusable utility functions
- Add comprehensive unit tests for overlap detection and layout calculation
- Sort events by start time, then by duration for consistent rendering
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* feat: add weekly calendar playground page for testing overlapping events
- Create comprehensive playground page with 8 test scenarios
- Include two overlapping, three cascading, non-overlapping, same start time, chain overlaps, dense day, touching events, and mixed statuses
- Add focused view with scenario selector and grid view for side-by-side comparison
- Update playground index to include weekly calendar link
- Each scenario includes description, expected behavior, and collapsible event data
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* update base props
* remove unneccessary things
* fix: isolate Calendar store instances to prevent shared state
- Refactor useCalendarStore to use Zustand's createStore with React Context
- Each Calendar component now creates its own isolated store instance
- Maintains backward compatibility with global store fallback
- Fixes issue where multiple Calendar instances on same page shared state
This allows the playground page to render multiple Calendar instances
without state conflicts between them.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: prevent event overflow in dense overlap scenarios
- Dynamically compress offset step based on overlap group size
- Ensure leftOffset + width never exceeds 100% to prevent bleeding into next day
- Add width clamping as safety guard against rounding errors
- Add 3 new tests for overflow prevention with dense event scenarios
Fixes issue where 10+ overlapping events would cascade beyond day boundary
and bleed into the next day's column. The algorithm now calculates the
maximum safe step size per overlap group while maintaining visual cascade.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* remove global store
* fix: comprehensive overflow prevention with safety margin and CSS fix
- Add safetyMarginPercent (0.5%) to prevent rounding and CSS box model overflow
- Implement floor3 rounding for width to guarantee left + width <= 100 - safetyMargin
- Calculate width from rounded left offset to avoid rounding mismatch
- Remove inset-x-1 class conflict that was setting both left and right positioning
- Change from marginLeft to left positioning for proper control
- Add test for 20+ overlapping events to verify no overflow
- Update existing tests to verify safety margin is respected
This fixes the slight overflow issue reported by the user where events were
still bleeding into adjacent day columns despite the initial dynamic step
compression fix. The root cause was a combination of:
1. CSS conflict: inset-x-1 class setting both left and right positioning
2. Rounding mismatch: width calculated from unrounded left offset
3. No safety margin for CSS box model effects (borders, padding)
All 21 tests now pass including new safety margin verification.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* feat: update Dense Day scenario to 20+ events
- Increase from 11 to 21 overlapping events in Dense Day scenario
- Update title from '10+ Events' to '20+ Events'
- Add 10 more diverse events with staggered start times
- Better stress test for overflow prevention with safety margin
This provides a more comprehensive test case for the overflow prevention
fix and matches the user's request for 20+ events instead of 10+.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* WIP
* feat: enhance event tooltip to show full event details
- Replace simple title-only tooltip with rich content tooltip
- Display event title, time range, description, and status
- Add color indicator matching the event's visual style
- Set min-width (200px) and max-width (300px) for better readability
- Use inverted theme colors for better contrast in tooltip
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* faster animation
* feat: position tooltip based on day of week
- Show tooltip on right side for Monday-Thursday (days 1-4)
- Show tooltip on left side for Friday-Sunday (days 5-0)
- Calculate day of week using dayjs from event start date
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* add margin for tooltip
* feat: add event duration layout test scenario
- Add new scenario with events of varying durations (3, 7, 15, 20, 30, 53 minutes)
- Test layout logic where eventDuration > 30 changes flex direction
- Events ≤30min show horizontal layout (title and time inline)
- Events >30min show vertical layout (title and time stacked)
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* update styles
* feat: add minimum height of 15px for events
- Ensure very short events (e.g., 3 minutes) are still visible
- Use CSS max() to apply minimum height while respecting duration-based height
- Prevents events from becoming too small to interact with
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* update playground
* do not mutate
* pre-compute some values
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Sean Brydon <sean@cal.com>
- Remove cal.cache query parameter parsing from booking and slots flows
- Set shouldServeCache to false for all booking availability checks
- Remove _shouldServeCache from schemas and type definitions
- Clean up all references in platform atoms and API endpoints
This ensures fresh Google Calendar data is always fetched for conflict checking,
preventing bookings when there are actual calendar conflicts.
* feat: skip authentication check for reschedule bookings with validation
- Skip checkBookingRequiresAuthentication when rescheduleUid is present
- Add validation to ensure rescheduleUid points to a real booking
- Verify booking status is ACCEPTED (upcoming)
- Verify booking uses the same event-type
- Throw appropriate errors for invalid reschedule attempts
Co-Authored-By: morgan@cal.com <morgan@cal.com>
* refactor: move reschedule validation logic into checkBookingRequiresAuthentication
- Refactor checkBookingRequiresAuthentication to accept optional rescheduleUid parameter
- Move reschedule booking validation logic inside the method
- Simplify createBooking method by removing duplicate validation code
- Maintain same validation logic: check booking exists, is ACCEPTED, and uses same event-type
Co-Authored-By: morgan@cal.com <morgan@cal.com>
* fix: allow PENDING bookings to be rescheduled
- Update status validation to allow both ACCEPTED and PENDING bookings
- Change error message to reflect both allowed statuses
- PENDING bookings can now be rescheduled without authentication check
Co-Authored-By: morgan@cal.com <morgan@cal.com>
* refactor: separate reschedule validation from auth check
- Extract validateRescheduleBooking method to handle reschedule-specific validation
- Keep checkBookingRequiresAuthentication strictly for auth checks
- Use conditional logic in createBooking: validate reschedule OR check auth
- Improves code clarity by separating concerns per lauris's feedback
Co-Authored-By: morgan@cal.com <morgan@cal.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* refactor: decouple @calcom/prisma from @calcom/features, @calcom/ee, and @calcom/lib
- Inline helper functions in zod-utils.ts (emailSchema, slugify, getValidRhfFieldName, isPasswordValid, intervalLimitsType, zodAttributesQueryValue)
- Update schema.prisma @zod.import comments to reference zod-utils instead of @calcom/lib
- Inline idempotency key generation in booking-idempotency-key extension using uuid v5
- Move usage-tracking extension to @calcom/ee/prisma-extensions/
- Remove usage-tracking extension from packages/prisma/index.ts
- Move Prisma DI module from @calcom/prisma to @calcom/features/di/modules/Prisma.ts
- Update 20 import paths in @calcom/features to use new Prisma DI module
- Remove @calcom/lib dependency from @calcom/prisma package.json
- Add uuid dependency to @calcom/prisma package.json
This reduces the dependency footprint of @calcom/prisma and breaks circular dependencies between packages.
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* feat: add EE-specific Prisma DI module with usage tracking
Create packages/ee/di/modules/PrismaEE.ts to apply the usage-tracking extension in EE contexts. This module:
- Imports the base prisma client from @calcom/prisma
- Applies the usageTrackingExtention from @calcom/ee/prisma-extensions/usage-tracking
- Exports the same DI tokens as the base Prisma module for override in EE containers
This ensures usage tracking functionality is preserved in EE builds while keeping the base @calcom/prisma package free of EE dependencies.
Note: EE containers should load this module after the base Prisma module to override the bindings.
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2025-11-04 06:51:13 -03:00
Anik Dhabal BabuGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix: align booking limit timezone between availability and validation
- Use eventType.schedule?.timeZone for booking limits in availability calculation
- Previously used user's timezone causing day boundary mismatch
- Add unit tests to verify timezone alignment
- Fixes issue where slots remain available after reaching booking limit
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* Rename variable limitsTz to eventTimeZone
* update
* fix: correct timezone fallback to include user timezone without forcing UTC
- Changed fallback chain to: schedule → event → user → undefined
- Treats empty strings as missing timezones
- Does not force UTC when all timezones are missing
- Aligns with validation behavior when timezone is undefined
- Fixes getSchedule.test.ts failures
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* Revert "fix: correct timezone fallback to include user timezone without forcing UTC"
This reverts commit 721e0bdfd7b08004e68df6bdf5b97b9bd6cf3d5c.
* test: remove complex unit tests with 'as any' casts
- Removed Booking Limits Timezone Alignment tests that required heavy mocking
- These tests relied on spying private methods and had many 'as any' casts
- Timezone alignment is already covered by integration tests in getSchedule.test.ts
- Kept BookingDateInPastError test which has no type issues
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* address review
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* refactor: extract booking actions dropdown to separate component
- Created BookingActionsDropdown component with all dropdown actions and dialogs
- Component receives booking as prop and handles all action logic internally
- Removed duplicate dialog states and mutations from BookingListItem
- Fixed img tag to use Next.js Image component
- Maintains same functionality and UI while improving code reusability
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: restore cardCharged variable in BookingListItem
The cardCharged variable was accidentally removed during the refactoring
but is still needed for the actionContext in BookingListItem.tsx
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* refactor: move BookingItemProps type to separate types.ts file
- Created types.ts to hold shared booking types
- Updated BookingListItem.tsx to import from types.ts
- Updated BookingActionsDropdown.tsx to import from types.ts
- Updated bookingActions.ts to import from types.ts
- Removed unused RouterInputs and RouterOutputs imports from BookingListItem.tsx
- Removes unwanted dependency chain where BookingActionsDropdown imported from BookingListItem
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* remove unnecessary description
* extract states as a zustand store
* fix dialog issue
* fix type errors
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* #fix: Recurring events set to “yearly” don’t recur
* fix: handle yearly recurring events with explicit null check
* fix: use explicit null check for recurring event frequency
* fix: hide organizer email on cancellation page
* if cancelled by any host - hide the cancelled by
* Refactor organizer email logic and clean up code
Removed the isOrganizerEmail function and updated conditions for displaying the cancelledBy information.
---------
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
* fix: dont allow email exclusion bypass with capital letters
* trim before lowercasing to filter out empty tokens
* update console message
* use only regex change to implement this
* use only regex change to implement this
## What does this PR do?
Adds a welcome modal for new organizations that appears after organization creation. The modal showcases key features of the Organizations plan and provides a better onboarding experience.
## Visual Demo (For contributors especially)
#### Image Demo:

## Mandatory Tasks (DO NOT REMOVE)
- [x] I have self-reviewed the code.
- [x] I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A
- [x] 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 new organization through either:
- The onboarding flow
- The settings/organizations/new page
- The organization creation form
2. After successful creation and redirect, verify the welcome modal appears showing organization features.
3. Verify the modal can be closed by:
- Clicking the "Continue" button
- Clicking outside the modal
- Pressing ESC key
4. Verify the modal doesn't reappear after being closed (query param and session storage should be cleared).
## Checklist
- I have read the [contributing guide](https://github.com/calcom/cal.com/blob/main/CONTRIBUTING.md)
- My code follows the style guidelines of this project
- I have commented my code, particularly in hard-to-understand areas
- I have checked if my changes generate no new warnings