Skip to content

refactor: move shared components from apps/web to packages/features#27490

Merged
hbjORbj merged 14 commits intomainfrom
devin/1770011679-pure-file-moves
Feb 2, 2026
Merged

refactor: move shared components from apps/web to packages/features#27490
hbjORbj merged 14 commits intomainfrom
devin/1770011679-pure-file-moves

Conversation

@hbjORbj
Copy link
Copy Markdown
Contributor

@hbjORbj hbjORbj commented Feb 2, 2026

What does this PR do?

This PR moves shared components from apps/web/modules to packages/features to reduce circular dependencies where packages/platform/atoms was importing from @calcom/web. This is Part 1 of 2 - containing only pure file moves without any dependency injection pattern changes.

Context: This is a split from PR #26995 to reduce risk. Part 1 (this PR) contains safe, straightforward file moves. Part 2 will contain the dependency injection pattern changes for components that have tRPC dependencies.

Components moved to packages/features:

  • DisconnectIntegrationModal@calcom/features/apps/components
  • Booking components (Header, Section, TimeFormatToggle, PayIcon, Price) → @calcom/features/bookings/components
  • useInitializeWeekStart hook → @calcom/features/bookings/hooks
  • TeamEventTypeForm@calcom/features/ee/teams/components
  • Event type components (AssignAllTeamMembers, BulkEditDefaultForEventsModal, CheckedTeamSelect, ChildrenEventTypeSelect, CreateEventTypeForm, LearnMoreLink, WeightDescription) → @calcom/features/eventtypes/components
  • Event type dialogs (HostEditDialogs, ManagedEventDialog) → @calcom/features/eventtypes/components/dialogs
  • Location components (LocationInput, types) → @calcom/features/eventtypes/components/locations
  • Tab components (EventLimitsTab, EventRecurringTab, etc.) → @calcom/features/eventtypes/components/tabs

Updates since last revision:

Fixed circular dependency in Header component (addresses Cubic AI review feedback with 9/10 confidence):

The Header component (now in @calcom/features/bookings/components) was importing useIsPlatform from @calcom/atoms, creating a circular dependency:

  • @calcom/atoms@calcom/features (imports Header) → @calcom/atoms (imports useIsPlatform)

Fix: Refactored Header to accept an isPlatform prop instead of calling useIsPlatform internally:

  • Added isPlatform?: boolean prop to Header, LayoutToggle, and LayoutToggleWithData (defaults to false)
  • Updated callers to pass the prop:
    • CalendarViewComponent.tsx: isPlatform={true}
    • EventTypeCalendarViewComponent.tsx: isPlatform={true}
    • Booker.tsx: isPlatform={isPlatform}

Verification:

  • All 23 moved files have been verified to contain NO @calcom/trpc imports
  • All 23 moved files have been verified to contain NO @calcom/web imports
  • Type check passes locally
  • Lint passes locally

devin-ai-integration Bot and others added 2 commits February 2, 2026 06:06
Move components that don't require dependency injection:
- DisconnectIntegrationModal
- Booking components (Header, Section, TimeFormatToggle, PayIcon, Price)
- useInitializeWeekStart hook
- TeamEventTypeForm
- Event type components (AssignAllTeamMembers, BulkEditDefaultForEventsModal, etc.)
- Event type dialogs (HostEditDialogs, ManagedEventDialog)
- Location components (LocationInput, types)
- Tab components (EventLimitsTab, EventRecurringTab, etc.)

Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
Update imports in apps/web and packages/platform/atoms to reference
the moved components from @calcom/features instead of @calcom/web.

Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Complete the file move by deleting the original files that were
copied to packages/features. This makes it a proper move instead
of a copy, reducing the PR size significantly.

Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
Update import paths in apps/web files that reference components
that were moved from apps/web/modules to packages/features:
- LearnMoreLink
- ChildrenEventTypeSelect
- AssignAllTeamMembers
- WeightDescription
- LocationCustomClassNames (types)

Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
@hbjORbj hbjORbj marked this pull request as ready for review February 2, 2026 07:42
@hbjORbj hbjORbj requested review from a team as code owners February 2, 2026 07:42
@graphite-app graphite-app Bot added foundation core area: core, team members only labels Feb 2, 2026
Update import paths in apps/web files that reference components
moved from apps/web/modules to packages/features:
- AppList.tsx: BulkEditDefaultForEventsModal
- schedule-view.tsx: BulkUpdatParams type
- AddMembersWithSwitch.tsx: AssignAllTeamMembers, CheckedTeamSelect
- EventTypeWebWrapper.tsx: ChildrenEventType, ManagedEventDialog
- DefaultLocationSettings.tsx: LocationCustomClassNames, LocationInput
- Locations.tsx: LocationCustomClassNames, LocationInput

Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 55 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/platform/atoms/calendar-view/CalendarViewComponent.tsx">

<violation number="1" location="packages/platform/atoms/calendar-view/CalendarViewComponent.tsx:1">
P1: These imports introduce a circular dependency: @calcom/atoms (CalendarViewComponent) now depends on @calcom/features/Header, but Header depends on @calcom/atoms (useIsPlatform). Atoms should not depend on Features if Features already depend on Atoms—this can break bundling/runtime.

Consider moving useIsPlatform to a lower-level shared package (e.g., @calcom/lib), or refactoring Header to accept an `isPlatform` prop so it no longer imports from @calcom/atoms.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread packages/platform/atoms/calendar-view/CalendarViewComponent.tsx
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 2, 2026

Devin AI is addressing Cubic AI's review feedback

A Devin session has been created to address the issues identified by Cubic AI.

View Devin Session

This fixes the circular dependency where @calcom/atoms (CalendarViewComponent)
was importing Header from @calcom/features, but Header was importing
useIsPlatform from @calcom/atoms.

The fix adds an isPlatform prop to the Header component so it no longer
needs to import useIsPlatform from @calcom/atoms. Callers now pass the
isPlatform value directly:
- atoms components pass isPlatform={true}
- web components pass the isPlatform prop they receive

Fix confidence: 9/10 (Cubic AI)

Co-Authored-By: unknown <>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 2, 2026

E2E results are ready!

keithwillcode
keithwillcode previously approved these changes Feb 2, 2026
@deepeshbind
Copy link
Copy Markdown
Contributor

Hi @hbjORbj, great work on this!
Quick question: Would it be helpful to add index.ts files to the new feature folders for cleaner imports in Part 2?

@hbjORbj
Copy link
Copy Markdown
Contributor Author

hbjORbj commented Feb 2, 2026

We don't really prefer barrel files @deepeshbind

@hbjORbj hbjORbj changed the title refactor: move shared components from apps/web to packages/features (pure moves) refactor: move shared components from apps/web to packages/features Feb 2, 2026
@hbjORbj hbjORbj enabled auto-merge (squash) February 2, 2026 09:42
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/features/bookings/components/Header.tsx">

<violation number="1" location="packages/features/bookings/components/Header.tsx:189">
P1: `LayoutToggle` now calls `useIsPlatform`, reintroducing a dependency from features to atoms and causing a circular dependency because atoms import `Header`. Consider keeping the `isPlatform` prop thread instead of using the hook here to avoid cycles.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread packages/features/bookings/components/Header.tsx
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 2, 2026

Devin AI is addressing Cubic AI's review feedback

A Devin session has been created to address the issues identified by Cubic AI.

View Devin Session

@@ -187,7 +187,6 @@ const LayoutToggle = ({
}) => {
const isEmbed = useIsEmbed();
const isPlatform = useIsPlatform();
Copy link
Copy Markdown
Contributor Author

@hbjORbj hbjORbj Feb 2, 2026

Choose a reason for hiding this comment

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

so, now features is importing atoms for this hook. I am aware that this isn't ideal, but there are already many other cases where features import atoms. It's another decoupling we should do. I will handle it in separate PRs.

@hbjORbj hbjORbj merged commit 8c123ec into main Feb 2, 2026
47 checks passed
@hbjORbj hbjORbj deleted the devin/1770011679-pure-file-moves branch February 2, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants