-
Notifications
You must be signed in to change notification settings - Fork 10.4k
feat: toggle round robin org and team info in booker #22956
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
feat: toggle round robin org and team info in booker #22956
Conversation
WalkthroughA new feature has been implemented to allow toggling the visibility of organization and team information in the round robin booker. This is achieved by introducing a new boolean prop, Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes were found. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ 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). (1)
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (08/07/25)1 reviewer was added to this PR based on Keith Williams's automation. |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/platform/examples/base/src/pages/booking.tsx (1)
96-96
: Consider making the example more flexible.The hardcoded
roundRobinHideOrgAndTeam={true}
demonstrates the feature but doesn't show the toggle functionality. Consider adding a state variable or checkbox to let users test both true/false values in the example.Also note that this prop isn't included in the reschedule flow (lines 142-156) - verify if this is intentional.
+const [hideOrgAndTeam, setHideOrgAndTeam] = useState(true); // Add a toggle control somewhere in the UI +<label> + <input + type="checkbox" + checked={hideOrgAndTeam} + onChange={(e) => setHideOrgAndTeam(e.target.checked)} + /> + Hide Round Robin Org and Team Info +</label> -roundRobinHideOrgAndTeam={true} +roundRobinHideOrgAndTeam={hideOrgAndTeam}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
.changeset/shaggy-goats-flash.md
(1 hunks)packages/features/bookings/Booker/Booker.tsx
(2 hunks)packages/features/bookings/Booker/components/EventMeta.tsx
(3 hunks)packages/features/bookings/Booker/types.ts
(1 hunks)packages/features/bookings/components/event-meta/Members.tsx
(3 hunks)packages/platform/atoms/booker/BookerPlatformWrapper.tsx
(1 hunks)packages/platform/atoms/booker/types.ts
(1 hunks)packages/platform/examples/base/src/pages/booking.tsx
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.tsx
📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
Always use
t()
for text localization in frontend code; direct text embedding should trigger a warning
Files:
packages/platform/examples/base/src/pages/booking.tsx
packages/features/bookings/Booker/components/EventMeta.tsx
packages/platform/atoms/booker/BookerPlatformWrapper.tsx
packages/features/bookings/Booker/Booker.tsx
packages/features/bookings/components/event-meta/Members.tsx
**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js
.utc()
in hot paths like loops
Files:
packages/platform/examples/base/src/pages/booking.tsx
packages/features/bookings/Booker/components/EventMeta.tsx
packages/platform/atoms/booker/BookerPlatformWrapper.tsx
packages/features/bookings/Booker/types.ts
packages/features/bookings/Booker/Booker.tsx
packages/features/bookings/components/event-meta/Members.tsx
packages/platform/atoms/booker/types.ts
**/*.ts
📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
**/*.ts
: For Prisma queries, only select data you need; never useinclude
, always useselect
Ensure thecredential.key
field is never returned from tRPC endpoints or APIs
Files:
packages/features/bookings/Booker/types.ts
packages/platform/atoms/booker/types.ts
🧠 Learnings (7)
📓 Common learnings
Learnt from: CarinaWolli
PR: calcom/cal.com#22296
File: packages/lib/bookings/filterHostsBySameRoundRobinHost.ts:41-42
Timestamp: 2025-07-22T11:42:47.623Z
Learning: The filterHostsBySameRoundRobinHost function in packages/lib/bookings/filterHostsBySameRoundRobinHost.ts has a known limitation where it doesn't work correctly with fixed hosts or round robin groups. This is pre-existing technical debt that was already broken before the round robin groups feature. CarinaWolli has documented this in Linear issue CAL-6134 for future fix.
Learnt from: CarinaWolli
PR: calcom/cal.com#22296
File: packages/features/eventtypes/components/tabs/assignment/EventTeamAssignmentTab.tsx:514-523
Timestamp: 2025-07-22T10:45:26.651Z
Learning: In the Round Robin groups feature, group names are only used within the event type settings UI and are not rendered elsewhere in the application. The user CarinaWolli confirmed this limited scope when asked about potential XSS concerns with direct input handling in the group name field.
Learnt from: sean-brydon
PR: calcom/cal.com#22618
File: packages/trpc/server/routers/viewer/eventTypes/utils/transformUtils.ts:113-113
Timestamp: 2025-08-05T07:42:06.335Z
Learning: In Cal.com's getUserEventGroups handler refactor (PR #22618), the membershipCount field for team event groups is intentionally set to 0 in the new createTeamEventGroup function, as confirmed by sean-brydon (PR author). This preserves the same behavior as the old implementation that was being refactored, maintaining backward compatibility. While other parts of the codebase may use actual member counts, this specific implementation maintains the previous behavior.
📚 Learning: in the failedbookingsbyfield component (packages/features/insights/components/failedbookingsbyfield....
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.389Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
Applied to files:
packages/platform/examples/base/src/pages/booking.tsx
packages/features/bookings/Booker/components/EventMeta.tsx
packages/platform/atoms/booker/BookerPlatformWrapper.tsx
packages/features/bookings/Booker/types.ts
packages/features/bookings/Booker/Booker.tsx
packages/features/bookings/components/event-meta/Members.tsx
packages/platform/atoms/booker/types.ts
📚 Learning: the filterhostsbysameroundrobinhost function in packages/lib/bookings/filterhostsbysameroundrobinhos...
Learnt from: CarinaWolli
PR: calcom/cal.com#22296
File: packages/lib/bookings/filterHostsBySameRoundRobinHost.ts:41-42
Timestamp: 2025-07-22T11:42:47.623Z
Learning: The filterHostsBySameRoundRobinHost function in packages/lib/bookings/filterHostsBySameRoundRobinHost.ts has a known limitation where it doesn't work correctly with fixed hosts or round robin groups. This is pre-existing technical debt that was already broken before the round robin groups feature. CarinaWolli has documented this in Linear issue CAL-6134 for future fix.
Applied to files:
packages/platform/examples/base/src/pages/booking.tsx
packages/features/bookings/Booker/components/EventMeta.tsx
packages/platform/atoms/booker/BookerPlatformWrapper.tsx
packages/features/bookings/Booker/types.ts
packages/features/bookings/Booker/Booker.tsx
packages/features/bookings/components/event-meta/Members.tsx
📚 Learning: in cal.com's getusereventgroups handler refactor (pr #22618), the membershipcount field for team eve...
Learnt from: sean-brydon
PR: calcom/cal.com#22618
File: packages/trpc/server/routers/viewer/eventTypes/utils/transformUtils.ts:113-113
Timestamp: 2025-08-05T07:42:06.335Z
Learning: In Cal.com's getUserEventGroups handler refactor (PR #22618), the membershipCount field for team event groups is intentionally set to 0 in the new createTeamEventGroup function, as confirmed by sean-brydon (PR author). This preserves the same behavior as the old implementation that was being refactored, maintaining backward compatibility. While other parts of the codebase may use actual member counts, this specific implementation maintains the previous behavior.
Applied to files:
packages/features/bookings/Booker/components/EventMeta.tsx
packages/features/bookings/components/event-meta/Members.tsx
📚 Learning: prefer composition over prop drilling in react; use react children feature instead of passing props ...
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Prefer composition over prop drilling in React; use React children feature instead of passing props through many layers
Applied to files:
packages/platform/atoms/booker/BookerPlatformWrapper.tsx
📚 Learning: in cal.com's event type system, the membershipcount field for team event groups is intentionally set...
Learnt from: sean-brydon
PR: calcom/cal.com#22618
File: packages/trpc/server/routers/viewer/eventTypes/utils/transformUtils.ts:113-113
Timestamp: 2025-08-05T07:42:06.335Z
Learning: In Cal.com's event type system, the membershipCount field for team event groups is intentionally set to 0, as confirmed by sean-brydon (PR author). This behavior was preserved during the refactor from the old getUserEventGroups.handler.ts implementation to the new createTeamEventGroup function in transformUtils.ts. This is not a bug but the intended behavior that maintains consistency with the previous implementation.
Applied to files:
packages/features/bookings/components/event-meta/Members.tsx
📚 Learning: in cal.com's event type system, the membershipcount field for team event groups is intentionally har...
Learnt from: sean-brydon
PR: calcom/cal.com#22618
File: packages/trpc/server/routers/viewer/eventTypes/utils/transformUtils.ts:113-113
Timestamp: 2025-08-05T07:42:06.335Z
Learning: In Cal.com's event type system, the membershipCount field for team event groups is intentionally hard-coded to 0, as confirmed by sean-brydon. This behavior was preserved during the refactor from the old getUserEventGroups.handler.ts implementation to the new createTeamEventGroup function in transformUtils.ts. This is not a bug but the intended behavior.
Applied to files:
packages/features/bookings/components/event-meta/Members.tsx
⏰ 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). (1)
- GitHub Check: Detect changes
🔇 Additional comments (12)
packages/platform/atoms/booker/types.ts (1)
87-87
: LGTM! Clean type addition for the new feature.The optional boolean property follows TypeScript conventions and clearly describes its purpose for toggling round robin organization and team visibility.
.changeset/shaggy-goats-flash.md (1)
1-6
: LGTM! Well-documented changeset.The changeset correctly categorizes this as a minor version bump and provides a clear description of the new toggle functionality for round robin bookings.
packages/platform/atoms/booker/BookerPlatformWrapper.tsx (1)
552-552
: LGTM! Clean prop forwarding.The new prop is properly forwarded from the wrapper to the underlying BookerComponent, maintaining the expected wrapper pattern.
packages/features/bookings/Booker/components/EventMeta.tsx (2)
57-57
: LGTM! Proper prop signature addition.The new
roundRobinHideOrgAndTeam
prop is correctly added to the component's parameter list and type definition.Also applies to: 94-94
172-172
: LGTM! Clean prop forwarding to EventMembers.The prop is properly passed down to the EventMembers component where the actual hiding logic will be implemented.
packages/features/bookings/Booker/Booker.tsx (2)
83-83
: LGTM! Clean integration of the new prop.The
roundRobinHideOrgAndTeam
prop is properly added to the component's destructured parameters following the established pattern.
407-408
: LGTM! Proper prop forwarding to EventMeta.The
roundRobinHideOrgAndTeam
prop is correctly passed down to the EventMeta component alongside the existing props, maintaining the component hierarchy for the feature.packages/features/bookings/Booker/types.ts (2)
143-143
: LGTM! Well-structured type addition for platform usage.The
roundRobinHideOrgAndTeam
property is appropriately typed as optional boolean for platform usage, providing flexibility for different platform implementations.
149-149
: LGTM! Proper default value for web usage.The explicit
false
value forroundRobinHideOrgAndTeam
in the web props ensures consistent default behavior and maintains backward compatibility for existing web implementations.packages/features/bookings/components/event-meta/Members.tsx (3)
21-21
: LGTM! Well-documented prop addition.The
roundRobinHideOrgAndTeam
prop is properly typed as optional boolean and fits well with the existing interface structure.
30-30
: LGTM! Clean prop destructuring.The new prop is correctly destructured alongside existing props following the established pattern.
45-47
: LGTM! Effective implementation with good UX consideration.The early return pattern cleanly implements the feature requirement. The placeholder div with
h-6
class maintains consistent height to prevent layout shift when organization/team information is hidden.
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
E2E results are ready! |
@@ -80,6 +80,7 @@ const BookerComponent = ({ | |||
confirmButtonDisabled, | |||
timeZones, | |||
eventMetaChildren, | |||
roundRobinHideOrgAndTeam, |
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.
NIT: I would just rename this to hideOrgAndTeam
or something like hideOrgAndTeamInfo
, looking at the code changes there is no specific condition that only checks if we do it for round robin only thats why. and if this only happens for round robin maybe we do something likehideOrgAndTeamForRoundRobin
what do you think?
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.
Great catch! In commit fix: enable roundRobinHideOrgAndTeam only for round robin i added a check to enable likehideOrgAndTeamForRoundRobin
only if scheduling type is round robin.
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.
LGTM!
* feat: toggle round robin booker org and team * chore: add changeset * dont hide in dev
Linear CAL-6214