cal.diy icon indicating copy to clipboard operation
cal.diy copied to clipboard

fix: hide Preview/Copy Link in mobile menu when isPlatform=true

Open taneja-garvit opened this issue 1 year ago • 2 comments

What does this PR do?

Fixes inconsistency in mobile menu for EventTypeSettings when using Platform API atoms. The desktop view correctly hides "Preview" and "Copy Link" buttons when isPlatform={true}, but the mobile dropdown menu (three dots) was showing these options regardless of the isPlatform flag.

Changes:

  • Wrapped "Preview" and "Copy Link" menu items in mobile dropdown with !isPlatform check
  • Ensures consistent UX between desktop and mobile views when using Platform API
  • Matches the existing desktop implementation behavior

Why this matters: When using Cal.com atoms in a custom React app with OAuth clients, these links should not appear because they would point to incorrect URLs (cal.com instead of the configured booking redirect URI). This fix ensures the mobile menu behavior matches the desktop implementation.

Visual Demo

Before:

  • Mobile menu showed "Preview" and "Copy Link" even when isPlatform={true}
  • Inconsistent with desktop behavior where these buttons are hidden

After:

  • Mobile menu hides "Preview" and "Copy Link" when isPlatform={true}
  • Consistent behavior across desktop and mobile views

Mandatory Tasks

  • [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 - no documentation changes needed
  • [x] I confirm automated tests are in place that prove my fix is effective or that my feature works. N/A - this is a UI consistency fix that aligns mobile with existing desktop behavior

How should this be tested?

  1. Open EventTypeSettings in a custom React app using Cal.com atoms with isPlatform={true}
  2. Switch to mobile view (responsive mode or actual mobile device, viewport < 1024px)
  3. Click the three dots menu (⋯) next to the Save button
  4. Expected: "Preview" and "Copy Link" options should NOT appear in the menu
  5. Expected: Only "Delete" and other non-platform-specific options should be visible
  6. Verify desktop view still works correctly (buttons hidden when isPlatform={true})

Test Configuration:

  • Use a custom React app with EventTypeSettings atom component
  • Set isPlatform={true} prop
  • Test on mobile viewport (< 1024px width)

Checklist

  • I have read the [contributing guide
  • My code follows the style guidelines of this project
  • I have checked if my changes generate no new warnings

taneja-garvit avatar Nov 19 '25 19:11 taneja-garvit

@taneja-garvit is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Nov 19 '25 19:11 vercel[bot]

This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active.

github-actions[bot] avatar Nov 27 '25 00:11 github-actions[bot]