Skip to content

fix: order custom questions by event type bookingFields in BookingDetailsSheet#28140

Merged
emrysal merged 1 commit intomainfrom
devin/1771849684-apply-booking-details-sheet-fix
Feb 23, 2026
Merged

fix: order custom questions by event type bookingFields in BookingDetailsSheet#28140
emrysal merged 1 commit intomainfrom
devin/1771849684-apply-booking-details-sheet-fix

Conversation

@emrysal
Copy link
Contributor

@emrysal emrysal commented Feb 23, 2026

What does this PR do?

Applies calcom/cal@07914e6 onto cal.com.

Previously, custom questions in the BookingDetailsSheet were rendered based on the iteration order of Object.entries(booking.responses), which is arbitrary (JS object key insertion order). This PR changes the iteration to use the event type's bookingFields array, so custom questions appear in the order configured by the event type author.

Changes:

  • Iterate over bookingFields instead of responses: The component now maps over the bookingFields array and looks up each field's answer from the responses record, ensuring consistent ordering
  • Boolean field display: Boolean answers now render as localized "Yes"/"No" instead of raw "true"/"false"
  • Simplified logic: Removed intermediate validResponses and fieldLabels memoizations since the new single-pass approach is cleaner
  • Minor formatting: Fixed indentation of recurringInfo ternary and added parentheses around nullish coalescing in localizedTimezone

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. 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. Create an event type with multiple custom booking fields (text, boolean, select, etc.)
  2. Create a booking for that event type and fill in responses
  3. Open the booking details sheet
  4. Verify custom questions appear in the same order as defined in the event type's booking fields configuration (not in arbitrary object-key order)
  5. Verify boolean fields display "Yes"/"No" instead of "true"/"false"

Important review notes

  • Behavior change when bookingFields is undefined: Previously, responses would still render even without bookingFields. Now, if bookingFields is missing, the entire section returns null. Reviewers should verify this is acceptable — it could hide responses for edge cases where the event type's bookingFields isn't populated.
  • This is a manual cherry-pick from calcom/cal (the file has minor import differences between repos), so verifying the adaptation is faithful to the original commit is worthwhile.

Link to Devin run: https://app.devin.ai/sessions/47ca67e7f55845e09b24e6e015f38d9a
Requested by: @emrysal

@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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 1 file

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/web/modules/bookings/components/BookingDetailsSheet.tsx">

<violation number="1" location="apps/web/modules/bookings/components/BookingDetailsSheet.tsx:831">
P2: Custom questions are now hidden entirely when `bookingFields` is undefined, even if `responses` exist. This regresses the previous behavior and can make historical bookings show no custom questions. Consider falling back to rendering `responses` when `bookingFields` is missing.</violation>

<violation number="2" location="apps/web/modules/bookings/components/BookingDetailsSheet.tsx:842">
P2: Boolean responses that are `false` are filtered out by `if (!answer) return null`, so the new Yes/No rendering never shows "No". Adjust the guard to only skip null/undefined (and empty strings) so false values render correctly.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

Devin AI is addressing Cubic AI's review feedback

New feedback has been sent to the existing Devin session.

View Devin Session


✅ No changes pushed

@emrysal emrysal marked this pull request as ready for review February 23, 2026 12:49
@emrysal emrysal enabled auto-merge (squash) February 23, 2026 12:49
@graphite-app graphite-app bot added core area: core, team members only foundation labels Feb 23, 2026
@graphite-app graphite-app bot requested a review from a team February 23, 2026 12:49
@emrysal emrysal merged commit f00be08 into main Feb 23, 2026
81 of 82 checks passed
@emrysal emrysal deleted the devin/1771849684-apply-booking-details-sheet-fix branch February 23, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants