fix: error when opening date override input dialog#23182
fix: error when opening date override input dialog#23182alishaz-polymath merged 2 commits intomainfrom
Conversation
WalkthroughThe change updates packages/features/schedules/components/DateOverrideInputDialog.tsx to import BookerStoreProvider and wrap the DatePicker within it inside DateOverrideForm. All DatePicker props and handlers (excludedDates, weekStart, selected, onChange, onMonthChange, browsingDate, locale) are passed through unchanged. No other UI structure or logic is modified, and there are no changes to exported/public entity signatures. Possibly related PRs
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (08/19/25)1 reviewer was added to this PR based on Keith Williams's automation. "Add ready-for-e2e label" took an action on this PR • (08/19/25)1 label was added to this PR based on Keith Williams's automation. |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/features/schedules/components/DateOverrideInputDialog.tsx (2)
140-154: Add context and guard against double providers; verify state sync between store and local state
- Add a brief inline comment explaining why the provider is needed here (future maintainers will thank you).
- If this dialog is ever rendered under an existing BookerStoreProvider, nesting providers will create a fresh store and may reset internal month/selection state unexpectedly. Also, ensure that the DatePicker’s internal store state won’t drift from your external selectedDates prop.
Apply this small inline comment to document the intent:
<DialogHeader title={t("date_overrides_dialog_title")} /> - <BookerStoreProvider> + {/* DatePicker depends on BookerStoreContext; wrap locally to avoid missing-provider errors (see linked issue). */} + <BookerStoreProvider> <DatePicker excludedDates={excludedDates} weekStart={weekStart} selected={selectedDates} onChange={(day) => { if (day) onDateChange(day); }} onMonthChange={(newMonth) => { setBrowsingDate(newMonth); }} browsingDate={browsingDate} locale={isLocaleReady ? i18n.language : "en"} /> </BookerStoreProvider>And please verify:
- There isn’t already a BookerStoreProvider higher up when this dialog is used.
- The DatePicker’s props (selected, onChange, onMonthChange) continue to function without conflict with any internal store-driven selection/month logic.
You can spot-check with a lightweight Storybook or RTL test by opening the dialog, selecting dates, navigating months, and ensuring no errors are thrown and selections persist as expected.
6-6: Cross-feature coupling confirmed—DatePicker relies on BookerStoreContext, keep the provider but centralize itWe’ve verified that
packages/features/calendars/DatePicker.tsximports and callsuseBookerStoreContext(e.g. lines 7, 230, 403), so wrapping it inBookerStoreProvideris required. To avoid scattering direct imports of the provider across feature components, consider one of the following optional refactors:• Move
BookerStoreProviderinto a shared layout or at the app root so schedules (and any other feature) automatically get the context.
• Create aMaybeBookerStoreProviderhelper that only instantiates a store if none exists, and use that inDateOverrideInputDialog.tsx.Files to update as part of the refactor:
- packages/features/schedules/components/DateOverrideInputDialog.tsx (remove direct import, wrap with shared provider)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/features/schedules/components/DateOverrideInputDialog.tsx(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.tsx
📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
Always use
t()for text localization in frontend code; direct text embedding should trigger a warning
Files:
packages/features/schedules/components/DateOverrideInputDialog.tsx
**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js
.utc()in hot paths like loops
Files:
packages/features/schedules/components/DateOverrideInputDialog.tsx
🧬 Code Graph Analysis (1)
packages/features/schedules/components/DateOverrideInputDialog.tsx (2)
packages/features/bookings/Booker/BookerStoreProvider.tsx (1)
BookerStoreProvider(15-22)packages/features/bookings/Booker/components/DatePicker.tsx (1)
DatePicker(54-156)
🔇 Additional comments (1)
packages/features/schedules/components/DateOverrideInputDialog.tsx (1)
140-154: LGTM: Wrapping DatePicker with BookerStoreProvider should resolve the missing-context errorThis is a pragmatic fix to prevent the “error opening date override input dialog” when the DatePicker expects a Booker store context. No new user-facing strings were added; i18n guidelines remain satisfied.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
E2E results are ready! |
What does this PR do?
Issue:-
Availability._.Cal.com.mp4