-
Notifications
You must be signed in to change notification settings - Fork 11.4k
fix: save button in availibility disabled when no changes #26174
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?
fix: save button in availibility disabled when no changes #26174
Conversation
|
@Spandan-Mishra is attempting to deploy a commit to the cal-staging Team on Vercel. A member of the Team first needs to authorize it. |
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.
2 issues found across 2 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/platform/atoms/availability/AvailabilitySettings.tsx">
<violation number="1" location="packages/platform/atoms/availability/AvailabilitySettings.tsx:340">
P2: Incomplete change detection: Only comparing `schedule` field, but the form also has `name`, `timeZone`, `isDefault`, and `dateOverrides` fields. Users won't be able to save changes to these other fields. Consider comparing all form values or use `form.formState.isDirty` consistently.</violation>
<violation number="2" location="packages/platform/atoms/availability/AvailabilitySettings.tsx:345">
P1: Bug: Property name mismatch - comparing against `initialValuesRef.current.availability` but the form stores the value as `schedule`. This will always show changes since `availability` is `undefined` on the form values. Should be `initialValuesRef.current.schedule`.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
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.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/platform/atoms/availability/AvailabilitySettings.tsx">
<violation number="1" location="packages/platform/atoms/availability/AvailabilitySettings.tsx:343">
P2: The AND (`&&`) logic is misleading. If `initialValuesRef.current.availability` were properly defined, changing only the name or timezone would disable the save button since the schedule hasn't changed. It works currently only because `availability` is undefined on form values. Consider using OR (`||`) or simplifying to just check `watchedValues !== initial`.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
volnei
left a comment
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.
Thank you for your contribution! ❤️
Looking good to me!
What does this PR do?
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):
Before:
Screencast.from.2025-12-24.05-21-18.mp4
After:
Screencast.from.2025-12-24.05-15-02.mp4
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?