Repository navigation
Fix review findings from the shared screening session - #591
Merged
Merged
Conversation
An edit outdates the evaluation in flight, so the session no longer reports loading until it sends the new answers, as its interface says. The form-js test helper's focusout already hands each answer to the form before the post-import redraw can reset it, so drop the fixed 100ms settle(). Rename type() to answer(), which reads unambiguously in an import list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Drop NextStepsProvider, unused since the session projects next steps. - Type Preview's answers as ScreeningAnswers and remove the duplicate PreviewFormData declarations. - Destructure screenerName with the session's other options. - Lower the type-check baseline for the deleted preview FormRenderer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The failure was about answers that are no longer the latest, so Preview and the published screener stop reporting it while the new answers wait to be evaluated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Results took the session's loading flag, which an edit now clears until the answers are sent. For half a second the pane showed old benefit rows with no indicator, or went blank while the first results were pending. Drive the indicator from stale instead, and hide it once an evaluation fails, since the failure alert covers that state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The importing flag stayed set until the awaited import resumed, so an edit landing in that window would update the answers without marking them stale or scheduling an evaluation. form-js imports synchronously, so clear the flag as soon as importSchema returns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Results imported it from the screening session module, which also pulls in form-js and its CSS, just for a type. Define it in @/types beside ScreenerResult. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
toBeDefined() passes when input() finds the label but no control, so several waits could end before the field rendered. Wait for a truthy field instead, and have answer() name the label it could not find rather than failing with a TypeError on null. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Follow-up to #586 (part of #585), from a
/code-reviewof that PR.Summary
Loading during the wait. An edit outdates the evaluation in flight. Until now
loadingstayed true through the 500ms wait, although the session's interface says it is true "only while the latest answers are being evaluated, not while waiting to send them".on form-js "changed" latestEvaluation++ setStale(true) + setLoading(false) // nothing is evaluating the new answers yet debouncedSubmit(answers)In Preview, the Results panel keeps showing the last results without a loading state until the new evaluation actually starts.
Test helpers (
src/testing/formJs.ts):settle()was a fixed 100ms sleep meant to outlast form-js's redraw about 60ms after an import. On a slow runner the redraw could land later and make tests flaky. Thefocusoutthatanswer()already sends hands the answer to form-js at once, so the redraw keeps it and no wait is needed.typeread like TypeScript's inline type-import keyword inimport { …, type, until }.Leftovers from #586:
NextStepsProvideris deleted; nothing used it once the session started projecting next steps.Resultstypes its answers asScreeningAnswers. The two duplicatePreviewFormDatadeclarations andpreview/types.tsare removed.screenerNameis destructured with the session's other options.FormRenderer(151 → 150).Evidence
loadingafter an edit while an evaluation was in flight.After:
screeningSession.test.tsx, "outdates an evaluation in flight as soon as an answer changes":settle(), I ran a throwaway test 5 times. It typed into a form-js textfield right afterimportSchema, sentfocusout, and checked 200ms later. Both the form state and the input kept"typed"every time. The session, Screener and Preview tests then passed 3 runs in a row with no wait.devbox run test -- builder-frontend, run on each commit:Merge Danger
Door: two-way
Small, and reverts cleanly.
Blast Radius: Preview results
The only runtime change is that Preview's Results panel doesn't show loading between an edit and the evaluation it triggers. Published screeners don't read
loading.🤖 Generated with Claude Code