Skip to content

Conversation

@Spandan-Mishra
Copy link
Contributor

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)

  • 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. - N/A
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Go to availability section
  2. Click on any availability
  3. See that the save button now is only enabled when changes are made

@Spandan-Mishra Spandan-Mishra requested review from a team as code owners December 24, 2025 00:10
@vercel
Copy link

vercel bot commented Dec 24, 2025

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

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Dec 24, 2025
@github-actions github-actions bot added the 🐛 bug Something isn't working label Dec 24, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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&#39;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

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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 (`&amp;&amp;`) 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&#39;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 volnei enabled auto-merge (squash) December 27, 2025 02:29
Copy link
Contributor

@volnei volnei left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working community Created by Linear-GitHub Sync ready-for-e2e size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Availabilty Settings save button is enabled always

2 participants