Skip to content

feat(routing-forms): add booking-question field types + identifier-first UX#28224

Closed
sirrodgepodge wants to merge 1 commit intocalcom:mainfrom
sirrodgepodge:feat/routing-form-booking-questions
Closed

feat(routing-forms): add booking-question field types + identifier-first UX#28224
sirrodgepodge wants to merge 1 commit intocalcom:mainfrom
sirrodgepodge:feat/routing-form-booking-questions

Conversation

@sirrodgepodge
Copy link

@sirrodgepodge sirrodgepodge commented Mar 1, 2026

Summary

  • extend routing form question types to include booking-question style inputs: radio, checkbox, url, address, and multiemail
  • wire these new types into routing form rendering and query-builder config (including option-aware types)
  • normalize route-evaluation response transforms for radio/checkbox alongside existing select/multiselect behavior
  • update routing form editor UX to ask for identifier first and stop auto-prefilling identifier from label, matching event-type booking question flow

Notes

  • kept the implementation aligned with existing routing-form patterns and RAQB widget/type mapping
  • focused on bringing routing forms closer to event-type booking-question behavior without changing persisted data model contracts

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

    • New field types: URL, Address, Multi-email, Radio, Checkbox.
    • RAQB support and widgets; radio/checkbox are option-aware.
    • Options editor now appears for select, multiselect, radio, and checkbox.
    • Normalized transforms: select+radio and multiselect+checkbox handled consistently for route evaluation.
    • No data model changes.
  • UX Improvements

    • Identifier comes first; label second.
    • Stops auto-prefilling identifier from the label.

Written for commit 44e952f. Summary will update on new commits.

Copilot AI review requested due to automatic review settings March 1, 2026 07:00
@CLAassistant
Copy link

CLAassistant commented Mar 1, 2026

CLA assistant check
All committers have signed the CLA.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Mar 1, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 listValues behavior).
  • 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 radio and checkbox was added here, but the unit tests in transformResponse.test.ts only cover select/multiselect. Add test cases for radio and checkbox (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.

Comment on lines +7 to +13
RADIO = "radio",
CHECKBOX = "checkbox",
PHONE = "phone",
EMAIL = "email",
URL = "url",
ADDRESS = "address",
MULTI_EMAIL = "multiemail",
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines 33 to 82
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;
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

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

Copilot uses AI. Check for mistakes.
Copy link
Member

@romitg2 romitg2 left a comment

Choose a reason for hiding this comment

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

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.

@romitg2 romitg2 closed this Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Created by Linear-GitHub Sync size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants