Feat/pbyr 4321 continue blocked italy apl#1189
Open
jordividaller wants to merge 3 commits into
Open
Conversation
Contributor
📦 Bundle Size Report
Size Limits
Largest Files (Top 5)
View All Files (400 total)
✅ Bundle size check passed |
Contributor
📊 Coverage Report✅ Coverage increased! 🎉
Detailed BreakdownLines Coverage
Statements Coverage
Functions Coverage
Branches Coverage
✅ Coverage check passed |
Contributor
|
Deploy preview for adp-cost-calculator ready!
Deployed with vercel-action |
Contributor
|
Deploy preview for remote-flows ready!
Deployed with vercel-action |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 96b3332. Configure here.
…lidation Fixes two unit mismatches that silently blocked the Italy APL onboarding continue button (PBYR-4321): 1. Number inputs are stored as strings by react-hook-form, and the jsfVersion 1 engine evaluates `type: 'number'` guards in conditionals strictly (v0 casts via yup, which is why this never surfaced before). Visibility and validation disagreed: a conditional computed field was required by validation but never rendered. createHeadlessForm now coerces number field values before evaluating the schema, mirroring the existing money coercion. 2. ForcedValueField injected money consts raw (cents) into the form state, and the submit path re-applied convertToCents, producing a 100x value rejected by the const check. getForcedFieldValue converts money consts to units at both injection call sites. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
jordividaller
force-pushed
the
feat/pbyr-4321-continue-blocked-italy-apl
branch
2 times, most recently
from
July 25, 2026 09:20
20fae34 to
28f356a
Compare
…sion Review follow-ups on the PBYR-4321 fix: - Extract castNumberValue and use it in both the validation transform and the visibility coercion in createHeadlessForm, so the two paths cannot drift apart again. - Move the money const cents-to-units conversion into ForcedValueField itself instead of duplicating getForcedFieldValue at each call site. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
jordividaller
force-pushed
the
feat/pbyr-4321-continue-blocked-italy-apl
branch
from
July 25, 2026 09:22
28f356a to
401e1ec
Compare
Number() turns ' ', true and [] into 0, so the coercion added for JSF v1 number guards opened conditionals the user never filled in. Measured against the base commit, a whitespace-only value flipped the dependent field from hidden to visible. Add isNumericValue(), which rejects booleans, arrays and blank strings, and use it in createHeadlessForm instead of the '' / null / undefined check plus the typeof guard it needed afterwards. castNumberValue keeps its lenient behaviour: it also backs the submit path, where an empty number field currently sends 0 to the API, and tightening it there would change the payload. Restore the comment explaining its NaN passthrough, lost when it was extracted. Cover whitespace and non-scalar values, plus a v0 schema locking in that the coercion stays a no-op there, since nothing branches on jsfVersion. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
On the Italy APL onboarding schema, the continue button appeared dead: clicking it did nothing, with no visible error. The validation was rejecting
non_compete_clause_compensation_amount— a computed field that was never rendered, so no error message could be shown.Root causes (two unit mismatches in the same chain)
1. Visibility vs validation disagree on number types.
react-hook-form stores number inputs as strings (
"50"). The jsfVersion 1 engine evaluatestype: 'number'guards inifconditionals strictly, so the conditional revealing the computed field never matched — while validation (parseJSFToValidate) does coerce, and required the field. v0 schemas were never affected because that engine casts strings via yup, which is why this never surfaced before.Fix:
createHeadlessFormnow coerces number-field values before evaluating the schema, mirroring the existing money coercion (top-level properties, empty/invalid input left untouched).2. Money consts double-converted to cents.
Once visible, the forced-value field failed with
"The only accepted value is X":ForcedValueFieldinjected the schema const raw (cents) into the form state, and the submit path re-appliedconvertToCents, producing a 100x value.Fix:
getForcedFieldValue()converts money consts to units at both injection call sites (JSONSchemaForm,FieldSetField).Tests
src/common/tests/createHeadlessForm.test.ts— locks the visibility bug on a minimal jsfVersion 1 schema (verified to fail without the fix).src/components/form/tests/utils.test.ts— locks the cents conversion.Notes
x-rmt-meta.jsfVersion: "1"is required — without it the schema silently goes through the v0 engine and the bug disappears.Note
Medium Risk
Touches headless form initial values and forced-value injection on submit/validation paths; changes are scoped and covered by new tests but affect conditional schema behavior for all jsf v1 forms with number guards.
Overview
Fixes Italy APL–style dead Continue behavior where validation failed on a hidden computed money field.
jsfVersion 1 conditional visibility:
createHeadlessFormnow injects coerced top-level number fields into initial values (same pattern as money), using strictisNumericValueso empty/whitespace/ambiguous values are not treated as0beforeif/allOfevaluation. That aligns visibility with validation when react-hook-form still has number inputs as strings ("50").Forced money consts:
ForcedValueFieldacceptsfieldTypeand converts money schema consts from cents to display units beforesetValue, so submit no longer double-appliesconvertToCents. Call sites passfieldTypefromJSONSchemaFormandFieldSetField.Adds
isNumericValue/ sharedcastNumberValuefor API number transforms, plus tests for number-guard visibility and money forced values.Reviewed by Cursor Bugbot for commit 28be947. Bugbot is set up for automated code reviews on this repo. Configure here.