Skip to content

Conversation

supalarry
Copy link
Contributor

Linear CAL-6214

@supalarry supalarry requested review from a team as code owners August 7, 2025 12:32
Copy link

linear bot commented Aug 7, 2025

Copy link
Contributor

coderabbitai bot commented Aug 7, 2025

Walkthrough

A 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, roundRobinHideOrgAndTeam, across relevant type definitions and component props. The prop is passed through the booking flow from the BookerPlatformWrapper and BookerComponent down to EventMeta and finally to EventMembers. When this prop is true, EventMembers suppresses rendering of organization and team avatars and member info by returning an empty placeholder div. The change includes updates to type definitions to support this prop and an example page where the prop usage is commented out.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Assessment against linked issues

Objective Addressed Explanation
Expose a new prop roundRobinHideOrgAndTeam to hide org/team info in booker (CAL-6214)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes were found.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 07293a5 and 7388d1d.

📒 Files selected for processing (1)
  • docs/platform/atoms/booker.mdx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/platform/atoms/booker.mdx
⏰ 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: Install dependencies / Yarn install & cache
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch lauris/cal-6214-feat-toggle-round-robin-org-in-booker

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@graphite-app graphite-app bot requested a review from a team August 7, 2025 12:32
@keithwillcode keithwillcode added core area: core, team members only platform Anything related to our platform plan labels Aug 7, 2025
@dosubot dosubot bot added bookings area: bookings, availability, timezones, double booking teams area: teams, round robin, collective, managed event-types ✨ feature New feature or request labels Aug 7, 2025
Copy link

graphite-app bot commented Aug 7, 2025

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.

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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 33aedba and 1473e6d.

📒 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 use include, always use select
Ensure the credential.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 for roundRobinHideOrgAndTeam 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.

Copy link

vercel bot commented Aug 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Aug 8, 2025 8:07am
cal-eu ⬜️ Ignored (Inspect) Aug 8, 2025 8:07am

Copy link
Contributor

github-actions bot commented Aug 7, 2025

E2E results are ready!

@@ -80,6 +80,7 @@ const BookerComponent = ({
confirmButtonDisabled,
timeZones,
eventMetaChildren,
roundRobinHideOrgAndTeam,
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@supalarry supalarry requested a review from Ryukemeister August 8, 2025 08:08
Copy link
Contributor

@Ryukemeister Ryukemeister left a comment

Choose a reason for hiding this comment

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

LGTM!

@supalarry supalarry merged commit d18e233 into main Aug 8, 2025
35 of 36 checks passed
@supalarry supalarry deleted the lauris/cal-6214-feat-toggle-round-robin-org-in-booker branch August 8, 2025 08:25
Pallava-Joshi pushed a commit to Pallava-Joshi/cal.com that referenced this pull request Aug 8, 2025
* feat: toggle round robin booker org and team

* chore: add changeset

* dont hide in dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bookings area: bookings, availability, timezones, double booking core area: core, team members only ✨ feature New feature or request platform Anything related to our platform plan ready-for-e2e teams area: teams, round robin, collective, managed event-types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants