-
Notifications
You must be signed in to change notification settings - Fork 10.3k
feat: Add option to disable autofill on booking page #22687
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: main
Are you sure you want to change the base?
Conversation
WalkthroughAn organization-level boolean setting disableAutoFillOnBookingPage was added across the stack: database schema and migration, repository selection and defaults, tRPC input/schema and update handler, org appearance UI toggle, booking form hooks and Booker wrapper to suppress session prefill, public event selection, and E2E tests updated/added to cover the behavior. Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes were identified in the code modifications relative to the objectives of the linked issue. Possibly related PRs
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
@romitg2 is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (07/23/25)1 reviewer was added to this PR based on Keith Williams's automation. "Add community label" took an action on this PR • (07/23/25)1 label was added to this PR based on Keith Williams's automation. |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/trpc/server/routers/viewer/organizations/update.handler.ts (1)
56-58
: LGTM! Implementation follows established pattern.The new conditional block for
disableAutoFillOnBookingPage
correctly follows the same pattern as other organization settings fields in this function.Note: The static analysis hint about using
Object.hasOwn()
instead ofhasOwnProperty
is valid, but this pattern is used consistently throughout the function (lines 36, 40, 44, 48, 52). Consider refactoring all instances to useObject.hasOwn()
for better modern JavaScript practices.- if (input.hasOwnProperty("disableAutoFillOnBookingPage")) { + if (Object.hasOwn(input, "disableAutoFillOnBookingPage")) {This change should be applied to all similar conditionals in the function for consistency.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
packages/features/ee/organizations/pages/settings/appearance.tsx
(2 hunks)packages/features/eventtypes/lib/getPublicEvent.ts
(1 hunks)packages/lib/server/repository/organization.ts
(2 hunks)packages/platform/atoms/booker/BookerWebWrapper.tsx
(1 hunks)packages/prisma/migrations/20250723065413_updated_organization_settings_to_include_disableautofillonbookingpage/migration.sql
(1 hunks)packages/prisma/schema.prisma
(1 hunks)packages/trpc/server/routers/viewer/organizations/update.handler.ts
(1 hunks)packages/trpc/server/routers/viewer/organizations/update.schema.ts
(1 hunks)
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
Files:
packages/trpc/server/routers/viewer/organizations/update.schema.ts
packages/features/eventtypes/lib/getPublicEvent.ts
packages/trpc/server/routers/viewer/organizations/update.handler.ts
packages/lib/server/repository/organization.ts
packages/platform/atoms/booker/BookerWebWrapper.tsx
packages/features/ee/organizations/pages/settings/appearance.tsx
🧠 Learnings (5)
packages/features/eventtypes/lib/getPublicEvent.ts (3)
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Select selects only the fields you specify explicitly.
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Include selects the relationship AND all the fields of the table the relationship belongs to.
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Only select data you need.
packages/prisma/migrations/20250723065413_updated_organization_settings_to_include_disableautofillonbookingpage/migration.sql (1)
Learnt from: vijayraghav-io
PR: #16579
File: packages/prisma/schema.prisma:149-153
Timestamp: 2025-07-16T07:14:49.248Z
Learning: In Cal.com's schema design, the team prefers to keep Boolean fields nullable (Boolean?) with defaults rather than making them non-nullable (Boolean) to avoid expensive database migrations that would update existing rows.
packages/prisma/schema.prisma (1)
Learnt from: vijayraghav-io
PR: #16579
File: packages/prisma/schema.prisma:149-153
Timestamp: 2025-07-16T07:14:49.248Z
Learning: In Cal.com's schema design, the team prefers to keep Boolean fields nullable (Boolean?) with defaults rather than making them non-nullable (Boolean) to avoid expensive database migrations that would update existing rows.
packages/platform/atoms/booker/BookerWebWrapper.tsx (2)
Learnt from: eunjae-lee
PR: #22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.389Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
Learnt from: Anshumancanrock
PR: #22570
File: apps/web/modules/signup-view.tsx:253-253
Timestamp: 2025-07-21T21:33:23.343Z
Learning: In signup-view.tsx, when checking if redirectUrl contains certain strings, using explicit && checks (redirectUrl && redirectUrl.includes()) is preferred over optional chaining (redirectUrl?.includes()) to ensure the result is always a boolean rather than potentially undefined. This approach provides cleaner boolean contracts for downstream conditional logic.
packages/features/ee/organizations/pages/settings/appearance.tsx (2)
Learnt from: eunjae-lee
PR: #22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.389Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
Learnt from: Anshumancanrock
PR: #22570
File: apps/web/modules/signup-view.tsx:253-253
Timestamp: 2025-07-21T21:33:23.343Z
Learning: In signup-view.tsx, when checking if redirectUrl contains certain strings, using explicit && checks (redirectUrl && redirectUrl.includes()) is preferred over optional chaining (redirectUrl?.includes()) to ensure the result is always a boolean rather than potentially undefined. This approach provides cleaner boolean contracts for downstream conditional logic.
🪛 Biome (1.9.4)
packages/trpc/server/routers/viewer/organizations/update.handler.ts
[error] 56-56: Do not access Object.prototype method 'hasOwnProperty' from target object.
It's recommended using Object.hasOwn() instead of using Object.hasOwnProperty().
See MDN web docs for more details.
(lint/suspicious/noPrototypeBuiltins)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
Files:
packages/trpc/server/routers/viewer/organizations/update.schema.ts
packages/features/eventtypes/lib/getPublicEvent.ts
packages/trpc/server/routers/viewer/organizations/update.handler.ts
packages/lib/server/repository/organization.ts
packages/platform/atoms/booker/BookerWebWrapper.tsx
packages/features/ee/organizations/pages/settings/appearance.tsx
🧠 Learnings (5)
packages/features/eventtypes/lib/getPublicEvent.ts (3)
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Select selects only the fields you specify explicitly.
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Include selects the relationship AND all the fields of the table the relationship belongs to.
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Only select data you need.
packages/prisma/migrations/20250723065413_updated_organization_settings_to_include_disableautofillonbookingpage/migration.sql (1)
Learnt from: vijayraghav-io
PR: #16579
File: packages/prisma/schema.prisma:149-153
Timestamp: 2025-07-16T07:14:49.248Z
Learning: In Cal.com's schema design, the team prefers to keep Boolean fields nullable (Boolean?) with defaults rather than making them non-nullable (Boolean) to avoid expensive database migrations that would update existing rows.
packages/prisma/schema.prisma (1)
Learnt from: vijayraghav-io
PR: #16579
File: packages/prisma/schema.prisma:149-153
Timestamp: 2025-07-16T07:14:49.248Z
Learning: In Cal.com's schema design, the team prefers to keep Boolean fields nullable (Boolean?) with defaults rather than making them non-nullable (Boolean) to avoid expensive database migrations that would update existing rows.
packages/platform/atoms/booker/BookerWebWrapper.tsx (2)
Learnt from: eunjae-lee
PR: #22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.389Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
Learnt from: Anshumancanrock
PR: #22570
File: apps/web/modules/signup-view.tsx:253-253
Timestamp: 2025-07-21T21:33:23.343Z
Learning: In signup-view.tsx, when checking if redirectUrl contains certain strings, using explicit && checks (redirectUrl && redirectUrl.includes()) is preferred over optional chaining (redirectUrl?.includes()) to ensure the result is always a boolean rather than potentially undefined. This approach provides cleaner boolean contracts for downstream conditional logic.
packages/features/ee/organizations/pages/settings/appearance.tsx (2)
Learnt from: eunjae-lee
PR: #22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.389Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
Learnt from: Anshumancanrock
PR: #22570
File: apps/web/modules/signup-view.tsx:253-253
Timestamp: 2025-07-21T21:33:23.343Z
Learning: In signup-view.tsx, when checking if redirectUrl contains certain strings, using explicit && checks (redirectUrl && redirectUrl.includes()) is preferred over optional chaining (redirectUrl?.includes()) to ensure the result is always a boolean rather than potentially undefined. This approach provides cleaner boolean contracts for downstream conditional logic.
🪛 Biome (1.9.4)
packages/trpc/server/routers/viewer/organizations/update.handler.ts
[error] 56-56: Do not access Object.prototype method 'hasOwnProperty' from target object.
It's recommended using Object.hasOwn() instead of using Object.hasOwnProperty().
See MDN web docs for more details.
(lint/suspicious/noPrototypeBuiltins)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Install dependencies / Yarn install & cache
🔇 Additional comments (10)
packages/prisma/schema.prisma (1)
613-613
: LGTM! Field definition is consistent with model conventions.The new
disableAutoFillOnBookingPage
field follows the established pattern in theOrganizationSettings
model, using non-nullableBoolean
with@default(false)
like other similar settings fields.packages/trpc/server/routers/viewer/organizations/update.schema.ts (1)
38-38
: LGTM! Schema field addition is properly implemented.The new
disableAutoFillOnBookingPage
field follows the established pattern for optional boolean fields in the update schema and matches the database field name exactly.packages/prisma/migrations/20250723065413_updated_organization_settings_to_include_disableautofillonbookingpage/migration.sql (1)
1-2
: LGTM! Migration is correctly implemented and efficient.The migration properly adds the new boolean column with
NOT NULL DEFAULT false
, which efficiently handles existing rows without requiring expensive individual updates. This approach aligns with PostgreSQL best practices and is consistent with other boolean fields in the OrganizationSettings table.packages/features/eventtypes/lib/getPublicEvent.ts (1)
108-112
: LGTM! Proper Prisma field selection for the new organization setting.The addition of
organizationSettings.disableAutoFillOnBookingPage
to the selection follows best practices by only selecting the specific field needed for the booking page autofill functionality.packages/platform/atoms/booker/BookerWebWrapper.tsx (2)
104-105
: LGTM! Proper extraction of the organization setting.The implementation correctly extracts the
disableAutoFillOnBookingPage
setting from the nested organization structure with appropriate optional chaining and fallback tofalse
.
109-111
: LGTM! Correct implementation of conditional autofill disabling.The logic properly uses the
disableAutoFillOnBookingPage
flag to conditionally passnull
values instead of session data, effectively disabling autofill when the organization setting is enabled.packages/lib/server/repository/organization.ts (2)
275-275
: LGTM! Consistent database field selection.The addition of
disableAutoFillOnBookingPage
to the database selection follows the established pattern for other organization settings.
294-294
: LGTM! Proper setting exposure in the returned object.The field is correctly included in the returned
organizationSettings
object, ensuring the setting is available to consumers of this repository method.packages/features/ee/organizations/pages/settings/appearance.tsx (2)
56-58
: LGTM! Consistent state initialization pattern.The state initialization follows the same pattern as other organization settings, with proper fallback to
false
when the setting is not available.
200-211
: LGTM! Well-implemented UI toggle following established patterns.The
SettingsToggle
implementation correctly follows the same pattern as other organization settings toggles, including:
- Proper mutation handling with loading state
- Localized strings for accessibility
- Consistent styling and behavior
- State synchronization with the mutation
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/web/playwright/organization/organization-settings.e2e.ts
(4 hunks)packages/features/ee/organizations/pages/settings/appearance.tsx
(2 hunks)
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
Files:
apps/web/playwright/organization/organization-settings.e2e.ts
🧬 Code Graph Analysis (1)
apps/web/playwright/organization/organization-settings.e2e.ts (1)
apps/web/playwright/lib/testUtils.ts (1)
setupOrgMember
(571-592)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/features/ee/organizations/pages/settings/appearance.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
Files:
apps/web/playwright/organization/organization-settings.e2e.ts
🧬 Code Graph Analysis (1)
apps/web/playwright/organization/organization-settings.e2e.ts (1)
apps/web/playwright/lib/testUtils.ts (1)
setupOrgMember
(571-592)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Install dependencies / Yarn install & cache
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (3)
apps/web/playwright/organization/organization-settings.e2e.ts (3)
9-14
: LGTM! Good refactoring to make the interface more generic.The rename from
ToggleSeoSwitchParams
toToggleSwitchParams
improves reusability by making the interface applicable to all types of toggle switches, not just SEO-related ones.
24-36
: LGTM! Consistent refactoring to generic naming.The function rename and variable updates maintain the same functionality while making the helper more reusable across different types of toggle switches.
100-105
: LGTM! Correct function call update.The function call has been properly updated to use the new generic
toggleSwitch
function name while maintaining the same parameters and expected behavior.
test.describe("Disabling auto prefill updates settings and booking page", async () => { | ||
let ctx: TestContext; | ||
|
||
test.beforeEach(async ({ users }) => { | ||
ctx = await setupOrgMember(users); | ||
}); | ||
|
||
test.afterEach(async ({ users }) => { | ||
await users.deleteAll(); | ||
}); | ||
|
||
test("Disable 'Disable auto prefill' for organization", async ({ page }) => { | ||
await page.goto(`/settings/organizations/profile`); | ||
|
||
const autoPrefillSwitch = await page.getByTestId(`${ctx.org.id}-disable-auto-prefill-switch`); | ||
await expect(autoPrefillSwitch).toBeChecked({ checked: false }); | ||
|
||
await toggleSwitch({ | ||
page, | ||
switchTestId: `${ctx.org.id}-disable-auto-prefill-switch`, | ||
expectedChecked: true, | ||
waitForMessage: "Your team has been updated successfully.", | ||
}); | ||
}); | ||
}); |
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.
🛠️ Refactor suggestion
Address test naming inconsistency and improve test coverage.
Several issues with the new test suite:
-
Naming inconsistency: The test description says "Disabling auto prefill" but the test actually enables the setting (
expectedChecked: true
). -
Incomplete test coverage: The test suite title mentions "updates settings and booking page" but only tests the settings page interaction. Unlike the SEO tests that verify both settings changes and actual page behavior, this test doesn't verify that the setting actually affects autofill on booking pages.
Consider these improvements:
- test("Disable 'Disable auto prefill' for organization", async ({ page }) => {
+ test("Enable 'Disable auto prefill' setting for organization", async ({ page }) => {
And add a second test to verify the actual booking page behavior:
test("Verify autofill behavior on booking page when disabled", async ({ page }) => {
// Enable the disable auto prefill setting first
await page.goto(`/settings/organizations/profile`);
await toggleSwitch({
page,
switchTestId: `${ctx.org.id}-disable-auto-prefill-switch`,
expectedChecked: true,
waitForMessage: "Your team has been updated successfully.",
});
// Navigate to a booking page and verify autofill is disabled
// Add assertions to check that form fields are not auto-filled
});
🤖 Prompt for AI Agents
In apps/web/playwright/organization/organization-settings.e2e.ts around lines
143 to 167, the test suite title and test description are inconsistent with the
actual test behavior, which enables the setting instead of disabling it. Rename
the test and suite descriptions to accurately reflect enabling the "Disable auto
prefill" setting. Additionally, add a second test that first enables this
setting, then navigates to a booking page to verify that autofill is actually
disabled by asserting that form fields are not auto-filled, ensuring full
coverage of both settings update and booking page behavior.
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.
Address the comments
data-testid={`${currentOrg?.id}-disable-auto-prefill-switch`} | ||
toggleSwitchAtTheEnd={true} | ||
title={t("disable_auto_prefill")} | ||
description={t("disable_auto_prefill_description")} |
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.
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.
already fixed in [e6ac1f3] (e6ac1f3) (actually made this commit after adding video so it's showing that way)
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.
When disable autofill is toggled on we should disable the autofill option from the local storage and not the user session. Having said that even the current implementation does not work.
Hey @kart1ka, I am unable to access booking page for org, booking page uses |
This PR is being marked as stale due to inactivity. |
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.
Actionable comments posted: 1
🧹 Nitpick comments (3)
apps/web/public/static/locales/en/common.json (1)
2996-2997
: Align wording with feature intent and existing toggle styleConsider aligning the copy with the PR intent (“autofill”) and existing Title Case style used for similar toggles.
Apply this diff to tighten the UX copy:
- "disable_auto_prefill": "Disable auto prefill", - "disable_auto_prefill_description": "This will prevent the booking page from being prefilled with the user's name and email.", + "disable_auto_prefill": "Disable Autofill on Booking Page", + "disable_auto_prefill_description": "Prevents the booking page from pre-filling the user's name and email."Note: Keeping the i18n keys unchanged is good. If “prefill” vs “autofill” needs to be consistent across the app, we can update other strings separately. Do you want me to open a follow-up for copy consistency?
packages/features/bookings/Booker/components/hooks/useInitialFormValues.ts (2)
117-128
: Confirm intended sources still prefill when toggle is onWhen
disableAutoFillOnBookingPage
is true, the logic blanks name/email unless present inparsedQuery
or reschedule data. That means:
- URL query prefill still works (good for explicit prefill).
- Rescheduling retains attendee info (arguably desirable).
If the intent is to disable all implicit prefill (session/local state) but still allow explicit URL parameters and reschedule data, this is correct. If you also want to ignore previously saved in-memory form values when the toggle is on, you’ll need to bypass the early return at Line 85 that reuses
formValues
.
187-200
: Ensure toggle changes recompute initial valuesIf the org toggle can change while the booking page is mounted, consider making the effect reactive to it. This is a minor improvement and only necessary if the page stays mounted while toggling.
You can add
disableAutoFillOnBookingPage
to the deps:}, [ eventType?.bookingFields, formValues, isRescheduling, bookingData, bookingData?.id, rescheduleUid, email, name, username, prefillFormParams, stableHashExtraOptions, disableAutoFillOnBookingPage, // add ]);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
apps/web/public/static/locales/en/common.json
(1 hunks)packages/features/bookings/Booker/components/hooks/useBookingForm.ts
(3 hunks)packages/features/bookings/Booker/components/hooks/useInitialFormValues.ts
(3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.ts
📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
**/*.ts
: For Prisma queries, only select data you need; never useinclude
, always useselect
Ensure thecredential.key
field is never returned from tRPC endpoints or APIs
Files:
packages/features/bookings/Booker/components/hooks/useBookingForm.ts
packages/features/bookings/Booker/components/hooks/useInitialFormValues.ts
**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js
.utc()
in hot paths like loops
Files:
packages/features/bookings/Booker/components/hooks/useBookingForm.ts
packages/features/bookings/Booker/components/hooks/useInitialFormValues.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (4)
packages/features/bookings/Booker/components/hooks/useInitialFormValues.ts (2)
25-26
: Prop addition looks goodIntroducing the optional flag on the hook API is appropriate and keeps backward compatibility.
67-68
: Default parameter is fineDefaulting to false keeps existing behavior when the setting is absent.
packages/features/bookings/Booker/components/hooks/useBookingForm.ts (2)
26-27
: Good API plumbingThreading
disableAutoFillOnBookingPage
through the hook’s public interface is clean and non-breaking.
40-41
: Default is fine; confirm wrapper behaviorDefaulting to false is correct. Ensure
BookerWebWrapper
setshasSession
appropriately when this flag is true so session-derived prefill is suppressed as intended. With the bug fix in useInitialFormValues, the behavior should now match the org toggle.
disableAutoFillOnBookingPage = true; | ||
|
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.
Critical: Flag is being forced to true, disabling autofill for everyone
disableAutoFillOnBookingPage
is unconditionally set to true
, which overrides the caller-provided value and effectively disables autofill globally. This contradicts the org-level toggle intent and will break existing prefill behavior.
Apply this diff to honor the provided prop:
- disableAutoFillOnBookingPage = true;
Optionally, also avoid reassigning function parameters; compute a local const if needed (not required after the above removal).
📝 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.
disableAutoFillOnBookingPage = true; |
🤖 Prompt for AI Agents
In packages/features/bookings/Booker/components/hooks/useInitialFormValues.ts
around lines 109-110, the code unconditionally sets disableAutoFillOnBookingPage
= true which overrides the caller-provided value and disables autofill globally;
remove that forced assignment so the function uses the incoming prop/argument
value instead (or, if you prefer not to mutate parameters, compute a local const
like const shouldDisableAutoFill = providedDisableAutoFillOnBookingPage ??
defaultValue and use that) to honor the org-level toggle.
also can you please help me with this, i am not able to see booking page for Organization. Screen.Recording.2025-08-15.at.4.29.45.PM.mov |
What does this PR do?
the booking page 404 error is due to org domain (
acme.localhost:3000
)Screen.Recording.2025-07-23.at.1.50.02.PM.mov
Visual Demo (For contributors especially)
A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).
Video Demo (if applicable):
Image Demo (if applicable):
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist