Skip to content

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

romitg2
Copy link
Contributor

@romitg2 romitg2 commented Jul 23, 2025

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):

  • Show screen recordings of the issue or feature.
  • Demonstrate how to reproduce the issue, the behavior before and after the change.

Image Demo (if applicable):

  • Add side-by-side screenshots of the original and updated change.
  • Highlight any significant change(s).

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings

@romitg2 romitg2 requested review from a team as code owners July 23, 2025 08:21
Copy link
Contributor

coderabbitai bot commented Jul 23, 2025

Walkthrough

An 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

Objective (CAL-5676) Addressed Explanation
Add an org level option to disable autofill on booking page (CAL-5676)

Assessment against linked issues: Out-of-scope changes

No 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 Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Jul 23, 2025
@graphite-app graphite-app bot requested a review from a team July 23, 2025 08:21
Copy link

vercel bot commented Jul 23, 2025

@romitg2 is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the ❗️ migrations contains migration files label Jul 23, 2025
@dosubot dosubot bot added booking-page area: booking page, public booking page, booker ✨ feature New feature or request labels Jul 23, 2025
Copy link

graphite-app bot commented Jul 23, 2025

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.

Copy link
Contributor

@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: 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 of hasOwnProperty is valid, but this pattern is used consistently throughout the function (lines 36, 40, 44, 48, 52). Consider refactoring all instances to use Object.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

📥 Commits

Reviewing files that changed from the base of the PR and between ee9699e and 4311b7e.

📒 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 the OrganizationSettings model, using non-nullable Boolean 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 to false.


109-111: LGTM! Correct implementation of conditional autofill disabling.

The logic properly uses the disableAutoFillOnBookingPage flag to conditionally pass null 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

Copy link
Contributor

@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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e6ac1f3 and 44c83d6.

📒 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 to ToggleSwitchParams 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.

Comment on lines +143 to +167
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.",
});
});
});
Copy link
Contributor

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:

  1. Naming inconsistency: The test description says "Disabling auto prefill" but the test actually enables the setting (expectedChecked: true).

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

Copy link
Contributor

@Devanshusharma2005 Devanshusharma2005 left a 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")}
Copy link
Contributor

Choose a reason for hiding this comment

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

Image

?? can you please try to fix this.

Copy link
Contributor Author

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)

Screenshot 2025-07-23 at 11 03 58 PM

Copy link
Contributor

@kart1ka kart1ka left a 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.

@kart1ka kart1ka marked this pull request as draft July 29, 2025 06:22
@romitg2
Copy link
Contributor Author

romitg2 commented Jul 29, 2025

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 acme.localhost:3000 domain, and it shows 404. because of that i'm unable to test it. is there any solution to this ??

Copy link
Contributor

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added the Stale label Aug 13, 2025
@romitg2 romitg2 requested a review from kart1ka August 15, 2025 10:54
@romitg2 romitg2 marked this pull request as ready for review August 15, 2025 10:54
@dosubot dosubot bot added the bookings area: bookings, availability, timezones, double booking label Aug 15, 2025
Copy link
Contributor

@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: 1

🧹 Nitpick comments (3)
apps/web/public/static/locales/en/common.json (1)

2996-2997: Align wording with feature intent and existing toggle style

Consider 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 on

When disableAutoFillOnBookingPage is true, the logic blanks name/email unless present in parsedQuery 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 values

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7c5f25a and 0a102fd.

📒 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 use include, always use select
Ensure the credential.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 good

Introducing the optional flag on the hook API is appropriate and keeps backward compatibility.


67-68: Default parameter is fine

Defaulting to false keeps existing behavior when the setting is absent.

packages/features/bookings/Booker/components/hooks/useBookingForm.ts (2)

26-27: Good API plumbing

Threading disableAutoFillOnBookingPage through the hook’s public interface is clean and non-breaking.


40-41: Default is fine; confirm wrapper behavior

Defaulting to false is correct. Ensure BookerWebWrapper sets hasSession 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.

Comment on lines +109 to +110
disableAutoFillOnBookingPage = true;

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

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.

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

@romitg2
Copy link
Contributor Author

romitg2 commented Aug 15, 2025

@kart1ka

  • i have tested some ad-hoc way and it's working good now.
    can you please test it from your side for organization events.

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

@github-actions github-actions bot removed the Stale label Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
booking-page area: booking page, public booking page, booker bookings area: bookings, availability, timezones, double booking community Created by Linear-GitHub Sync ✨ feature New feature or request ❗️ migrations contains migration files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants