Skip to content

Conversation

@tomerqodo
Copy link

@tomerqodo tomerqodo commented Jan 29, 2026

Benchmark PR from agentic-review-benchmarks#9

Summary by CodeRabbit

  • Refactor
    • Reorganized internal component architecture by restructuring module imports and refactoring component locations across event management and booking features.
    • Consolidated duplicate utilities to a shared library location to reduce code redundancy.
    • Updated internal package exports to reflect new component organization and removed deprecated export paths.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

Walkthrough

This pull request migrates WebWrapper components from the atoms package to web modules and consolidates the sortHosts utility function into a shared library. Import paths are updated across multiple files to reflect the new component locations, and package exports are reorganized accordingly.

Changes

Cohort / File(s) Summary
Booker Component Migration
apps/web/modules/bookings/components/BookerWebWrapper.tsx, apps/web/modules/d/[link]/d-type-view.tsx, apps/web/modules/org/[orgSlug]/instant-meeting/team/[slug]/[type]/instant-meeting-view.tsx, apps/web/modules/team/type-view-cached.tsx, apps/web/modules/team/type-view.tsx, apps/web/modules/users/views/users-type-public-view.tsx
Updated import paths for BookerWebWrapper from @calcom/atoms/booker to @calcom/web/modules/bookings/components/BookerWebWrapper. Removed useRouter hook dependency in BookerWebWrapper itself.
WebWrapper Import Path Updates
apps/web/app/(use-page-wrapper)/event-types/[type]/page.tsx, apps/web/app/(use-page-wrapper)/settings/(settings-layout)/my-account/conferencing/loading.tsx, apps/web/app/(use-page-wrapper)/settings/(settings-layout)/my-account/conferencing/page.tsx, apps/web/components/apps/CalendarListContainer.tsx, apps/web/modules/event-types/components/tabs/advanced/EventAdvancedTab.tsx
Updated import paths for various WebWrapper components (EventTypeWebWrapper, ConferencingAppsViewWebWrapper, SelectedCalendarsSettingsWebWrapper, SkeletonLoader) from atoms paths to web modules paths.
Event Type Component Restructuring
apps/web/modules/event-types/components/EventTypeWebWrapper.tsx, apps/web/modules/event-types/components/tabs/setup/EventSetupTabWebWrapper.tsx, apps/web/modules/event-types/components/tabs/advanced/EventAdvancedWebWrapper.tsx, apps/web/modules/event-types/components/tabs/assignment/EventTeamAssignmentTab.tsx, apps/web/modules/event-types/components/tabs/assignment/EventTeamAssignmentTabWebWrapper.tsx, apps/web/modules/event-types/components/tabs/availability/EventAvailabilityTab.tsx, apps/web/modules/event-types/components/tabs/availability/EventAvailabilityTabWebWrapper.tsx, apps/web/modules/event-types/components/tabs/limits/EventLimitsTabWebWrapper.tsx, apps/web/modules/event-types/components/tabs/recurring/EventRecurringWebWrapper.tsx
Consolidated event type tab components and wrappers with updated relative import paths for better module organization. Replaced external web module imports with local component references.
Calendar Components Updates
apps/web/components/apps/DestinationCalendarSettingsWebWrapper.tsx, apps/web/modules/calendars/components/SelectedCalendarsSettingsWebWrapper.tsx
Updated import paths for calendar-related wrapper components, changing from relative to absolute alias paths and vice versa depending on context.
Event Type Members Component
apps/web/modules/event-types/components/AddMembersWithSwitch.tsx, apps/web/modules/event-types/components/AddMembersWithSwitchWebWrapper.tsx
Converted absolute import path to relative import for AddMembersWithSwitch component within the wrapper.
Conferencing Apps Component
apps/web/modules/apps/components/ConferencingAppsViewWebWrapper.tsx
Replaced external imports with local relative imports for AppList and DisconnectIntegrationModal components.
Shared Utility Function Migration
packages/lib/bookings/hostGroupUtils.ts, apps/web/modules/event-types/components/HostEditDialogs.tsx, packages/platform/atoms/event-types/hooks/useEventTypeForm.ts, apps/web/modules/event-types/components/tabs/assignment/EventTeamAssignmentTab.tsx
Moved sortHosts function from HostEditDialogs to hostGroupUtils shared library. Updated all import references accordingly.
Package Exports Reorganization
packages/platform/atoms/booker/index.ts, packages/platform/atoms/package.json
Removed WebWrapper exports (BookerWebWrapper, AddMembersWithSwitchWebWrapper, ConferencingAppsViewWebWrapper, DestinationCalendarSettingsWebWrapper, EventTypeWebWrapper, SelectedCalendarsSettingsWebWrapper) from atoms package. Added new exports for hooks (useEventTypeForm, useHandleRouteChange, useTabsNavigations) and SelectedCalendarsSettings component.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Components hop from atoms to their web-bound home,
With sorted hosts and relative paths they now roam,
Tabs align neatly, wrappers reorganized with care,
A cozy refactor—everything in its rightful layer! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: moving WebWrapper files from packages/platform/atoms to apps/web/modules, which aligns with all the import path updates and file reorganizations shown in the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@apps/web/components/apps/DestinationCalendarSettingsWebWrapper.tsx`:
- Around line 3-4: Current imports bypass the package entry by importing
AtomsWrapper and DestinationCalendarSettings from deep source paths; update
imports to use the package entry and transpilation settings by replacing deep
imports with the public exports from packages/platform/atoms (use
DestinationCalendarSettingsPlatformWrapper for DestinationCalendarSettings and
the exported AtomsWrapper if added to the package entry), and add
`@calcom/platform-atoms` to the Next.js transpilePackages array in next.config.ts
(or alternatively add a tsconfig path alias pointing to the package entry) so
the module is transpiled in production.

In `@apps/web/modules/bookings/components/BookerWebWrapper.tsx`:
- Around line 4-6: The component BookerWebWrapper uses router but removed the
useRouter hook; re-add the import "useRouter" from "next/navigation" and declare
a router instance inside the component (e.g., const router = useRouter())
alongside other hooks (useSearchParams, usePathname, useMemo, etc.) so the
existing references to router (used in callbacks and effects) resolve and follow
React hook rules.
🧹 Nitpick comments (2)
apps/web/modules/event-types/components/tabs/availability/EventAvailabilityTab.tsx (1)

8-8: Potential circular import pattern.

EventAvailabilityTab.tsx imports a type from EventAvailabilityTabWebWrapper.tsx, while the wrapper file imports EventAvailabilityTab from this file. While TypeScript handles circular type imports, this pattern can cause issues if not carefully managed. Consider extracting shared types to a separate types file.

📁 Suggested types extraction

Create a shared types file like EventAvailabilityTab.types.ts:

// EventAvailabilityTab.types.ts
import type { trpc } from "@calcom/trpc/react";

export type GetAllSchedulesByUserIdQueryType =
  typeof trpc.viewer.availability.schedule.getAllSchedulesByUserId.useQuery;

// Move other shared types here...

Then both files can import from this central location.

apps/web/components/apps/CalendarListContainer.tsx (1)

6-7: Import path style inconsistency.

Line 6 uses a relative path (./DestinationCalendarSettingsWebWrapper) while Line 7 and all other imports in the file use the absolute alias pattern (@calcom/web/modules/calendars/components/SelectedCalendarsSettingsWebWrapper). Align Line 6 with the project's import convention by using @calcom/web/components/apps/DestinationCalendarSettingsWebWrapper.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8a76803 and 5ee1dfa.

📒 Files selected for processing (30)
  • apps/web/app/(use-page-wrapper)/event-types/[type]/page.tsx
  • apps/web/app/(use-page-wrapper)/settings/(settings-layout)/my-account/conferencing/loading.tsx
  • apps/web/app/(use-page-wrapper)/settings/(settings-layout)/my-account/conferencing/page.tsx
  • apps/web/components/apps/CalendarListContainer.tsx
  • apps/web/components/apps/DestinationCalendarSettingsWebWrapper.tsx
  • apps/web/modules/apps/components/ConferencingAppsViewWebWrapper.tsx
  • apps/web/modules/bookings/components/BookerWebWrapper.tsx
  • apps/web/modules/calendars/components/SelectedCalendarsSettingsWebWrapper.tsx
  • apps/web/modules/d/[link]/d-type-view.tsx
  • apps/web/modules/event-types/components/AddMembersWithSwitch.tsx
  • apps/web/modules/event-types/components/AddMembersWithSwitchWebWrapper.tsx
  • apps/web/modules/event-types/components/EventTypeWebWrapper.tsx
  • apps/web/modules/event-types/components/HostEditDialogs.tsx
  • apps/web/modules/event-types/components/tabs/advanced/EventAdvancedTab.tsx
  • apps/web/modules/event-types/components/tabs/advanced/EventAdvancedWebWrapper.tsx
  • apps/web/modules/event-types/components/tabs/assignment/EventTeamAssignmentTab.tsx
  • apps/web/modules/event-types/components/tabs/assignment/EventTeamAssignmentTabWebWrapper.tsx
  • apps/web/modules/event-types/components/tabs/availability/EventAvailabilityTab.tsx
  • apps/web/modules/event-types/components/tabs/availability/EventAvailabilityTabWebWrapper.tsx
  • apps/web/modules/event-types/components/tabs/limits/EventLimitsTabWebWrapper.tsx
  • apps/web/modules/event-types/components/tabs/recurring/EventRecurringWebWrapper.tsx
  • apps/web/modules/event-types/components/tabs/setup/EventSetupTabWebWrapper.tsx
  • apps/web/modules/org/[orgSlug]/instant-meeting/team/[slug]/[type]/instant-meeting-view.tsx
  • apps/web/modules/team/type-view-cached.tsx
  • apps/web/modules/team/type-view.tsx
  • apps/web/modules/users/views/users-type-public-view.tsx
  • packages/lib/bookings/hostGroupUtils.ts
  • packages/platform/atoms/booker/index.ts
  • packages/platform/atoms/event-types/hooks/useEventTypeForm.ts
  • packages/platform/atoms/package.json
💤 Files with no reviewable changes (1)
  • packages/platform/atoms/booker/index.ts
🔇 Additional comments (28)
apps/web/modules/event-types/components/tabs/recurring/EventRecurringWebWrapper.tsx (1)

8-8: Looks good.

Default export aligns with the wrapper component and keeps the module surface consistent.

apps/web/modules/event-types/components/AddMembersWithSwitch.tsx (1)

7-7: LGTM!

The import path change from @calcom/atoms/add-members-switch/AddMembersWithSwitchWebWrapper to the local relative path ./AddMembersWithSwitchWebWrapper is consistent with the PR objective of moving WebWrapper files to local modules.

apps/web/modules/event-types/components/AddMembersWithSwitchWebWrapper.tsx (1)

3-5: LGTM!

The import path changes from @calcom/web/modules/event-types/components/AddMembersWithSwitch to the local relative path ./AddMembersWithSwitch are consistent with the PR objective of consolidating module imports locally.

apps/web/app/(use-page-wrapper)/settings/(settings-layout)/my-account/conferencing/loading.tsx (1)

1-1: Import path correctly updated for the module migration.

The SkeletonLoader is properly exported from @calcom/web/modules/apps/components/ConferencingAppsViewWebWrapper and the import statement is valid. The component logic remains unchanged.

packages/platform/atoms/event-types/hooks/useEventTypeForm.ts (1)

11-11: Import update looks good. Centralizing sortHosts in the shared utility is a clean consolidation.

apps/web/modules/event-types/components/tabs/setup/EventSetupTabWebWrapper.tsx (1)

6-8: LGTM for the local import swap. No behavior change implied here.

apps/web/modules/apps/components/ConferencingAppsViewWebWrapper.tsx (1)

14-16: Local component imports look fine.

apps/web/app/(use-page-wrapper)/settings/(settings-layout)/my-account/conferencing/page.tsx (1)

4-4: Import path update looks good.

apps/web/modules/event-types/components/tabs/limits/EventLimitsTabWebWrapper.tsx (1)

8-8: LGTM.

apps/web/modules/bookings/components/BookerWebWrapper.tsx (1)

35-35: Local Booker import looks good.

apps/web/modules/d/[link]/d-type-view.tsx (1)

3-3: LGTM: import path migration is consistent.
Line 3 cleanly switches BookerWebWrapper to the web/modules location.

apps/web/modules/org/[orgSlug]/instant-meeting/team/[slug]/[type]/instant-meeting-view.tsx (1)

5-5: LGTM: import path migration is consistent.
Line 5 update aligns with the new web/modules path.

apps/web/modules/team/type-view.tsx (1)

6-6: LGTM: import path migration is consistent.
Line 6 change matches the repo-wide BookerWebWrapper move.

apps/web/modules/users/views/users-type-public-view.tsx (1)

6-6: LGTM: import path migration is consistent.
Line 6 is a clean switch to the web/modules path.

apps/web/modules/team/type-view-cached.tsx (1)

3-3: LGTM: import path migration is consistent.
Line 3 update aligns the wrapper and type with the new web/modules location.

packages/lib/bookings/hostGroupUtils.ts (1)

41-60: LGTM! Clean centralization of the sortHosts utility.

The sorting logic is clear:

  • When isRRWeightsEnabled: Higher weight takes precedence; equal weights fall back to lower priority number winning
  • When disabled: Higher priority number wins

The default values (weight: 100, priority: 2) provide sensible fallbacks for null values.

apps/web/modules/event-types/components/HostEditDialogs.tsx (1)

13-13: LGTM! Import consolidation is correct.

The sortHosts function is now imported from the shared utility module alongside the related host grouping functions, improving code organization and eliminating duplication.

apps/web/modules/calendars/components/SelectedCalendarsSettingsWebWrapper.tsx (1)

15-15: LGTM! Import path updated to use the new atoms export.

The import now uses the explicit @calcom/atoms/selected-calendars/SelectedCalendarsSettings path, which aligns with the newly added export in the atoms package.

apps/web/modules/event-types/components/tabs/advanced/EventAdvancedTab.tsx (1)

9-13: LGTM! Import path correctly updated to web modules.

The SelectedCalendarsSettingsWebWrapper and related exports are now imported from the web modules path (@calcom/web/modules/calendars/components/), consistent with the PR's goal of relocating WebWrapper components.

apps/web/modules/event-types/components/tabs/advanced/EventAdvancedWebWrapper.tsx (1)

3-5: LGTM! Appropriate use of relative imports for co-located files.

Using relative imports (./EventAdvancedTab) for files in the same directory is cleaner and reduces dependency on alias configurations.

packages/platform/atoms/package.json (1)

59-74: No issues found. The WebWrapper exports mentioned in the original comment were never part of the @calcom/atoms package exports. All WebWrapper components exist in @calcom/web modules and are imported from there. The atoms package exports only the PlatformWrapper component (AddMembersWithSwitchPlatformWrapper) and various hooks and components, none of which were removed in this change.

Likely an incorrect or invalid review comment.

apps/web/app/(use-page-wrapper)/event-types/[type]/page.tsx (1)

9-9: LGTM!

The import path update for EventTypeWebWrapper aligns with the PR objective to consolidate WebWrapper files in apps/web/modules. The component usage remains unchanged.

apps/web/modules/event-types/components/tabs/assignment/EventTeamAssignmentTabWebWrapper.tsx (1)

1-4: LGTM!

The import change to a relative path (./EventTeamAssignmentTab) is appropriate for co-located files in the same directory. The wrapper logic remains unchanged.

apps/web/modules/event-types/components/tabs/availability/EventAvailabilityTabWebWrapper.tsx (1)

8-10: LGTM!

The import path updates use appropriate relative paths for co-located modules. The TeamMembers type import navigates correctly to the parent EventType module.

apps/web/modules/event-types/components/tabs/assignment/EventTeamAssignmentTab.tsx (1)

17-17: LGTM! Moving sortHosts to @calcom/lib/bookings/hostGroupUtils is a good refactoring choice. Centralizing utility functions in a shared library improves maintainability and reduces duplication.

apps/web/modules/event-types/components/EventTypeWebWrapper.tsx (3)

24-31: Imports aligned with the new module layout.
Looks consistent with the refactor targets.


236-251: Formatting-only change in tabMap.
No functional concerns here.


48-90: All dynamic imports are correctly configured and will resolve properly at runtime.

All modules export either a default export or a named export that matches the import pattern:

  • Modules with default exports use bare import() or .then((mod) => mod)
  • Modules with named exports use .then((mod) => mod.NamedExport) correctly

No changes needed.

Likely an incorrect or invalid review comment.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify Next.js transpilation settings and path aliases relevant to packages/platform/atoms.

echo "== next.config files =="
fd -a 'next.config' -E node_modules -E .next

for f in $(fd -a 'next.config' -E node_modules -E .next); do
  echo "---- $f ----"
  rg -n "transpilePackages|externalDir|outputFileTracingRoot" "$f" || true
done

echo "== tsconfig path aliases =="
for f in $(fd -a 'tsconfig*.json' -E node_modules -E .next); do
  echo "---- $f ----"
  rg -n "\"@calcom/|packages/platform/atoms\"" "$f" || true
done

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 7713


🏁 Script executed:

#!/bin/bash
# Check the package.json and entry point of packages/platform/atoms

echo "== Looking for packages/platform/atoms package.json =="
find . -path "*/packages/platform/atoms/package.json" -type f 2>/dev/null | head -5

echo "== Inspect atoms package structure =="
find packages/platform/atoms -maxdepth 3 -type f -name "package.json" -o -name "index.ts" -o -name "index.tsx" 2>/dev/null | head -20

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 988


🏁 Script executed:

#!/bin/bash
# Check other imports from packages/platform/atoms in the codebase

echo "== Other imports from packages/platform/atoms =="
rg "from ['\"].*packages/platform/atoms" apps/web --type ts --type tsx -n | head -20

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 179


🏁 Script executed:

#!/bin/bash
# Get the actual transpilePackages array from apps/web/next.config.ts
echo "== apps/web/next.config.ts transpilePackages section =="
sed -n '230,260p' apps/web/next.config.ts

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 884


🏁 Script executed:

#!/bin/bash
# Check what's exported from packages/platform/atoms destination-calendar entry point
echo "== packages/platform/atoms/destination-calendar/index.ts =="
cat packages/platform/atoms/destination-calendar/index.ts

echo ""
echo "== packages/platform/atoms/src/components structure =="
find packages/platform/atoms/src/components -type f -name "*.ts" -o -name "*.tsx" 2>/dev/null | head -10

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 800


🏁 Script executed:

#!/bin/bash
# Check if atoms-wrapper is exported from the destination-calendar package or main atoms
echo "== Search for atoms-wrapper in packages/platform/atoms =="
find packages/platform/atoms -name "*atoms-wrapper*" -o -name "*AtomWrapper*" 2>/dev/null

echo ""
echo "== Check main atoms index.ts for atoms-wrapper export =="
rg -n "atoms-wrapper|AtomsWrapper" packages/platform/atoms/index.ts

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 258


🏁 Script executed:

#!/bin/bash
# Search for all deep imports from packages/platform/atoms across the whole codebase
echo "== All deep imports from packages/platform/atoms (across entire repo) =="
rg "from ['\"].*packages/platform/atoms/(src/|[a-z-]+/)" --type ts -A 0 | head -30

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 1508


🏁 Script executed:

#!/bin/bash
# Check if DestinationCalendar file exists
echo "== packages/platform/atoms/destination-calendar/ directory contents =="
ls -la packages/platform/atoms/destination-calendar/

echo ""
echo "== Check for DestinationCalendarSettings export =="
rg -n "DestinationCalendarSettings" packages/platform/atoms/destination-calendar/ || echo "Not found in destination-calendar"

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 1705


🏁 Script executed:

#!/bin/bash
# Check the main atoms index.ts to see what's exported
echo "== packages/platform/atoms/index.ts (main entry point) =="
cat packages/platform/atoms/index.ts | head -50

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 3731


🏁 Script executed:

#!/bin/bash
# Check the atoms-wrapper export
echo "== packages/platform/atoms/src/components/atoms-wrapper.tsx (first 20 lines) =="
head -20 packages/platform/atoms/src/components/atoms-wrapper.tsx

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 746


Add @calcom/platform-atoms to transpilePackages and prefer entry-point exports.

Lines 3–4 import directly from package source paths (atoms-wrapper and DestinationCalendar file), bypassing the main entry point. The AtomsWrapper is not exported from the package entry, but DestinationCalendarSettings is available as DestinationCalendarSettingsPlatformWrapper from packages/platform/atoms. Additionally, @calcom/platform-atoms is not listed in Next.js transpilePackages at apps/web/next.config.ts (which currently includes @calcom/app-store, @calcom/features, @calcom/lib, etc.), which may cause transpilation issues in production. Either add @calcom/platform-atoms to transpilePackages or consider creating a tsconfig path alias to normalize these imports.

🤖 Prompt for AI Agents
In `@apps/web/components/apps/DestinationCalendarSettingsWebWrapper.tsx` around
lines 3 - 4, Current imports bypass the package entry by importing AtomsWrapper
and DestinationCalendarSettings from deep source paths; update imports to use
the package entry and transpilation settings by replacing deep imports with the
public exports from packages/platform/atoms (use
DestinationCalendarSettingsPlatformWrapper for DestinationCalendarSettings and
the exported AtomsWrapper if added to the package entry), and add
`@calcom/platform-atoms` to the Next.js transpilePackages array in next.config.ts
(or alternatively add a tsconfig path alias pointing to the package entry) so
the module is transpiled in production.

Comment on lines +4 to 6
import { useSearchParams, usePathname } from "next/navigation";
import { useMemo, useCallback, useEffect } from "react";
import React from "react";
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | head -50

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 2890


🏁 Script executed:

cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | sed -n '190,240p'

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 2125


🏁 Script executed:

cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | sed -n '40,100p'

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 2927


🏁 Script executed:

rg "const router\s*=" apps/web/modules/bookings/components/BookerWebWrapper.tsx

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 68


🏁 Script executed:

rg "router" apps/web/modules/bookings/components/BookerWebWrapper.tsx -B 2 -A 2

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 1414


🏁 Script executed:

cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | sed -n '100,180p'

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 3280


🏁 Script executed:

cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | sed -n '180,210p'

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 1308


🏁 Script executed:

wc -l apps/web/modules/bookings/components/BookerWebWrapper.tsx

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 147


🏁 Script executed:

grep -n "router" apps/web/modules/bookings/components/BookerWebWrapper.tsx

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 454


🏁 Script executed:

cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | grep -E "(function|const.*=.*\(|router\s*:|router\s*=)" | head -30

Repository: qodo-benchmark/cal.com-combined-coderabbit

Length of output: 1946


router is undefined after useRouter import was removed. The variable is used at lines 193, 228, 232, and 238, but never declared. Re-introduce the useRouter import and declare the router instance.

🛠️ Proposed fix
-import { useSearchParams, usePathname } from "next/navigation";
+import { useSearchParams, usePathname, useRouter } from "next/navigation";
 const BookerWebWrapperComponent = (props: BookerWebWrapperAtomProps) => {
   const pathname = usePathname();
   const searchParams = useSearchParams();
+  const router = useRouter();
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { useSearchParams, usePathname } from "next/navigation";
import { useMemo, useCallback, useEffect } from "react";
import React from "react";
import { useSearchParams, usePathname, useRouter } from "next/navigation";
import { useMemo, useCallback, useEffect } from "react";
import React from "react";
🤖 Prompt for AI Agents
In `@apps/web/modules/bookings/components/BookerWebWrapper.tsx` around lines 4 -
6, The component BookerWebWrapper uses router but removed the useRouter hook;
re-add the import "useRouter" from "next/navigation" and declare a router
instance inside the component (e.g., const router = useRouter()) alongside other
hooks (useSearchParams, usePathname, useMemo, etc.) so the existing references
to router (used in callbacks and effects) resolve and follow React hook rules.

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