fix: make demographics race "Decline to respond" option exclusive#6317
Open
youhaowei wants to merge 1 commit into
Open
fix: make demographics race "Decline to respond" option exclusive#6317youhaowei wants to merge 1 commit into
youhaowei wants to merge 1 commit into
Conversation
👷 Deploy request for partners-bloom-msq2 pending review.Visit the deploys page to approve it
|
👷 Deploy request for bloom-angelopolis pending review.Visit the deploys page to approve it
|
The race question on the application demographics step allowed "Decline to respond" to be selected alongside other race options. Wire the race FieldGroup so checking "Decline to respond" clears all other race options, and checking any other option clears "Decline to respond", reusing the shared setExclusive helper that powers the same behavior in the application preferences/programs step. Closes bloom-housing#2884 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
3ef43b8 to
52d6709
Compare
Author
|
Re-triggering CI — the failures are in submit-application.spec.ts (unhandled auth-client error at the address step, before demographics) and map-address-popup (map view flake). Both are unrelated to this PR's changes. Re-running. |
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.
Issue
Closes #2884
On the application demographics step, the race question allowed "Decline to respond" to be selected at the same time as other race options. It should be mutually exclusive — the same exclusive-checkbox behavior already used in the application preferences/programs step.
Change
sites/public/src/pages/applications/review/demographics.tsx:setExclusivehelper (shared-helpers/.../multiselectQuestions.tsx) that powers the same behavior inApplicationMultiselectQuestionStep. The per-fieldonChangeis wired throughFieldGroup's existinginputProps—FieldGroupitself is unchanged.Testing
demographics.test.tsxcover both directions of exclusivity; full demographics suite is 14/14 passing.tsc, ESLint, and Prettier are clean.Known issue — not fixed here, needs discussion
FieldGroup(in@bloom-housing/ui-components) decides sub-option visibility from an internal click-tracked array (checkedInputs) rather than from form state. Because this fix unchecks options programmatically viasetValue(which fires no click event), a parent option's sub-options stay visually expanded after the parent is cleared by the exclusive logic — e.g. expand "Asian", then check "Decline to respond": "Asian" and its sub-options uncheck correctly, but the sub-option rows remain on screen until the next interaction.ui-componentsFieldGroupand affects every consumer. The proper fix is to derive sub-option visibility from watched form state instead of the click-tracked mirror. That is a cross-repo change and is left for team discussion on how best to handle.🤖 Generated with Claude Code