Skip to content

Conversation

@gabrielseco
Copy link
Collaborator

@gabrielseco gabrielseco commented Oct 10, 2025

Note

Medium Risk
Changes onboarding form behavior and value mapping for a specific field, which could impact saved/validated payloads and selection UX, but does not touch auth or backend data processing.

Overview
Adds a new TaxServicingCountriesField component that enhances the tax_servicing_countries multi-select by supporting Global, region/subregion group selections (expanded into individual countries), and de-duplication of overlapping selections.

Wires this component into onboarding’s basic_information schema via jsfModify so it can be enabled/disabled through presentation.enableCustomTaxServicingComponent, and updates the example app to enable the new behavior by default.

Written by Cursor Bugbot for commit 81c63cc. This will update automatically on new commits. Configure here.

@gabrielseco gabrielseco self-assigned this Oct 10, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 10, 2025

Deploy preview for remote-flows ready!

✅ Preview
https://remote-flows-pv1cp3yhb-remotecom.vercel.app

Built with commit 81c63cc.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link
Contributor

github-actions bot commented Oct 10, 2025

Deploy preview for remote-flows-example-app ready!

✅ Preview
https://remote-flows-example-9phaf5ynq-remotecom.vercel.app

Built with commit 81c63cc.
This pull request is being automatically deployed with vercel-action

@gabrielseco
Copy link
Collaborator Author

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

selected={selectedOptions}
onChange={handleChange}
{...rest}
/>
Copy link

Choose a reason for hiding this comment

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

Form state not updated when using default MultiSelect

High Severity

The default MultiSelect path passes handleChange directly as the onChange handler, but handleChange never calls field.onChange from react-hook-form. This means the form's internal state is never updated when selections change. The UI will visually show the correct selections via local state, but form submission will contain stale or initial values because the form field value was never synchronized.

Fix in Cursor Fix in Web

const customBasicInformationFields = useMemo(() => {
const enableCustomTaxServicingComponent =
taxServicingCountriesFieldPresentation?.enableCustomTaxServicingComponent !==
false;
Copy link

Choose a reason for hiding this comment

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

Custom component enabled by default instead of opt-in

Medium Severity

The condition !== false causes enableCustomTaxServicingComponent to default to true when not specified, making the custom component opt-out rather than opt-in. The example code explicitly sets enableCustomTaxServicingComponent: true, which would be redundant if that were the default—suggesting opt-in behavior was intended. This means all users of the basic_information form get the custom TaxServicingCountriesField component even without requesting it, potentially causing unexpected behavior changes.

Fix in Cursor Fix in Web

selected ||
enhancedOptions.filter((option) =>
field.value?.includes(option.value),
);
Copy link

Choose a reason for hiding this comment

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

Local state ignores external form value changes

Medium Severity

The selected state is initialized as undefined and only falls back to field.value while undefined. After any user interaction, handleChange calls setSelected, setting it to an array. From then on, selectedOptions always uses the local selected state (since even [] is truthy), ignoring any external changes to field.value. This means form.reset() or programmatic value changes won't update the UI - users will see stale selections.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants