-
Notifications
You must be signed in to change notification settings - Fork 0
fix(companion): event type links for org user #84
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: greptile_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 <>
Greptile Summary
Important Files Changed
Confidence score: 4/5
Sequence DiagramsequenceDiagram
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
|
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.
21 files reviewed, 6 comments
| <View | ||
| className={`flex-row items-center pr-4 ${!isLast ? "border-b border-[#E5E5E5]" : ""}`} | ||
| style={{ minHeight: 44 }} | ||
| style={{ minHeight: 44, flexDirection: "row", alignItems: "center" }} |
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.
style: redundant styles - flexDirection: "row" and alignItems: "center" duplicate existing Tailwind classes flex-row items-center
| 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}`; |
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.
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" }} |
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.
style: Redundant inline styles duplicate existing TailwindCSS classes - flexDirection: "row" and alignItems: "center" are already applied by flex-row and items-center classes
| 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>(""); |
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.
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.| const bookingUrl = | ||
| `https://cal.com/${ | ||
| eventType.users?.[0]?.username || "user" | ||
| }/${eventType.slug}`; |
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.
syntax: Missing eventType.bookingUrl in fallback URL construction - should use same pattern as other locations
| 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" }} |
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.
style: redundant inline styles - flexDirection: "row" and alignItems: "center" are already set via className
| 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.
Benchmark PR from qodo-benchmark#706