[CLEAN] Synthetic Benchmark PR #26931 - feat(companion): add optimistic updates to availability edit screens#649
Open
tomerqodo wants to merge 1 commit intobase_pr_26931_20260121_5414from
Conversation
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
|
This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Benchmark PR calcom#26931
Type: Clean (correct implementation)
Original PR Title: feat(companion): add optimistic updates to availability edit screens
Original PR Description:
Screen.Recording.2026-01-16.at.6.56.47.PM.mov
Fixes calcom#26908
Fixes CAL-7077
What does this PR do?
Implements optimistic updates for availability edit screens in the companion app (iOS, Android, browser extension). This is part of a larger refactoring effort to add auto-refresh/reload after save actions.
Phase 1 - EditAvailabilityNameScreen:
useUpdateSchedulehook with full optimistic update support (onMutate, onSuccess, onError)EditAvailabilityNameScreen.tsxandEditAvailabilityNameScreen.ios.tsxto use the mutation hook instead of direct API callsPhase 2 - EditAvailabilityOverrideScreen:
EditAvailabilityOverrideScreen.tsxandEditAvailabilityOverrideScreen.ios.tsxto useuseUpdateSchedulemutation hookCalComAPIService.updateSchedulecalls with the mutation hookisSavingstate in favor ofisPendingfrom the mutation hookPhase 3 - EditAvailabilityDayScreen:
EditAvailabilityDayScreen.tsxandEditAvailabilityDayScreen.ios.tsxto useuseUpdateSchedulemutation hookCalComAPIService.updateSchedulecalls with the mutation hookisSavingstate in favor ofisPendingfrom the mutation hookSupporting Changes (by @dhairyashiil):
AvailabilityDetailScreen.tsxandAvailabilityDetailScreen.ios.tsxto useuseScheduleByIdhook instead of direct API callsRefreshControlfor pull-to-refresh supportuseSetScheduleAsDefaultanduseDeleteSchedulehooksUpdates since last revision
Fixed stale data issue on the Working Hours page (page 2 in the edit flow):
edit-availability-hours.tsxandedit-availability-hours.ios.tsxroute files to useuseScheduleByIdhookCalComAPIService.getScheduleById()calls with localuseState, bypassing the React Query cacheFixed Date Overrides section not clickable when empty:
AppPressablewith navigation handler and chevron iconMandatory Tasks (DO NOT REMOVE)
How should this be tested?
Phase 1 - Edit Name/Timezone:
Phase 2 - Edit Overrides:
Phase 3 - Edit Day Availability:
Date Overrides Empty State:
Error case: If network fails, UI should roll back to previous state and show error alert
Checklist
Human Review Checklist
AvailabilityDetailScreenproperly reads from React Query cache viauseScheduleById(critical for cache updates to propagate)edit-availability-hoursroute files properly read from React Query cache viauseScheduleByIduseUpdateSchedulehandlesavailabilityfield correctly via spread operatoronErrorrestores both detail and list caches correctlyLink to Devin run: https://app.devin.ai/sessions/0e35f5cdab8943dabb66fc182e4241fe
Requested by: Dhairyashil Shinde (@dhairyashiil)
Original PR URL: calcom#26931