Skip to content

Comments

fix: error when opening date override input dialog#23182

Merged
alishaz-polymath merged 2 commits intomainfrom
date-picker-dialog
Aug 19, 2025
Merged

fix: error when opening date override input dialog#23182
alishaz-polymath merged 2 commits intomainfrom
date-picker-dialog

Conversation

@anikdhabal
Copy link
Contributor

@anikdhabal anikdhabal commented Aug 19, 2025

What does this PR do?

Issue:-

Availability._.Cal.com.mp4

@graphite-app graphite-app bot requested a review from a team August 19, 2025 10:10
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 19, 2025

Walkthrough

The 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 Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch date-picker-dialog

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@keithwillcode keithwillcode added the core area: core, team members only label Aug 19, 2025
@anikdhabal anikdhabal changed the title fix: error opening date override input dialog fix: error when opening date override input dialog Aug 19, 2025
@dosubot dosubot bot added ui area: UI, frontend, button, form, input 🐛 bug Something isn't working labels Aug 19, 2025
@graphite-app
Copy link

graphite-app bot commented Aug 19, 2025

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.

Copy link
Member

@alishaz-polymath alishaz-polymath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 it

We’ve verified that packages/features/calendars/DatePicker.tsx imports and calls useBookerStoreContext (e.g. lines 7, 230, 403), so wrapping it in BookerStoreProvider is required. To avoid scattering direct imports of the provider across feature components, consider one of the following optional refactors:

• Move BookerStoreProvider into a shared layout or at the app root so schedules (and any other feature) automatically get the context.
• Create a MaybeBookerStoreProvider helper that only instantiates a store if none exists, and use that in DateOverrideInputDialog.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.

📥 Commits

Reviewing files that changed from the base of the PR and between 9e9f815 and 90e2b7d.

📒 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 error

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

@vercel
Copy link

vercel bot commented Aug 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal Ignored Ignored Aug 19, 2025 10:25am
cal-eu Ignored Ignored Aug 19, 2025 10:25am

@github-actions
Copy link
Contributor

E2E results are ready!

@alishaz-polymath alishaz-polymath merged commit af6e24f into main Aug 19, 2025
60 of 63 checks passed
@alishaz-polymath alishaz-polymath deleted the date-picker-dialog branch August 19, 2025 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge 🐛 bug Something isn't working core area: core, team members only ready-for-e2e ui area: UI, frontend, button, form, input

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants