feat: re-render bookings page after feature opt-in without full refresh#27873
Merged
dhairyashiil merged 2 commits intomainfrom Feb 12, 2026
Merged
feat: re-render bookings page after feature opt-in without full refresh#27873dhairyashiil merged 2 commits intomainfrom
dhairyashiil merged 2 commits intomainfrom
Conversation
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
dhairyashiil
approved these changes
Feb 12, 2026
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.
What does this PR do?
After a user opts into a feature via the
useFeatureOptInBanner()banner on/bookings, the page now re-renders to apply the feature immediately — without a full browser reload.Problem:
bookingsV3Enabledis computed server-side in the page component and passed as a prop. When a user opts in via the banner, only the banner's local state updates (hiding it), but the server-computed prop remains stale until a manual page refresh.Solution: Adds a required
onOptInSuccesscallback touseFeatureOptInBanner(). In the bookings view, this callback callsrouter.refresh()— the idiomatic Next.js App Router method that re-runs the server component and streams updated props to the client without losing client-side state.This pattern is already established in the codebase (e.g.,
PbacOptInModal,RoleSheet).Updates since last revision
onOptInSuccessfrom optional to required per reviewer feedback, ensuring every consumer explicitly handles the post-opt-in behavior.onOptInSuccess.Demo
Screenshot.2026-02-11.at.16.12.48.mp4
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
/bookingsas a user eligible for thebookings-v3feature opt-in banner.bookings-v3feature (e.g., calendar view toggle becomes available) without a full browser reload.Unit test:
TZ=UTC yarn test apps/web/modules/feature-opt-in/hooks/useFeatureOptInBanner.test.tsHuman Review Checklist
onOptInSuccessrequired (rather than optional) is the desired contract — every future consumer ofuseFeatureOptInBannermust provide this callbackuseFeatureOptInBannershould also wire uponOptInSuccesswithrouter.refresh()Link to Devin run: https://app.devin.ai/sessions/8ab178f5789541b2ba241659860a09b0
Requested by: @eunjae-lee