fix: disable save button when no real event type changes exist#28690
fix: disable save button when no real event type changes exist#28690seffhunnn wants to merge 4 commits intocalcom:mainfrom
Conversation
There was a problem hiding this comment.
1 issue found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/platform/atoms/event-types/hooks/useEventTypeForm.ts">
<violation number="1" location="packages/platform/atoms/event-types/hooks/useEventTypeForm.ts:219">
P2: Unsaved-change detection can go stale because `useMemo` depends only on `watchedValues` while baseline changes via non-reactive `ref` updates.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
|
Hi maintainers this is my first contribution to Cal.com. This PR fixes the event-type save button state issue by using deep equality against a baseline reference so reverted changes correctly disable the Save button again. Would appreciate a review and workflow approval when possible. Thank you! |
Ryukemeister
left a comment
There was a problem hiding this comment.
hi there, thank you for your contribution. the issue that you've linked redirects to another PR which fixes the same issue. can you please link the correct issue? also are you able to reproduce this on your end? can you attach a visual demo of the fix before/after. we also need relevant tests for the fix.
Thanks for the review! I’ve updated the issue reference in the PR description to avoid auto-closing the linked issue. I’m also reproducing the behavior locally and will attach a before/after visual demo along with relevant test coverage for the unsaved-change detection logic. |
|
Hi, I’ve updated the branch with the latest changes from "main" and refreshed the checks I also corrected the PR to link the original open issue "#13112", and the branch now includes the regression test plus the visual proof for the revert-to-baseline save button behavior. Would really appreciate another look whenever you get the chance. Thanks again for the helpful review feedback! |

What does this PR do?
This PR fixes the event-type save button state by replacing the unreliable React Hook Form
isDirtycheck with deep equality against a baseline reference.The save button now:
defaultValuesbaseline syncVisual Demo (For contributors especially)
N/A (logic/state fix)
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist