Skip to content

Conversation

supalarry
Copy link
Contributor

Linear CAL-6421

Copy link

linear bot commented Sep 17, 2025

Copy link
Contributor

coderabbitai bot commented Sep 17, 2025

Walkthrough

FormBuilder’s FieldEditDialog now imports useIsPlatform and uses it to conditionally render boolean field editors: CheckboxFieldLabel only when formFieldType === "boolean" and not on platform, otherwise InputField is rendered. A new changeset bumps @calcom/atoms with a patch release note: "fix: EventTypeSettings Checkbox booking field label." .changeset/config.json adds @calcom/api-v2 to the ignore list (alongside @calcom/platform-libraries). No exported/public API signatures were changed.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning The changes add a platform check in FieldEditDialog and render a normal InputField for boolean/checkbox labels on platform, which addresses the "replace Editor with a text field" part of CAL-6421; however, the linked issue also requires adding validation to require the label to be filled and the provided summaries do not show that validation being added, so the implementation is only partial relative to the issue requirements. Add explicit validation that the label is required for platform-rendered checkbox booking fields, include tests or form validation updates, and update the PR description to state that validation and visual verification (screenshots) were added.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly describes the primary change — fixing the EventTypeSettings checkbox booking field label — and directly reflects the code adjustments that gate label rendering for platform atoms, making it clear and specific enough for a reviewer scanning history to understand the main intent.
Out of Scope Changes Check ✅ Passed The functional code change in packages/features/form-builder/FormBuilder.tsx aligns with the linked issue, while the added changeset file and the .changeset/config.json update (adding @calcom/api-v2 to the ignore list) are ancillary release/config updates that are not described in the linked issue but appear to be low-risk and not harmful to the scope of the bug fix.
Description Check ✅ Passed The PR description links to the relevant Linear issue (CAL-6421) and is related to the changeset, so it meets the lenient requirement that the description be on-topic.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch lauris/cal-6421-fix-eventtypesettings-atom-checkbox-booking-field

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

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

@graphite-app graphite-app bot requested a review from a team September 17, 2025 10:37
@keithwillcode keithwillcode added core area: core, team members only platform Anything related to our platform plan labels Sep 17, 2025
@graphite-app graphite-app bot requested a review from a team September 17, 2025 10:37
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 (3)
.changeset/config.json (1)

10-10: Confirm ignoring @calcom/api-v2 is intended.

Adding "@calcom/api-v2" to ignore prevents version bumps when only that package changes. Verify this aligns with release policy. Also consider sorting entries for readability.

Apply this diff to sort:

-  "ignore": ["@calcom/platform-libraries", "@calcom/api-v2"],
+  "ignore": ["@calcom/api-v2", "@calcom/platform-libraries"],
.changeset/cold-dragons-chew.md (1)

1-5: Changeset looks good.

Patch bump scoped to @calcom/atoms with clear note. Optional: reference CAL-6421 in the message for traceability.

Suggested tweak:

-fix: EventTypeSettings Checkbox booking field label
+fix: EventTypeSettings Checkbox booking field label (CAL-6421)
packages/features/form-builder/FormBuilder.tsx (1)

574-574: Hook usage OK; consider lifting to parent only if reused.

Tiny nit: If multiple children need platform detection later, compute once and pass down.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • 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 9ee06b4 and f3a4ced.

📒 Files selected for processing (3)
  • .changeset/cold-dragons-chew.md (1 hunks)
  • .changeset/config.json (1 hunks)
  • packages/features/form-builder/FormBuilder.tsx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/review.mdc)

Always use t() for text localization in frontend code; direct text embedding should trigger a warning

Files:

  • packages/features/form-builder/FormBuilder.tsx
