-
Notifications
You must be signed in to change notification settings - Fork 10.8k
feat: remove Cal.ai tab from navigation while preserving URL access #23894
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
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
WalkthroughRefactors tab navigation logic to derive a local eventTypeId from formMethods.getValues("id") and use it consistently for building navigation data and hrefs. Updates getNavigation and tab hrefs (recurring, availability, team, webhooks) to use eventTypeId. Removes the previously hidden "Cal.ai" tab and its associated navigation push logic. Expands dependencies for useMemo and effects to include eventTypeId, eventType.id, and formMethods, ensuring recomputation when the event type id changes. No exported/public API changes. Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
The latest updates on your projects. Learn more about Vercel for GitHub. |
This PR is being marked as stale due to inactivity. |
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/platform/atoms/event-types/hooks/useTabsNavigations.tsx (1)
133-133
: Fix inconsistent ID reference in instant tab href.All other tab hrefs use
eventTypeId
(derived fromformMethods.getValues("id")
), but the instant tab useseventType.id
from props. This inconsistency could cause mismatched URLs if the prop and form values diverge.Apply this diff to use
eventTypeId
consistently:- href: `/event-types/${eventType.id}?tabName=instant`, + href: `/event-types/${eventTypeId}?tabName=instant`,
🧹 Nitpick comments (1)
packages/platform/atoms/event-types/hooks/useTabsNavigations.tsx (1)
74-75
: Consider extractingeventTypeId
inside theuseMemo
for cleaner reactivity.Extracting
eventTypeId
at the component level works but creates an inefficient update pattern: whenformMethods
changes, the component re-renders,eventTypeId
recalculates, thenuseMemo
re-runs because bothformMethods
andeventTypeId
changed. A cleaner pattern would be to deriveeventTypeId
directly inside theuseMemo
block, or useformMethods.watch("id")
if reactive updates are needed before the next render.Apply this diff to extract
eventTypeId
inside theuseMemo
:- const eventTypeId = formMethods.getValues("id"); - const EventTypeTabs = useMemo(() => { + const eventTypeId = formMethods.getValues("id"); const navigation: VerticalTabItemProps[] = getNavigation({Then remove
eventTypeId
from the dependencies array at line 160 (it's no longer needed since it's computed inside the memoized function).
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (1)
packages/platform/atoms/event-types/hooks/useTabsNavigations.tsx
(5 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/atoms/event-types/hooks/useTabsNavigations.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/atoms/event-types/hooks/useTabsNavigations.tsx
**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.
Files:
packages/platform/atoms/event-types/hooks/useTabsNavigations.tsx
🔇 Additional comments (1)
packages/platform/atoms/event-types/hooks/useTabsNavigations.tsx (1)
148-167
: Dependency additions look correct given the current implementation.Adding
eventTypeId
(line 160),eventType.id
(line 165), andformMethods
(line 166) to the dependencies ensures the memoized navigation re-computes when these values change. However, note that ifeventTypeId
is moved inside theuseMemo
as suggested above, remove it from the dependencies array.
- Remove Cal.ai tab from event type navigation as functionality moved to workflows - Preserve backwards compatibility by keeping URL routing intact - Cal.ai banner already shows on workflows tab - Fix ESLint warnings by extracting complex expression and adding missing dependencies Co-Authored-By: [email protected] <[email protected]>
- Import and render CalAiBanner component in EventWorkflowsTab - Banner shows at top of workflows tab content for better visibility - Completes the task of moving Cal.ai functionality to workflows tab Co-Authored-By: [email protected] <[email protected]>
aabbab5
to
31372a0
Compare
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, tab is gone but manual URL update still works.
E2E results are ready! |
What does this PR do?
This PR implements two related changes to the Cal.ai integration in event types:
Adds Cal.ai Banner to Workflows Tab: Displays the same "Supercharge your Workflows with Cal.ai" banner that appears on
/event-types
to the workflows tab page (/event-types/{id}?tabName=workflows
)Removes Cal.ai Tab from Navigation: Completely removes the Cal.ai tab from the event types navigation while preserving URL access for backward compatibility
Link to Devin run: https://app.devin.ai/sessions/34ef1c121af3471bbe83b120b02327fe
Requested by: @PeerRich
Key Changes
Banner Addition (
EventWorkflowsTab.tsx
)CalAiBanner
component from@calcom/features/shell/CalAiBanner
<CalAiBanner />
component after theLicenseRequired
wrapperTab Removal (
useTabsNavigations.tsx
)eventTypeId
variable to avoid repeatedformMethods.getValues("id")
callsCritical items to verify:
/event-types/{id}?tabName=ai
URL still works for existing bookmarks/links, even though tab is removed from navigationTesting limitation:⚠️ Local testing was limited due to authentication issues, so visual functionality wasn't fully verified.
How should this be tested?
Banner functionality:
/event-types/{id}?tabName=workflows
Navigation changes:
/event-types/{id}?tabName=ai
URL still works directly (backward compatibility)Layout verification:
Mandatory Tasks (DO NOT REMOVE)