Repository navigation
fix: Quick Apply screening toggles no longer default to "No" - #397
Conversation
QuickApplyModal initialized willing_to_relocate and is_authorized_to_work
to false in state, which the Yes/No Button pair rendered as No being
selected. A hasty submit could self-disqualify an applicant on work
authorization without them ever touching the control.
- Initialize both fields as undefined ("unanswered") instead of false,
and reflect a true three-way state (Yes / No / unanswered) in the
button styling.
- Add required-field validation for willing_to_relocate, mirroring the
existing is_authorized_to_work validation (validateField case,
handleSubmit check, inline error message).
- Restyle the Yes/No toggles as an outline segmented control with a
check icon on the selected option (color="success") instead of a
filled color="primary" button, so the selected state no longer reads
as a second CTA next to Submit.
- Fix "You current location" -> "Your current location" label typo.
- Update QuickApplyModal.test.tsx: fillRequiredFields now answers both
toggles, plus new tests for the unanswered-by-default state and for
blocking submission when either toggle is left unanswered.
Fixes #379.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RVmhvZbaGSZxEqbKufyrSQ
|
CI note: "Monorepo Integrity Checks" is failing on the "Check for duplicate dependencies in lock file (run Generated by Claude Code |
Test Results0 tests 0 ✅ 0s ⏱️ Results for commit 2e0fc33. |
|
CI note: "Lighthouse Performance Audit" fails during the shared Generated by Claude Code |
Fixes #379.
Root cause
QuickApplyModal'sformDatastate initializedwilling_to_relocateandis_authorized_to_worktofalse. The Yes/NoButtonpair keyed its selected styling off truthiness of that value (color={formData.x ? 'primary' : undefined}for Yes,color={!formData.x ? 'primary' : undefined}for No), so afalsedefault rendered as "No" pre-selected (filled) before the applicant touched anything — a hasty submit could self-disqualify on US work authorization without the applicant ever answering.is_authorized_to_workalready had required-field validation, butwilling_to_relocatehad none at all, so it could reach the submit payload unanswered either way.Fix
undefined("unanswered") instead offalse, in both the initialuseStateand thehandleClosereset, and switch the Yes/No button logic to a true three-way check (=== true/=== false/ neither) instead of truthiness, so neither option is pre-selected.willing_to_relocate, mirroring the existingis_authorized_to_workpattern: avalidateFieldcase, a check inhandleSubmit'svalidationErrorsblock, and an inline error message under the buttons. Submission is now blocked until both toggles are explicitly answered.variant="outline"always, with the selected option gettingcolor="success"and aCheckicon (iconStart), instead of the previous filledcolor="primary"— which read as a second CTA next to the modal'scolor="primary"Submit button.success+iconStartare patterns already used elsewhere inscf-core(e.g.SentryTestButtons.tsx,ReviewWizard.tsx,ShareResults.tsx), so this doesn't introduce a new Button API surface.Testing
packages/scf-core/features/applications/components/__tests__/QuickApplyModal.test.tsx:fillRequiredFieldsnow explicitly answers both toggles (previously it relied on thefalsedefault counting as "answered"). Added tests for: neither Yes/No pre-selected on open, submission blocked with a validation error whenwilling_to_relocateis left unanswered, submission blocked whenis_authorized_to_workis left unanswered, and a toggle showing as selected once clicked.pnpm exec biome checkon the changed component file: no new issues introduced by this diff. The file has pre-existing formatting drift (double vs. single quotes, JSX whitespace) predating this change — confirmed by running biome against the pre-change version, which reports the same single formatting error. Left untouched to keep this a surgical fix; not fixed here since biome's autofix would touch the whole file, which is out of scope for this issue.__tests__/*.test.tsxfiles are excluded from biome linting by this repo'sbiome.json.Known limitations of this sandbox
tsc --noEmit,vitest, orpnpm prepush(nx affected -t build/test) —node_modulesisn't installed at all in this worktree, and thepackages/ui/packages/sdkgit submodules aren't checked out (Scaffald/ui/Scaffald/sdknot accessible here), sopnpm installitself can't resolve theworkspace:*deps. This is the same known, pre-existing environment limitation earlier PRs in this repo (e.g. fix: Total Hours showing NaN on new work log form #395/fix: pin supabase CLI to workspace version, fix extensionless edge fn imports #396) hit. Pushed withSKIP_PREPUSH=1, which the repo's own.githooks/pre-pushdocuments as a supported skip path for exactly this situation.formDatastate transitions, theButtoncolor/variantconditionals, and the validation flow, plus the updated unit tests (not executed, for the reasons above, but logically traced against the component's new behavior).🤖 Opened by the Friday weekly-improvement routine.
Generated by Claude Code