refactor: move Booker hooks from packages/features to apps/web/modules#27343
Merged
refactor: move Booker hooks from packages/features to apps/web/modules#27343
Conversation
Migrate the following Booker hooks: - useOverlayCalendar - useSkipConfirmStep - useInitializeWeekStart - useIsQuickAvailabilityCheckFeatureEnabled - useDecoyBooking These hooks are only imported by apps/web files, making them safe to move without creating circular dependencies. Part of the tRPC-driven UI migration from packages/features to apps/web/modules. Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…port paths - Reverted useIsQuickAvailabilityCheckFeatureEnabled.ts back to packages/features since it's imported by useSlots.ts in packages/features (would create circular dependency) - Fixed import paths in useOverlayCalendar.ts to use @calcom/features paths - Fixed import paths in useSkipConfirmStep.ts to use @calcom/features paths - Updated Booker.tsx to import useIsQuickAvailabilityCheckFeatureEnabled from original location Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
Contributor
E2E results are ready! |
…n' into devin/1769605389-booker-migration
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
…er.devin.ai/proxy/github.com/calcom/cal.com into devin/1769605389-booker-migration
Contributor
There was a problem hiding this comment.
1 issue found across 46 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/embeds/embed-core/src/embed-iframe/react-hooks.ts">
<violation number="1" location="packages/embeds/embed-core/src/embed-iframe/react-hooks.ts:125">
P3: Add the isBrowser guard in this hook to follow the file’s client-only contract and avoid executing during SSR/prerendering.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Contributor
Devin AI is addressing Cubic AI's review feedbackA Devin session has been created to address the issues identified by Cubic AI. |
Address Cubic AI review feedback (confidence 9/10) by adding the isBrowser guard to the useSlotsViewOnSmallScreen hook to follow the file's client-only contract and avoid executing during SSR/prerendering. Co-Authored-By: unknown <>
…er.devin.ai/proxy/github.com/calcom/cal.com into devin/1769605389-booker-migration
hbjORbj
commented
Jan 31, 2026
Comment on lines
-1
to
-13
| import { useIsEmbed, useEmbedUiConfig } from "@calcom/embed-core/embed-iframe"; | ||
| import useMediaQuery from "@calcom/lib/hooks/useMediaQuery"; | ||
|
|
||
| export const useSlotsViewOnSmallScreen = () => { | ||
| const isEmbed = useIsEmbed(); | ||
| const isMobile = useMediaQuery("(max-width: 768px)"); | ||
|
|
||
| const embedUiConfig = useEmbedUiConfig(); | ||
|
|
||
| if (!isEmbed || !isMobile) return false; | ||
|
|
||
| return embedUiConfig.useSlotsViewOnSmallScreen ?? false; | ||
| }; |
Contributor
Author
There was a problem hiding this comment.
this is migrated to @calcom/embed-core/embed-iframe package since it's relevant to embeds
hbjORbj
commented
Jan 31, 2026
| import { useIsQuickAvailabilityCheckFeatureEnabled } from "./useIsQuickAvailabilityCheckFeatureEnabled"; | ||
|
|
||
| export type QuickAvailabilityCheck = TIsAvailableOutputSchema["slots"][number]; |
Contributor
Author
There was a problem hiding this comment.
Moved to packages/features and I typed it manually now to not depend on TIsAvailableOutputSchema, which is from trpc package
export type QuickAvailabilityCheck = {
status: "available" | "reserved" | "minBookNoticeViolation" | "slotInPast";
utcStartIso: string;
utcEndIso: string;
realStatus?: "available" | "reserved" | "minBookNoticeViolation" | "slotInPast" | undefined;
};
keithwillcode
approved these changes
Jan 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Reorganizes Booker hooks from
packages/features/bookings/Booker/components/hooks/as part of the ongoing tRPC-driven UI migration effort. Hooks are split based on whether they're consumed by platform/atoms.Hooks migrated to
apps/web/modules/bookings/hooks/(web-only):useBookingsuseCalendarsuseDecoyBookinguseInitializeWeekStartuseIsQuickAvailabilityCheckFeatureEnableduseOverlayCalendaruseSkipConfirmStepuseSlotsuseVerifyCodeuseVerifyEmailHooks moved to
packages/features/bookings/Booker/hooks/(consumed by platform/atoms, cannot import from web):useAvailableTimeSlotsuseBookerLayoutuseBookerTimeuseBookingFormuseInitialFormValuesuseLocalSetAdditional changes:
useSlotsViewOnSmallScreento@calcom/embed-core/embed-iframeWrappedBookerPropsand related types toapps/web/modules/bookings/types.tsQuickAvailabilityChecktype topackages/features/bookings/Booker/types.tsImpact:
@calcom/trpc/reactimports frompackages/features/This is part of the larger effort to break down PR #26571.
Updates since last revision
isBrowserguard touseSlotsViewOnSmallScreenhook inpackages/embeds/embed-core/src/embed-iframe/react-hooks.tsto follow the file's client-only contract and avoid executing during SSR/prerendering (addressing Cubic AI review feedback, confidence 9/10)Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
useSlotsViewOnSmallScreenhook)Human Review Checklist
isBrowserguard inuseSlotsViewOnSmallScreenfollows the same pattern asuseBookerEmbedEventsin the same file