Skip to content

Conversation

@tomerqodo
Copy link

Benchmark PR from qodo-benchmark#708

@greptile-apps
Copy link

greptile-apps bot commented Jan 21, 2026

Greptile Summary

  • Refactors codebase architecture by moving WebWrapper components from packages/platform to apps/web/modules for better separation of web-specific and platform-agnostic code
  • Consolidates host sorting logic by extracting sortHosts function from component files into shared utility @calcom/lib/bookings/hostGroupUtils
  • Updates all import paths throughout the codebase to reflect new file locations, changing from absolute package imports to relative imports where appropriate

Important Files Changed

Filename Overview
apps/web/modules/bookings/components/BookerWebWrapper.tsx Critical error: file uses undefined router variable after removing useRouter import, will cause runtime crashes
packages/platform/atoms/package.json Removes WebWrapper component exports from platform package API, adds event-type hooks exports
packages/lib/bookings/hostGroupUtils.ts Adds new sortHosts utility function for host prioritization and weight-based sorting
apps/web/modules/event-types/components/EventTypeWebWrapper.tsx Moved from platform package with import path updates and minor formatting inconsistencies
apps/web/modules/event-types/components/tabs/assignment/EventTeamAssignmentTabWebWrapper.tsx Moved from platform package with simple relative import path updates

Confidence score: 1/5

  • This PR contains a critical runtime error that will cause immediate crashes in the BookerWebWrapper component due to undefined router variable usage
  • Score reflects the presence of this blocking issue that prevents the code from executing properly after the refactoring
  • Pay close attention to apps/web/modules/bookings/components/BookerWebWrapper.tsx which needs the missing useRouter import and proper router implementation

Sequence Diagram

sequenceDiagram
    participant User
    participant BookerWebWrapper
    participant BookerStoreProvider
    participant BookerComponent
    participant NextAuth
    participant EventAPI
    participant BookingAPI

    User->>BookerWebWrapper: "Navigate to booking page"
    BookerWebWrapper->>BookerStoreProvider: "Initialize store provider"
    BookerStoreProvider->>BookerWebWrapper: "Store context ready"
    
    BookerWebWrapper->>NextAuth: "Get user session"
    NextAuth-->>BookerWebWrapper: "Session data"
    
    BookerWebWrapper->>EventAPI: "Fetch event data"
    EventAPI-->>BookerWebWrapper: "Event details"
    
    BookerWebWrapper->>BookerWebWrapper: "Initialize booker layout"
    BookerWebWrapper->>BookerWebWrapper: "Setup booking form"
    BookerWebWrapper->>BookerWebWrapper: "Initialize calendars"
    BookerWebWrapper->>BookerWebWrapper: "Fetch available slots"
    
    BookerWebWrapper->>BookerComponent: "Render booking interface"
    BookerComponent-->>User: "Show booking form"
    
    User->>BookerComponent: "Fill booking form"
    BookerComponent->>BookerWebWrapper: "Handle booking submission"
    
    BookerWebWrapper->>BookingAPI: "Create booking"
    BookingAPI-->>BookerWebWrapper: "Booking confirmed"
    BookerWebWrapper-->>User: "Show booking confirmation"
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.

30 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

import { useSession } from "next-auth/react";
import { useSearchParams, usePathname, useRouter } from "next/navigation";
import { useMemo, useCallback, useEffect, useRef } from "react";
import { useSearchParams, usePathname } from "next/navigation";
Copy link

Choose a reason for hiding this comment

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

logic: useRouter import was removed but router variable is still used on lines 193, 228, 232, 238

Suggested change
import { useSearchParams, usePathname } from "next/navigation";
import { useSearchParams, usePathname, useRouter } from "next/navigation";
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/modules/bookings/components/BookerWebWrapper.tsx
Line: 4:4

Comment:
**logic:** `useRouter` import was removed but `router` variable is still used on lines 193, 228, 232, 238

```suggestion
import { useSearchParams, usePathname, useRouter } from "next/navigation";
```

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

Comment on lines 235 to +250
setup: (
<EventSetupTab
eventType={eventType}
locationOptions={locationOptions}
team={team}
teamMembers={teamMembers}
destinationCalendar={destinationCalendar}
/>
<EventSetupTab
eventType={eventType}
locationOptions={locationOptions}
team={team}
teamMembers={teamMembers}
destinationCalendar={destinationCalendar}
/>
),
availability: (
<EventAvailabilityTab
eventType={eventType}
isTeamEvent={!!team}
user={user}
teamMembers={teamMembers}
/>
<EventAvailabilityTab
eventType={eventType}
isTeamEvent={!!team}
user={user}
teamMembers={teamMembers}
/>
Copy link

Choose a reason for hiding this comment

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

style: formatting changed from 2-space to 4-space indentation inconsistently

Suggested change
setup: (
<EventSetupTab
eventType={eventType}
locationOptions={locationOptions}
team={team}
teamMembers={teamMembers}
destinationCalendar={destinationCalendar}
/>
<EventSetupTab
eventType={eventType}
locationOptions={locationOptions}
team={team}
teamMembers={teamMembers}
destinationCalendar={destinationCalendar}
/>
),
availability: (
<EventAvailabilityTab
eventType={eventType}
isTeamEvent={!!team}
user={user}
teamMembers={teamMembers}
/>
<EventAvailabilityTab
eventType={eventType}
isTeamEvent={!!team}
user={user}
teamMembers={teamMembers}
/>
setup: (
<EventSetupTab
eventType={eventType}
locationOptions={locationOptions}
team={team}
teamMembers={teamMembers}
destinationCalendar={destinationCalendar}
/>
),
availability: (
<EventAvailabilityTab
eventType={eventType}
isTeamEvent={!!team}
user={user}
teamMembers={teamMembers}
/>

Context Used: Context from dashboard - .cursor/rules/review.mdc (source)

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: apps/web/modules/event-types/components/EventTypeWebWrapper.tsx
Line: 235:250

Comment:
**style:** formatting changed from 2-space to 4-space indentation inconsistently

```suggestion
    setup: (
      <EventSetupTab
        eventType={eventType}
        locationOptions={locationOptions}
        team={team}
        teamMembers={teamMembers}
        destinationCalendar={destinationCalendar}
      />
    ),
    availability: (
      <EventAvailabilityTab
        eventType={eventType}
        isTeamEvent={!!team}
        user={user}
        teamMembers={teamMembers}
      />
```

**Context Used:** Context from `dashboard` - .cursor/rules/review.mdc ([source](https://app.greptile.com/review/custom-context?memory=b9795762-a033-4de8-936a-aa84dda179db))

<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.

Comment on lines +3 to +4
import { AtomsWrapper } from "../../../../packages/platform/atoms/src/components/atoms-wrapper";
import { DestinationCalendarSettings } from "../../../../packages/platform/atoms/destination-calendar/DestinationCalendar";
Copy link

Choose a reason for hiding this comment

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

style: Long relative import paths introduced - consider using TypeScript path mapping or workspace aliases for cleaner imports

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: apps/web/components/apps/DestinationCalendarSettingsWebWrapper.tsx
Line: 3:4

Comment:
**style:** Long relative import paths introduced - consider using TypeScript path mapping or workspace aliases for cleaner imports

<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.

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.

2 participants