-
Notifications
You must be signed in to change notification settings - Fork 0
fix(companion): event type links for org user #70
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
base: copilot_combined_20260121_qodo_grep_cursor_copilot_1_base_fixcompanion_event_type_links_for_org_user_pr706
Are you sure you want to change the base?
Conversation
Addresses Cubic AI review feedback (confidence 9/10): The username was hardcoded to 'username' but still used by BasicsTab as a fallback for URL display when bookingUrl is unavailable. This restores the useEffect that fetches the actual username from CalComAPIService.getUsername(). Co-Authored-By: unknown <>
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.
Pull request overview
This PR adds support for organization-specific booking URLs by introducing a bookingUrl field to the EventType interface. The change ensures that event types belonging to organization users display and use the correct booking URL (e.g., i.cal.com/org/user/event) instead of constructing it manually from username and slug.
Changes:
- Added
bookingUrloptional field to EventType interface and all related type definitions - Updated all booking URL construction logic to prefer
bookingUrlover manually constructed URLs - Removed
buildEventTypeLinkfunction and refactoredgetUsernamehelper in API service - Updated UI components to display and use the booking URL from the API response
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| companion/services/types/event-types.types.ts | Added bookingUrl optional field to EventType interface |
| companion/services/calcom.ts | Removed buildEventTypeLink, refactored getUsername with error handling |
| companion/extension/lib/linkedin.ts | Updated buildBookingUrl to prefer bookingUrl field |
| companion/extension/entrypoints/content.ts | Added bookingUrl to event type interfaces and updated URL construction logic (with one inconsistency) |
| companion/extension/entrypoints/background/index.ts | Added biome-ignore comment for Safari compatibility |
| companion/components/event-type-list-item/EventTypeListItemParts.tsx | Added getDisplayUrl helper to parse and display booking URLs |
| companion/components/event-type-list-item/EventTypeListItem.tsx | Passed bookingUrl prop to child components |
| companion/components/event-type-list-item/EventTypeListItem.ios.tsx | Passed bookingUrl prop to child components |
| companion/components/event-type-detail/tabs/*.tsx | Added redundant style props and updated Switch wrapper styling |
| companion/components/event-type-detail/tabs/BasicsTab.tsx | Added URL parsing logic to display proper domain prefix |
| companion/components/Header.tsx | Changed active filter colors from blue to black, added redundant style props |
| companion/app/profile-sheet.tsx | Removed border from profile header |
| companion/app/profile-sheet.ios.tsx | Removed border from profile header |
| companion/app/(tabs)/(event-types)/index.tsx | Updated handlers to use bookingUrl with error handling, added redundant style props |
| companion/app/(tabs)/(event-types)/index.ios.tsx | Updated handlers to use bookingUrl, removed unused imports |
| companion/app/(tabs)/(event-types)/event-type-detail.tsx | Added bookingUrl state and updated handlers (state never populated) |
| companion/app/(tabs)/(bookings)/index.tsx | Changed filter color from blue to black, added redundant style props |
| companion/app/(tabs)/(bookings)/index.ios.tsx | Changed filter colors from blue to black |
| companion/app/(tabs)/(availability)/availability-detail.tsx | Changed icon color from blue to black |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /> | ||
| <TouchableOpacity | ||
| className="min-w-[60px] flex-row items-center justify-center gap-1 rounded-lg bg-black px-2.5 py-2" | ||
| style={{ flexDirection: "row", alignItems: "center", justifyContent: "center" }} |
Copilot
AI
Jan 21, 2026
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.
The style prop duplicates the flexDirection, alignItems, and justifyContent properties that are already set in the className. The className already includes "flex-row items-center justify-center", which applies these same styles. This duplication is redundant and could lead to confusion.
| style={{ flexDirection: "row", alignItems: "center", justifyContent: "center" }} |
| const bookingUrl = `https://cal.com/${ | ||
| eventType.users?.[0]?.username || "user" | ||
| }/${eventType.slug}`; | ||
| const bookingUrl = |
Copilot
AI
Jan 21, 2026
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.
The copy button handler is not using the bookingUrl field from the eventType. Unlike the preview button handler above (lines 1081-1085), this handler constructs the URL manually. This should check for eventType.bookingUrl first, similar to the pattern used in other places in this PR.
| const bookingUrl = | |
| const bookingUrl = | |
| eventType.bookingUrl || |
| const [eventTypeData, setEventTypeData] = useState<EventType | null>(null); | ||
| const [bookingUrl, setBookingUrl] = useState<string>(""); | ||
| const [saving, setSaving] = useState(false); | ||
| const [beforeEventBuffer, setBeforeEventBuffer] = useState("No buffer time"); |
Copilot
AI
Jan 21, 2026
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.
The bookingUrl state is declared but never populated from the fetched event type data. The applyEventTypeData function (which loads event type data into state) does not extract the bookingUrl field from the EventType object. This means the preview and copy link handlers will always show "Booking URL not available" errors even when the API returns a valid bookingUrl. The bookingUrl should be extracted from the fetched event type data, similar to how other fields are loaded.
| const [eventTypeData, setEventTypeData] = useState<EventType | null>(null); | |
| const [bookingUrl, setBookingUrl] = useState<string>(""); | |
| const [saving, setSaving] = useState(false); | |
| const [beforeEventBuffer, setBeforeEventBuffer] = useState("No buffer time"); | |
| const [eventTypeData, setEventTypeData] = useState<(EventType & { bookingUrl?: string }) | null>(null); | |
| const [bookingUrl, setBookingUrl] = useState<string>(""); | |
| const [saving, setSaving] = useState(false); | |
| const [beforeEventBuffer, setBeforeEventBuffer] = useState("No buffer time"); | |
| useEffect(() => { | |
| if (eventTypeData?.bookingUrl) { | |
| setBookingUrl(eventTypeData.bookingUrl); | |
| } | |
| }, [eventTypeData]); |
| <View | ||
| className={`flex-row items-center pr-4 ${!isLast ? "border-b border-[#E5E5E5]" : ""}`} | ||
| style={{ minHeight: 44 }} | ||
| style={{ minHeight: 44, flexDirection: "row", alignItems: "center" }} |
Copilot
AI
Jan 21, 2026
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.
The style prop duplicates the flexDirection and alignItems properties that are already set in the className. The className already includes "flex-row items-center", which applies these same styles. This duplication is redundant and could lead to confusion.
| style={{ minHeight: 44, flexDirection: "row", alignItems: "center" }} | |
| style={{ minHeight: 44 }} |
| <View | ||
| className={`flex-row items-center pr-4 ${!isLast ? "border-b border-[#E5E5E5]" : ""}`} | ||
| style={{ height }} | ||
| style={{ height, flexDirection: "row", alignItems: "center" }} |
Copilot
AI
Jan 21, 2026
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.
The style prop duplicates the flexDirection and alignItems properties that are already set in the className. The className already includes "flex-row items-center", which applies these same styles. This duplication is redundant and could lead to confusion.
| style={{ height, flexDirection: "row", alignItems: "center" }} | |
| style={{ height }} |
| flexDirection: "row", | ||
| alignItems: "center", |
Copilot
AI
Jan 21, 2026
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.
The style prop duplicates the flexDirection and alignItems properties that are already set in the className. The className already includes "flex-row items-center", which applies these same styles. This duplication is redundant and could lead to confusion.
| flexDirection: "row", | |
| alignItems: "center", |
| <View | ||
| className={`flex-row items-center pr-4 ${!isLast ? "border-b border-[#E5E5E5]" : ""}`} | ||
| style={{ height: 44 }} | ||
| style={{ height: 44, flexDirection: "row", alignItems: "center" }} |
Copilot
AI
Jan 21, 2026
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.
The style prop duplicates the flexDirection and alignItems properties that are already set in the className. The className already includes "flex-row items-center", which applies these same styles. This duplication is redundant and could lead to confusion.
| style={{ height: 44, flexDirection: "row", alignItems: "center" }} | |
| style={{ height: 44 }} |
| <View | ||
| className={`flex-row items-center pr-4 ${!isLast ? "border-b border-[#E5E5E5]" : ""}`} | ||
| style={{ height }} | ||
| style={{ height, flexDirection: "row", alignItems: "center" }} |
Copilot
AI
Jan 21, 2026
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.
The style prop duplicates the flexDirection and alignItems properties that are already set in the className. The className already includes "flex-row items-center", which applies these same styles. This duplication is redundant and could lead to confusion.
| style={{ height, flexDirection: "row", alignItems: "center" }} | |
| style={{ height }} |
| <Text className="text-[16px] font-semibold text-[#007AFF]"> | ||
| <AppPressable | ||
| className="flex-row items-center gap-1 px-2 py-2" | ||
| style={{ flexDirection: "row", alignItems: "center" }} |
Copilot
AI
Jan 21, 2026
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.
The style prop duplicates the flexDirection and alignItems properties that are already set in the className. The className already includes "flex-row items-center", which applies these same styles. This duplication is redundant and could lead to confusion.
| style={{ flexDirection: "row", alignItems: "center" }} |
| <AppPressable | ||
| className="flex-row items-center gap-1 px-2 py-2" | ||
| style={{ flexDirection: "row", alignItems: "center" }} | ||
| > |
Copilot
AI
Jan 21, 2026
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.
The style prop duplicates the flexDirection and alignItems properties that are already set in the className. The className already includes "flex-row items-center", which applies these same styles. This duplication is redundant and could lead to confusion.
| <AppPressable | |
| className="flex-row items-center gap-1 px-2 py-2" | |
| style={{ flexDirection: "row", alignItems: "center" }} | |
| > | |
| <AppPressable className="flex-row items-center gap-1 px-2 py-2"> |
Benchmark PR from qodo-benchmark#706