**/*.{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/form-builder/FormBuilder.tsx
**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.

Files:

  • packages/features/form-builder/FormBuilder.tsx
🧠 Learnings (3)
📓 Common learnings
Learnt from: supalarry
PR: calcom/cal.com#23364
File: apps/api/v2/src/ee/event-types/event-types_2024_06_14/transformers/internal-to-api/internal-to-api.spec.ts:295-296
Timestamp: 2025-08-27T13:32:46.887Z
Learning: In calcom/cal.com, when transforming booking fields from internal to API format, tests in organizations-event-types.e2e-spec.ts already expect name field label and placeholder to be empty strings ("") rather than undefined. PR changes that set these to explicit empty strings are typically fixing implementation to match existing test expectations rather than breaking changes.
📚 Learning: 2025-08-29T22:57:30.382Z
Learnt from: bandhan-majumder
PR: calcom/cal.com#23454
File: packages/features/form-builder/FormBuilder.tsx:11-11
Timestamp: 2025-08-29T22:57:30.382Z
Learning: FormBuilder.tsx in packages/features/form-builder/ does not have "use client" directive at the top despite using client-side React hooks and event handlers, which suggests it should be a client component.

Applied to files:

  • packages/features/form-builder/FormBuilder.tsx
📚 Learning: 2025-08-27T13:32:46.887Z
Learnt from: supalarry
PR: calcom/cal.com#23364
File: apps/api/v2/src/ee/event-types/event-types_2024_06_14/transformers/internal-to-api/internal-to-api.spec.ts:295-296
Timestamp: 2025-08-27T13:32:46.887Z
Learning: In calcom/cal.com, when transforming booking fields from internal to API format, tests in organizations-event-types.e2e-spec.ts already expect name field label and placeholder to be empty strings ("") rather than undefined. PR changes that set these to explicit empty strings are typically fixing implementation to match existing test expectations rather than breaking changes.

Applied to files:

  • .changeset/cold-dragons-chew.md
🧬 Code graph analysis (1)
packages/features/form-builder/FormBuilder.tsx (1)
packages/platform/atoms/index.ts (1)
  • useIsPlatform (7-7)
⏰ Context from checks skipped due to timeout of 180000ms. 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 (2)
packages/features/form-builder/FormBuilder.tsx (2)

652-665: Correct conditional fix for platform.

On platform, boolean label now uses InputField instead of Editor—matches CAL-6421 and restores editability/border. Please verify UX quickly in both contexts.

Manual check steps:

  • Platform render: add boolean booking field → edit label → confirm border and typing work; placeholder shows defaultLabel.
  • Non‑platform render: boolean uses rich Editor; others unchanged.

7-7: Import path OK — hook exists; verify client usage & exports

  • packages/platform/atoms/hooks/useIsPlatform.ts exports useIsPlatform and is imported/mocked across the repo.
  • No immediate circular-dep concern from a quick grep — the hook only imports useAtomsContext from the same atoms package.
  • Action: ensure FormBuilder.tsx is a client component (add "use client" as the very first line if it calls hooks/useIsPlatform) and confirm package export / tsconfig path mappings for any non-TS or external build targets.

Copy link

vercel bot commented Sep 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal Ignored Ignored Sep 18, 2025 4:51pm
cal-eu Ignored Ignored Sep 18, 2025 4:51pm

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 (2)
packages/features/form-builder/FormBuilder.tsx (2)

653-667: Good platform fallback; add RHF validation to truly enforce required label

The UI required attr is set, but RHF isn’t enforcing it. Add a required rule (and trim) in register so submission can’t proceed with an empty/whitespace label.

Apply:

-                      {formFieldType === "boolean" && !isPlatform ? (
+                      {formFieldType === "boolean" && !isPlatform ? (
                         <CheckboxFieldLabel fieldForm={fieldForm} />
                       ) : (
                         <InputField
-                          {...fieldForm.register("label")}
+                          {...fieldForm.register("label", {
+                            required: !["system", "system-but-optional"].includes(
+                              fieldForm.getValues("editable") || ""
+                            ),
+                            setValueAs: (v) => (typeof v === "string" ? v.trim() : v),
+                          })}
                           // System fields have a defaultLabel, so there a label is not required
                           required={
                             !["system", "system-but-optional"].includes(fieldForm.getValues("editable") || "")
                           }
+                          aria-required={
+                            !["system", "system-but-optional"].includes(fieldForm.getValues("editable") || "")
+                          }
                           placeholder={t(fieldForm.getValues("defaultLabel") || "")}
                           containerClassName="mt-6"
                           label={t("label")}
                         />
                       )}

7-7: Prefer importing useIsPlatform from the package entrypoint (@calcom/atoms)

packages/platform/atoms/index.ts re-exports useIsPlatform (line 7) and package.json also exposes the subpath; current deep import will work, but prefer changing to import { useIsPlatform } from "@calcom/atoms";.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • 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 f3a4ced and b300580.

📒 Files selected for processing (1)
  • packages/features/form-builder/FormBuilder.tsx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/review.mdc)

Always use t() for text localization in frontend code; direct text embedding should trigger a warning

Files:

  • packages/features/form-builder/FormBuilder.tsx
**/*.{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/form-builder/FormBuilder.tsx
**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.

Files:

  • packages/features/form-builder/FormBuilder.tsx
🧠 Learnings (2)
📓 Common learnings
Learnt from: supalarry
PR: calcom/cal.com#23364
File: apps/api/v2/src/ee/event-types/event-types_2024_06_14/transformers/internal-to-api/internal-to-api.spec.ts:295-296
Timestamp: 2025-08-27T13:32:46.887Z
Learning: In calcom/cal.com, when transforming booking fields from internal to API format, tests in organizations-event-types.e2e-spec.ts already expect name field label and placeholder to be empty strings ("") rather than undefined. PR changes that set these to explicit empty strings are typically fixing implementation to match existing test expectations rather than breaking changes.
📚 Learning: 2025-08-29T22:57:30.382Z
Learnt from: bandhan-majumder
PR: calcom/cal.com#23454
File: packages/features/form-builder/FormBuilder.tsx:11-11
Timestamp: 2025-08-29T22:57:30.382Z
Learning: FormBuilder.tsx in packages/features/form-builder/ does not have "use client" directive at the top despite using client-side React hooks and event handlers, which suggests it should be a client component.

Applied to files:

  • packages/features/form-builder/FormBuilder.tsx
🧬 Code graph analysis (1)
packages/features/form-builder/FormBuilder.tsx (1)
packages/platform/atoms/index.ts (1)
  • useIsPlatform (7-7)
⏰ Context from checks skipped due to timeout of 180000ms. 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 (1)
packages/features/form-builder/FormBuilder.tsx (1)

575-575: LGTM: correct use of platform check inside dialog scope

Hook usage is appropriate and scoped; no concerns.

@supalarry supalarry merged commit 4f114ef into main Sep 18, 2025
58 of 61 checks passed
@supalarry supalarry deleted the lauris/cal-6421-fix-eventtypesettings-atom-checkbox-booking-field branch September 18, 2025 17:14
Copy link
Contributor

E2E results are ready!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only platform Anything related to our platform plan ready-for-e2e size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants