feat(routing-forms): add booking-question field types + identifier-first UX#28224
feat(routing-forms): add booking-question field types + identifier-first UX#28224sirrodgepodge wants to merge 1 commit intocalcom:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends routing-form support to better align with “booking question” field capabilities and UX, by adding new field types and integrating them into routing evaluation/query-builder configuration while updating the form editor flow to be identifier-first.
Changes:
- Add new routing-form field types (
radio,checkbox,url,address,multiemail) and expose them in the editor field-type dropdown. - Wire new option-based types into route-evaluation transforms and RAQB/query-builder config (including
listValuesbehavior). - Update routing-form editor UX to prompt for identifier first and stop auto-prefilling identifier from label.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/app-store/routing-forms/lib/transformResponse.ts | Extends response normalization to handle checkbox like multiselect and radio like select. |
| packages/app-store/routing-forms/lib/getQueryBuilderConfig.ts | Ensures RAQB listValues is set for radio/checkbox option fields. |
| packages/app-store/routing-forms/lib/FieldTypes.ts | Adds new field-type constants and exposes them in the selectable FieldTypes list. |
| packages/app-store/routing-forms/components/react-awesome-query-builder/config/uiConfig.tsx | Adds widget factories for new types (including radio/checkbox aliases). |
| packages/app-store/routing-forms/components/react-awesome-query-builder/config/config.ts | Registers new widget/type entries to support rendering/evaluation for added field types. |
| apps/web/app/(use-page-wrapper)/apps/routing-forms/[...pages]/FormEdit.tsx | Reorders editor inputs for identifier-first UX and enables options UI for radio/checkbox. |
Comments suppressed due to low confidence (1)
packages/app-store/routing-forms/lib/transformResponse.ts:91
- Support for
radioandcheckboxwas added here, but the unit tests intransformResponse.test.tsonly coverselect/multiselect. Add test cases forradioandcheckbox(including legacy-option behavior and label-vs-id prefills) to prevent regressions in route evaluation and response normalization.
if (field.type === "multiselect" || field.type === "checkbox") {
// Could be option id(i.e. a UUIDv4) or option label for ease of prefilling
let valueOrLabelArray = value instanceof Array ? value : value.toString().split(",");
valueOrLabelArray = valueOrLabelArray.map((idOrLabel) => {
return transformSelectValue({ field, idOrLabel });
});
return valueOrLabelArray;
}
if (field.type === "select" || field.type === "radio") {
const valueAsStringOrStringArray = typeof value === "number" ? String(value) : value;
const valueAsString =
valueAsStringOrStringArray instanceof Array
? valueAsStringOrStringArray[0]
: valueAsStringOrStringArray;
return transformSelectValue({ field, idOrLabel: valueAsString });
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| RADIO = "radio", | ||
| CHECKBOX = "checkbox", | ||
| PHONE = "phone", | ||
| EMAIL = "email", | ||
| URL = "url", | ||
| ADDRESS = "address", | ||
| MULTI_EMAIL = "multiemail", |
There was a problem hiding this comment.
radio/checkbox are option-based field types, but webhook response formatting currently only treats select/multiselect as options fields (see isOptionsField in routing-forms/lib/formSubmissionUtils.ts). As a result, submissions for these new types will likely emit raw ids/values instead of the {label,id} mapping used for other option fields. Update the options-field detection/formatting to include radio and checkbox so webhook payloads remain consistent across option-based inputs.
| export const FieldTypes = [ | ||
| { | ||
| label: "Short text", | ||
| value: RoutingFormFieldType.TEXT, | ||
| }, | ||
| { | ||
| label: "Number", | ||
| value: RoutingFormFieldType.NUMBER, | ||
| }, | ||
| { | ||
| label: "Long text", | ||
| value: RoutingFormFieldType.TEXTAREA, | ||
| }, | ||
| { | ||
| label: "Single-choice selection", | ||
| value: RoutingFormFieldType.SINGLE_SELECT, | ||
| }, | ||
| { | ||
| label: "Multiple choice selection", | ||
| value: RoutingFormFieldType.MULTI_SELECT, | ||
| }, | ||
| { | ||
| label: "Radio", | ||
| value: RoutingFormFieldType.RADIO, | ||
| }, | ||
| { | ||
| label: "Checkbox", | ||
| value: RoutingFormFieldType.CHECKBOX, | ||
| }, | ||
| { | ||
| label: "Phone", | ||
| value: RoutingFormFieldType.PHONE, | ||
| }, | ||
| { | ||
| label: "Email", | ||
| value: RoutingFormFieldType.EMAIL, | ||
| }, | ||
| { | ||
| label: "URL", | ||
| value: RoutingFormFieldType.URL, | ||
| }, | ||
| { | ||
| label: "Address", | ||
| value: RoutingFormFieldType.ADDRESS, | ||
| }, | ||
| { | ||
| label: "Multiple emails", | ||
| value: RoutingFormFieldType.MULTI_EMAIL, | ||
| }, | ||
| ] as const; |
There was a problem hiding this comment.
Adding new field types changes the field-type dropdown contents, but existing Playwright tests assert the exact list of field types (e.g. routing-forms/playwright/tests/testUtils.ts and basic.e2e.ts expect only the previous 7 labels). These tests will fail until their expected option list and any option-filling logic are updated to account for the newly added types (and for radio/checkbox needing options).
romitg2
left a comment
There was a problem hiding this comment.
Thank you @sirrodgepodge for your work, but PR is missing visual demo and add tests, so going with this one #28145 as it's better handled there.
Summary
radio,checkbox,url,address, andmultiemailradio/checkboxalongside existingselect/multiselectbehaviorNotes
Summary by cubic
Adds booking-question field types (URL, Address, Multiple emails, Radio, Checkbox) to routing forms and wires them into rendering, query builder, and response transforms. Switches the editor to identifier-first and removes identifier auto-fill to match event-type booking questions.
New Features
UX Improvements
Written for commit 44e952f. Summary will update on new commits.