Repository navigation
Share one screening session between Preview and published screeners - #586
Merged
Merged
Conversation
One module owns a person's answers, their evaluation, and the form-js form they answer in, so both screening pages can share it. Name the concept in a new glossary. Part of #585. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preview keeps only its chrome. Its form now stops listening when it unmounts before the first import finishes. The results extension is tested against a plain form-js form instead of through each renderer. Part of #585. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page keeps the CRM bridge and its chrome; the session's latest-evaluation hooks report results and failures to the host. Published screeners now evaluate 500ms after answers stop changing, as Preview does. The renderer tests move to the session, and the page tests drive a real form instead of a mocked renderer. Part of #585. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preview used to evaluate as soon as it opened only because its renderer mistook form-js's first fill for an edit. Make that an explicit evaluateOnLoad option, separate from the unknown answers a host provides, so Preview still evaluates unanswered checkboxes as unchecked. Part of #585. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
prestoncabe
force-pushed
the
585-shared-screening-session
branch
from
November 5, 2026 00:16
600fe33 to
20b8376
Compare
Move the helpers that type into a real form-js form out of the screening session, and explain in the README why they exist. Update the README's screening results section for the shared screening session. Part of #585. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 5, 2026
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.
Closes #585.
Summary
Preview and the published screener each had their own copy of the screening session flow (form-js mount, debounce, the guard against out-of-date evaluations, stale/failed state, hidden questions). The copies had drifted. Now both pages create one screening session and keep only their chrome.
Behaviour changes:
evaluateOnLoadoption (see the comment on #585).Adds a root
GLOSSARY.mddefining Screener, Published screener, Preview and Screening session.Evidence
FormRenderers and calledsubmitForm/onDataChangeby hand. The real chain (form-jschanged→ debounce → evaluate → stale/failed) never ran for published screeners.After:
screeningSession.test.tsx(18 tests) types into a real form-js form, with a fake evaluate adapter whose promises the test settles. It covers debounce, out-of-date responses and failures, hidden questions and re-import, prefill with unknown answers, evaluate on load, teardown, and the next steps projection.Screener.test.tsxandPreview.test.tsxdrive the real form too.npm test: 54 files, 389 tests passed.npm run build: passed.bin/run-e2e-tests: 25 passed. During development, "User can Preview a Screener Form" caught the evaluate-on-open regression and now passes.Merge Danger
Door: two-way
A frontend-only refactor. No API, schema or stored-data changes. A revert restores both renderers.
Blast Radius: screening
Every screening session, in Preview and on published screeners including CRM hosts, now runs through this module. The places most likely to show a regression are the faster published debounce (more evaluations sent to builder-api while someone types) and the timing of CRM results and next steps.
🤖 Generated with Claude Code