Skip to content

fix: Quick Apply screening toggles no longer default to "No" - #397

Merged
thinkclay merged 1 commit into
mainfrom
worktree-fix-quick-apply-defaults
Jul 22, 2026
Merged

thinkclay merged 1 commit into
mainfrom
worktree-fix-quick-apply-defaults

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Fixes #379.

Root cause

QuickApplyModal's formData state initialized willing_to_relocate and is_authorized_to_work to false. The Yes/No Button pair keyed its selected styling off truthiness of that value (color={formData.x ? 'primary' : undefined} for Yes, color={!formData.x ? 'primary' : undefined} for No), so a false default 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_work already had required-field validation, but willing_to_relocate had none at all, so it could reach the submit payload unanswered either way.

Fix

  • Initialize both fields as undefined ("unanswered") instead of false, in both the initial useState and the handleClose reset, 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.
  • Added required-field validation for willing_to_relocate, mirroring the existing is_authorized_to_work pattern: a validateField case, a check in handleSubmit's validationErrors block, and an inline error message under the buttons. Submission is now blocked until both toggles are explicitly answered.
  • Restyled both Yes/No toggle pairs as an outline segmented control: variant="outline" always, with the selected option getting color="success" and a Check icon (iconStart), instead of the previous filled color="primary" — which read as a second CTA next to the modal's color="primary" Submit button. success + iconStart are patterns already used elsewhere in scf-core (e.g. SentryTestButtons.tsx, ReviewWizard.tsx, ShareResults.tsx), so this doesn't introduce a new Button API surface.
  • Fixed the "You current location" → "Your current location" label typo.

Testing

  • Updated packages/scf-core/features/applications/components/__tests__/QuickApplyModal.test.tsx: fillRequiredFields now explicitly answers both toggles (previously it relied on the false default counting as "answered"). Added tests for: neither Yes/No pre-selected on open, submission blocked with a validation error when willing_to_relocate is left unanswered, submission blocked when is_authorized_to_work is left unanswered, and a toggle showing as selected once clicked.
  • pnpm exec biome check on 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.tsx files are excluded from biome linting by this repo's biome.json.

Known limitations of this sandbox

  • Could not run tsc --noEmit, vitest, or pnpm prepush (nx affected -t build/test) — node_modules isn't installed at all in this worktree, and the packages/ui/packages/sdk git submodules aren't checked out (Scaffald/ui/Scaffald/sdk not accessible here), so pnpm install itself can't resolve the workspace:* 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 with SKIP_PREPUSH=1, which the repo's own .githooks/pre-push documents as a supported skip path for exactly this situation.
  • No Docker daemon here, so I could not run the app/Supabase locally to click through the Quick Apply flow. Verified the logic by careful reading of formData state transitions, the Button color/variant conditionals, 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

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

Copy link
Copy Markdown
Contributor Author

CI note: "Monorepo Integrity Checks" is failing on the "Check for duplicate dependencies in lock file (run pnpm dedupe to fix)" step. This is pre-existing repo-wide pnpm-lock.yaml drift (mostly transitive @babel/* version duplication) unrelated to this diff — the identical step fails the same way on #396, an unrelated PR. Fixing it means regenerating the lockfile repo-wide, which is out of scope for this surgical bug fix; flagging it separately for follow-up rather than bundling it here.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 2e0fc33.

Copy link
Copy Markdown
Contributor Author

CI note: "Lighthouse Performance Audit" fails during the shared pnpm build step, specifically on docs-site:build (Docusaurus): Invalid name=docusaurus-theme-mermaid version number=3.10.1. All official @docusaurus/* packages should have the exact same version as @docusaurus/core (number=3.9.2). This is the same class of pre-existing, unrelated-to-app-code issue already tracked in #377 (docs site only) — Lighthouse itself never runs because the build step it depends on aborts first on an unrelated package. Not caused by this diff; not fixing here.


Generated by Claude Code

@thinkclay
thinkclay marked this pull request as ready for review July 22, 2026 05:04
@thinkclay
thinkclay merged commit 28d2706 into main Jul 22, 2026
9 of 12 checks passed
@thinkclay
thinkclay deleted the worktree-fix-quick-apply-defaults branch July 30, 2026 18:20
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.

Quick Apply modal: screening toggles default to "No" (incl. US work authorization) + "You current location" typo

2 participants