Skip to content

Conversation

@tomerqodo
Copy link

Benchmark PR from qodo-benchmark#706

dhairyashiil and others added 7 commits January 21, 2026 15:42
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 <>
@greptile-apps
Copy link

greptile-apps bot commented Jan 21, 2026

Greptile Summary

  • Fixes companion app event type link generation for organization users by replacing client-side URL construction with bookingUrl field from API responses
  • Updates UI styling throughout the companion app to use black color scheme instead of iOS blue for improved visual consistency
  • Adds comprehensive error handling and null checks when bookingUrl is not available to prevent runtime failures

Important Files Changed

Filename Overview
companion/services/calcom.ts Removed buildEventTypeLink function that was causing incorrect URL generation for org users
companion/services/types/event-types.types.ts Added optional bookingUrl property to EventType interface to support pre-computed booking URLs
companion/components/event-type-list-item/EventTypeListItemParts.tsx Introduced getDisplayUrl utility function with bookingUrl support and fallback logic
companion/app/(tabs)/(event-types)/index.tsx Replaced dynamic link building with direct bookingUrl usage and added comprehensive error handling
companion/components/Header.tsx Systematically replaced iOS blue (#007AFF) with black (#000000) across all interactive elements

Confidence score: 4/5

  • This PR addresses a legitimate issue with event type link generation for organization users
  • Score reflects the comprehensive nature of changes across multiple files and slight risk from removing functionality
  • Pay close attention to URL parsing logic in EventTypeListItemParts.tsx and error handling in event type components

Sequence Diagram

sequenceDiagram
    participant User
    participant EventTypesUI as "Event Types UI"
    participant CalComAPI as "CalComAPIService"
    participant API as "Cal.com API v2"
    participant Cache as "User Profile Cache"

    User->>EventTypesUI: "Open Event Types"
    EventTypesUI->>CalComAPI: "getEventTypes()"
    CalComAPI->>Cache: "Check _userProfile"
    
    alt Profile not cached
        CalComAPI->>API: "GET /me (2024-06-11)"
        API-->>CalComAPI: "UserProfile with username"
        CalComAPI->>Cache: "Store _userProfile"
    end
    
    CalComAPI->>API: "GET /event-types?username={username}&sortCreatedAt=desc (2024-06-14)"
    API-->>CalComAPI: "EventType[] with bookingUrl"
    CalComAPI-->>EventTypesUI: "EventType[] data"
    
    EventTypesUI->>EventTypesUI: "Render event type list"
    EventTypesUI->>User: "Display bookingUrl for each event"
    
    alt Copy Link Action
        User->>EventTypesUI: "Click Copy Link"
        EventTypesUI->>EventTypesUI: "Use event.bookingUrl from API"
        EventTypesUI->>User: "Copy to clipboard"
    end
    
    alt Preview Action
        User->>EventTypesUI: "Click Preview"
        EventTypesUI->>EventTypesUI: "Open event.bookingUrl"
    end
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

21 files reviewed, 6 comments

Edit Code Review Agent Settings | Greptile

<View
className={`flex-row items-center pr-4 ${!isLast ? "border-b border-[#E5E5E5]" : ""}`}
style={{ minHeight: 44 }}
style={{ minHeight: 44, flexDirection: "row", alignItems: "center" }}
Copy link

Choose a reason for hiding this comment

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

style: redundant styles - flexDirection: "row" and alignItems: "center" duplicate existing Tailwind classes flex-row items-center

Suggested change
style={{ minHeight: 44, flexDirection: "row", alignItems: "center" }}
style={{ minHeight: 44 }}

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: companion/components/event-type-detail/tabs/RecurringTab.tsx
Line: 92:92

Comment:
**style:** redundant styles - `flexDirection: "row"` and `alignItems: "center"` duplicate existing Tailwind classes `flex-row items-center`

```suggestion
        style={{ minHeight: 44 }}
```

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

// fallback if URL parsing fails
}
}
return username ? `/${username}/${slug}` : `/${slug}`;
Copy link

Choose a reason for hiding this comment

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

style: Edge case: when both username and slug are undefined/empty, this could return '//'. Consider adding validation.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: companion/components/event-type-list-item/EventTypeListItemParts.tsx
Line: 21:21

Comment:
**style:** Edge case: when both username and slug are undefined/empty, this could return '//'. Consider adding validation.

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

<View
className={`flex-row items-center pr-4 ${!isLast ? "border-b border-[#E5E5E5]" : ""}`}
style={{ height: 44 }}
style={{ height: 44, flexDirection: "row", alignItems: "center" }}
Copy link

Choose a reason for hiding this comment

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

style: Redundant inline styles duplicate existing TailwindCSS classes - flexDirection: "row" and alignItems: "center" are already applied by flex-row and items-center classes

Suggested change
style={{ height: 44, flexDirection: "row", alignItems: "center" }}
style={{ height: 44 }}

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: companion/components/event-type-detail/tabs/LimitsTab.tsx
Line: 127:127

Comment:
**style:** Redundant inline styles duplicate existing TailwindCSS classes - `flexDirection: "row"` and `alignItems: "center"` are already applied by `flex-row` and `items-center` classes

```suggestion
        style={{ height: 44 }}
```

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

const [conferencingOptions, setConferencingOptions] = useState<ConferencingOption[]>([]);
const [conferencingLoading, setConferencingLoading] = useState(false);
const [eventTypeData, setEventTypeData] = useState<EventType | null>(null);
const [bookingUrl, setBookingUrl] = useState<string>("");
Copy link

Choose a reason for hiding this comment

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

logic: bookingUrl state is declared but never populated - missing setter logic in data loading or save operations

Prompt To Fix With AI
This is a comment left during a code review.
Path: companion/app/(tabs)/(event-types)/event-type-detail.tsx
Line: 180:180

Comment:
**logic:** bookingUrl state is declared but never populated - missing setter logic in data loading or save operations

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +1125 to +1128
const bookingUrl =
`https://cal.com/${
eventType.users?.[0]?.username || "user"
}/${eventType.slug}`;
Copy link

Choose a reason for hiding this comment

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

syntax: Missing eventType.bookingUrl in fallback URL construction - should use same pattern as other locations

Suggested change
const bookingUrl =
`https://cal.com/${
eventType.users?.[0]?.username || "user"
}/${eventType.slug}`;
const bookingUrl =
eventType.bookingUrl ||
`https://cal.com/${
eventType.users?.[0]?.username || "user"
}/${eventType.slug}`;
Prompt To Fix With AI
This is a comment left during a code review.
Path: companion/extension/entrypoints/content.ts
Line: 1125:1128

Comment:
**syntax:** Missing eventType.bookingUrl in fallback URL construction - should use same pattern as other locations

```suggestion
                    const bookingUrl =
                      eventType.bookingUrl ||
                      `https://cal.com/${
                        eventType.users?.[0]?.username || "user"
                      }/${eventType.slug}`;
```

How can I resolve this? If you propose a fix, please make it concise.

<View
className={`flex-row items-center pr-4 ${!isLast ? "border-b border-[#E5E5E5]" : ""}`}
style={{ height }}
style={{ height, flexDirection: "row", alignItems: "center" }}
Copy link

Choose a reason for hiding this comment

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

style: redundant inline styles - flexDirection: "row" and alignItems: "center" are already set via className

Suggested change
style={{ height, flexDirection: "row", alignItems: "center" }}
style={{ height }}
Prompt To Fix With AI
This is a comment left during a code review.
Path: companion/components/event-type-detail/tabs/BasicsTab.tsx
Line: 205:205

Comment:
**style:** redundant inline styles - `flexDirection: "row"` and `alignItems: "center"` are already set via className

```suggestion
        style={{ height }}
```

How can I resolve this? If you propose a fix, please make it concise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants