Skip to content

Show unanswered questions for undecided benefits - #580

Merged
prestoncabe merged 11 commits into
mainfrom
560-unanswered-next-steps
Oct 29, 2026
Merged

prestoncabe merged 11 commits into
mainfrom
560-unanswered-next-steps

Conversation

@prestoncabe

@prestoncabe prestoncabe commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Undecided benefits now list the unanswered questions they still need in Next steps and Print summary. Answering those questions clears the prompts as the benefit becomes decided.

Closes #560. Follow-up to #552 after #579.

  • Map missing inputs from undecided checks to static form question labels, using the normalized answers sent for evaluation. Zero, No, explicit None, and whitespace sent as typed count as answered.
  • Deduplicate shared inputs; use group labels and repeated-item numbers to distinguish questions with the same label. Omit questions hidden by form conditions and inputs used only by decided checks.
  • Build the label index once per schema and preserve the questions' identity when their content is unchanged. The immutable form snapshot contains labels, without answers or technical paths. Dynamic labels and unmapped inputs retain the generic request for more information.
  • Pending and failed evaluations suppress stale prompts. When-complete fields can request missing answers while their decided-benefit instructions wait for completion. CRM Next steps remains decided-benefit-only.

Validation on the rebased branch: 328 frontend tests across 50 files, production frontend build, 12 public screener/CRM browser tests, and git diff --check passed. All six GitHub Actions checks passed on head 497a87e8 before merging, including the full end-to-end suite.

prestoncabe and others added 11 commits October 29, 2026 19:45
A nested field sharing its key with an unneeded top-level path was
removed from the form while still listed as unanswered, and nested
fields were never hidden because checks name them by full path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The eligibility service receives whitespace unchanged, so prompting for
it contradicted what was evaluated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Array normalization, unanswered-question labels and question hiding each
joined group paths and keys separately. They now share forEachKeyedField
and joinPath, and the answer lookup refuses unsafe object keys like
normalizeArrayFieldData does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Questions were deduplicated by label text, so client and spouse fields
both labelled "Date of birth", or several people in a repeated section,
collapsed into one entry that didn't say whose answer was missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both form renderers copied the same memo; the shared connection now takes
the schema and evaluated answers and derives the questions itself, so
later fixes land in one place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The memo compared by identity and the helper returns a new object each
time, so every answer edit or evaluation copied, froze and republished
identical questions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The schema was walked again on every answer edit or evaluation to rebuild
the path-to-label map. indexQuestions builds it once per schema, and
unansweredQuestions only looks answers up against it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The memo already builds a fresh object for each form, so the service now
freezes it in place instead of deep-cloning it, and assigns it directly
instead of through a conditional spread.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Labels came from every keyed field, so Next steps and the print summary
could ask for an answer to a question form-js was hiding, such as spouse
income for someone who isn't married. The value paths form-js clears for
hidden fields are now skipped, judged again after each import.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@prestoncabe
prestoncabe force-pushed the 560-unanswered-next-steps branch from d5f94ab to 497a87e Compare October 29, 2026 23:46
@prestoncabe
prestoncabe marked this pull request as ready for review October 29, 2026 23:50
@prestoncabe
prestoncabe merged commit e1c69c9 into main Oct 29, 2026
6 checks passed
@prestoncabe
prestoncabe deleted the 560-unanswered-next-steps branch October 29, 2026 23:52
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.

Show what's still needed for undecided benefits in Next steps

1 participant