Skip to content

Conversation

anikdhabal
Copy link
Contributor

No description provided.

Copy link
Contributor

coderabbitai bot commented Aug 8, 2025

Walkthrough

A new onChange event handler was introduced to the second TextField in the DuplicateDialog component. This handler applies the slugify function to the input value and updates the form's "slug" field accordingly, while also marking the field as touched. No changes were made to exported or public entity declarations or signatures.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch slugify-dulicate-event-url

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
  • 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 src/utils.ts and explain its main purpose.
    • @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 comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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 requested a review from a team August 8, 2025 15:12
@keithwillcode keithwillcode added the core area: core, team members only label Aug 8, 2025
@anikdhabal anikdhabal enabled auto-merge (squash) August 8, 2025 15:12
@anikdhabal anikdhabal changed the title fix: slugify event url in duplicate dialog fix: slugify event slug in duplicate dialog Aug 8, 2025
@dosubot dosubot bot added event-types area: event types, event-types 🐛 bug Something isn't working labels Aug 8, 2025
Copy link

graphite-app bot commented Aug 8, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (08/08/25)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add ready-for-e2e label" took an action on this PR • (08/08/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/features/eventtypes/components/DuplicateDialog.tsx (1)

153-156: Trigger dirty state and validation; compose with RHF instead of overriding onChange.

Current handler only sets shouldTouch. To keep RHF state accurate and show validation promptly, also set shouldDirty and shouldValidate. Optionally, move the handler into register options to avoid overriding RHF’s internal onChange.

Minimal change (keep current approach, just enhance state/validation):

-                onChange={(e) => {
-                  form.setValue("slug", slugify(e?.target.value), { shouldTouch: true });
-                }}
+                onChange={(e) => {
+                  form.setValue("slug", slugify(e?.target.value), {
+                    shouldTouch: true,
+                    shouldDirty: true,
+                    shouldValidate: true,
+                  });
+                }}

Alternative (compose with RHF by injecting onChange via register options):

-                {...register("slug")}
-                onChange={(e) => {
-                  form.setValue("slug", slugify(e?.target.value), { shouldTouch: true });
-                }}
+                {...register("slug", {
+                  onChange: (e) => {
+                    form.setValue("slug", slugify(e?.target?.value ?? ""), {
+                      shouldTouch: true,
+                      shouldDirty: true,
+                      shouldValidate: true,
+                    });
+                  },
+                })}

Optional deduplication: define a shared handleSlugChange and reuse it in both branches to avoid divergence.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 659d9cf and a4753a9.

📒 Files selected for processing (1)
  • packages/features/eventtypes/components/DuplicateDialog.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.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/eventtypes/components/DuplicateDialog.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/eventtypes/components/DuplicateDialog.tsx
🧠 Learnings (2)
📚 Learning: 2025-07-28T11:50:23.946Z
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*.tsx : Always use `t()` for text localization in frontend code; direct text embedding should trigger a warning

Applied to files:

  • packages/features/eventtypes/components/DuplicateDialog.tsx
📚 Learning: 2025-07-21T21:33:23.371Z
Learnt from: Anshumancanrock
PR: calcom/cal.com#22570
File: apps/web/modules/signup-view.tsx:253-253
Timestamp: 2025-07-21T21:33:23.371Z
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.

Applied to files:

  • packages/features/eventtypes/components/DuplicateDialog.tsx
⏰ 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: Detect changes
🔇 Additional comments (1)
packages/features/eventtypes/components/DuplicateDialog.tsx (1)

153-156: LGTM: Slugify on change ensures consistent URL formatting.

Mirrors the behavior of the other branch and prevents title-based auto-slug updates after the user edits the slug.

@anikdhabal anikdhabal merged commit 49f99d6 into main Aug 8, 2025
101 of 109 checks passed
@anikdhabal anikdhabal deleted the slugify-dulicate-event-url branch August 8, 2025 15:48
Pallava-Joshi pushed a commit to Pallava-Joshi/cal.com that referenced this pull request Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working core area: core, team members only event-types area: event types, event-types ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants