Uh oh!
There was an error while loading. Please reload this page.
NSCP review fixes: deeper pass on top of recent surgical fixes (#23) - #2
Open
EfeosasereOkoro-gov wants to merge 1 commit into
Open
NSCP review fixes: deeper pass on top of recent surgical fixes (#23)#2EfeosasereOkoro-gov wants to merge 1 commit into
EfeosasereOkoro-gov wants to merge 1 commit into
Conversation
…cture Addresses 22 review items from #23 across both reviewers. Framework (govbb-framework.js): - render() preserves scroll + focus when called for conditional re-renders; only navigates-to-top on real next/back/nav - Radio inputs now use 'change' event and restore checked state on re-render - New _clearFieldError() clears inline errors, aria-invalid, and matching summary list items as user fixes each field - _hidePreviousOnFirstStep() wired up in render() NSCP form (nscp-camper-registration.html): - Flow restructured: camp page split into Camp / Activities / Photos - Emergency-contact step always visible (step counter stable at 11) - Name fields split into First / Other (optional) / Surname for camper, guardian, and emergency contact - Meals: conditional dietary reveal when Yes; data-trigger-render added - DOB validation flags all 3 fields (Day/Month/Year), not just Day - First-aid consent now an explicit required checkbox on activities page - Medication Authorisation Form download link added - Confirmation page: email mention, print/save button, register another child - Check page: 'Sex' label, new activities + photos sections - Topics-of-interest hint clarifies at-least-one requirement - All 14 checkboxes now top-aligned with consistent spacing Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done |
✅ I finished the code review, and didn't find any security or code quality issues. |
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 freeto 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.
Summary
Comprehensive review pass on the NSCP Camper Registration form addressing the 22 items in govtech-bb/projects#23 that werent covered by the recent surgical fixes on
main.Two reviewers (manual + Claude) raised issues across Critical / Significant / Minor. This PR layers the structural and framework-level changes on top of the inline copy/validation fixes already merged.
Live preview (after merge):https://govtech-bb.github.io/newforms/Prototypes/nscp-camper-registration.html
What is in this PR
Framework (
assets/govbb-framework.js)render(preserveScroll)-- only scrolls to top on real next/back/nav. Conditional re-renders preserve scroll + restore keyboard focus to the just-clicked control.changeevent (wasinput) and reliably restorecheckedstate on every render._clearFieldError(el)-- clears inline error message,aria-invalid, and the matching<li>in the error summary as soon as the user fixes a field. Handles radio groups by name._hidePreviousOnFirstStepnow actually wired up inrender().These framework improvements benefit every prototype using
govbb-framework.js, not just NSCP.NSCP form (
Prototypes/nscp-camper-registration.html)getFlowfilter that dropped the step when guardian = emergency contact. When that's the case, the page renders a confirmation-only view ("You said you are the emergency contact... change") with Continue. Total form steps stable at 11 -- fixes the 9->8 step counter jump.Relationship to the recently-merged fixes (#1)
The commit on
main(570773b) made small surgical fixes to 6 items in the NSCP HTML. Two of those overlap with this PR:data-show-when-namepattern (so the same conditional reveal style as every other Yes/No in the form). Behaviour is the same._clearFieldErrorso it works everywhere automatically.Both overlaps should be reviewed; if the framework-level versions look cleaner, the inline ones can come out in a follow-up. No functional regression either way.
Test plan